Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
865b82af
Commit
865b82af
authored
Aug 03, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Optimize bool and int pixel shader constants.
parent
4673b1c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
30 deletions
+58
-30
device.c
dlls/wined3d/device.c
+28
-2
stateblock.c
dlls/wined3d/stateblock.c
+26
-28
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/device.c
View file @
865b82af
...
...
@@ -482,6 +482,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
object
->
contained_vs_consts_b
[
j
]
=
j
;
}
object
->
num_contained_vs_consts_b
=
MAX_CONST_B
;
for
(
j
=
0
;
j
<
MAX_CONST_I
;
j
++
)
{
object
->
contained_ps_consts_i
[
j
]
=
j
;
}
object
->
num_contained_ps_consts_i
=
MAX_CONST_I
;
for
(
j
=
0
;
j
<
MAX_CONST_B
;
j
++
)
{
object
->
contained_ps_consts_b
[
j
]
=
j
;
}
object
->
num_contained_ps_consts_b
=
MAX_CONST_B
;
}
else
if
(
Type
==
WINED3DSBT_PIXELSTATE
)
{
...
...
@@ -493,10 +501,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
/* Pixel Shader Constants */
for
(
i
=
0
;
i
<
GL_LIMITS
(
pshader_constantsF
);
++
i
)
object
->
changed
.
pixelShaderConstantsF
[
i
]
=
TRUE
;
for
(
i
=
0
;
i
<
MAX_CONST_B
;
++
i
)
for
(
i
=
0
;
i
<
MAX_CONST_B
;
++
i
)
{
object
->
contained_ps_consts_b
[
i
]
=
i
;
object
->
changed
.
pixelShaderConstantsB
[
i
]
=
TRUE
;
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
}
object
->
num_contained_ps_consts_b
=
MAX_CONST_B
;
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
object
->
contained_ps_consts_i
[
i
]
=
i
;
object
->
changed
.
pixelShaderConstantsI
[
i
]
=
TRUE
;
}
object
->
num_contained_ps_consts_i
=
MAX_CONST_I
;
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_R
;
i
++
)
{
object
->
changed
.
renderState
[
SavedPixelStates_R
[
i
]]
=
TRUE
;
...
...
@@ -4359,6 +4373,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW
object
->
num_contained_vs_consts_b
++
;
}
}
for
(
i
=
0
;
i
<
MAX_CONST_I
;
i
++
)
{
if
(
object
->
changed
.
pixelShaderConstantsI
[
i
])
{
object
->
contained_ps_consts_i
[
object
->
num_contained_ps_consts_i
]
=
i
;
object
->
num_contained_ps_consts_i
++
;
}
}
for
(
i
=
0
;
i
<
MAX_CONST_B
;
i
++
)
{
if
(
object
->
changed
.
pixelShaderConstantsB
[
i
])
{
object
->
contained_ps_consts_b
[
object
->
num_contained_ps_consts_b
]
=
i
;
object
->
num_contained_ps_consts_b
++
;
}
}
*
ppStateBlock
=
(
IWineD3DStateBlock
*
)
object
;
This
->
isRecordingState
=
FALSE
;
...
...
dlls/wined3d/stateblock.c
View file @
865b82af
...
...
@@ -455,31 +455,29 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
This
->
pixelShaderConstantF
[
i
*
4
+
3
]
=
targetStateBlock
->
pixelShaderConstantF
[
i
*
4
+
3
];
}
}
/* Pixel Shader Integer Constants */
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
if
(
This
->
changed
.
pixelShaderConstantsI
[
i
])
{
TRACE
(
"Setting %p from %p %d to { %d, %d, %d, %d }
\n
"
,
This
,
targetStateBlock
,
i
,
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
1
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
2
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
3
]);
This
->
pixelShaderConstantI
[
i
*
4
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
];
This
->
pixelShaderConstantI
[
i
*
4
+
1
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
1
];
This
->
pixelShaderConstantI
[
i
*
4
+
2
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
2
];
This
->
pixelShaderConstantI
[
i
*
4
+
3
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
3
];
}
for
(
j
=
0
;
j
<
This
->
num_contained_ps_consts_i
;
++
j
)
{
i
=
This
->
contained_ps_consts_i
[
j
];
TRACE
(
"Setting %p from %p %d to { %d, %d, %d, %d }
\n
"
,
This
,
targetStateBlock
,
i
,
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
1
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
2
],
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
3
]);
This
->
pixelShaderConstantI
[
i
*
4
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
];
This
->
pixelShaderConstantI
[
i
*
4
+
1
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
1
];
This
->
pixelShaderConstantI
[
i
*
4
+
2
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
2
];
This
->
pixelShaderConstantI
[
i
*
4
+
3
]
=
targetStateBlock
->
pixelShaderConstantI
[
i
*
4
+
3
];
}
/* Pixel Shader Boolean Constants */
for
(
i
=
0
;
i
<
MAX_CONST_B
;
++
i
)
{
i
f
(
This
->
changed
.
pixelShaderConstantsB
[
i
])
{
TRACE
(
"Setting %p from %p %d to %s
\n
"
,
This
,
targetStateBlock
,
i
,
targetStateBlock
->
pixelShaderConstantB
[
i
]
?
"TRUE"
:
"FALSE"
);
for
(
j
=
0
;
j
<
This
->
num_contained_ps_consts_b
;
++
j
)
{
i
=
This
->
contained_ps_consts_b
[
j
];
TRACE
(
"Setting %p from %p %d to %s
\n
"
,
This
,
targetStateBlock
,
i
,
targetStateBlock
->
pixelShaderConstantB
[
i
]
?
"TRUE"
:
"FALSE"
);
This
->
pixelShaderConstantB
[
i
]
=
targetStateBlock
->
pixelShaderConstantB
[
i
];
}
This
->
pixelShaderConstantB
[
i
]
=
targetStateBlock
->
pixelShaderConstantB
[
i
];
}
/* Others + Render & Texture */
...
...
@@ -670,14 +668,14 @@ should really perform a delta so that only the changes get updated*/
IWineD3DDevice_SetPixelShaderConstantF
(
pDevice
,
i
,
This
->
pixelShaderConstantF
+
i
*
4
,
1
);
}
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
if
(
This
->
changed
.
pixelShaderConstantsI
[
i
])
IWineD3DDevice_SetPixelShaderConstantI
(
pDevice
,
i
,
This
->
pixelShaderConstantI
+
i
*
4
,
1
);
for
(
i
=
0
;
i
<
This
->
num_contained_ps_consts_i
;
i
++
)
{
IWineD3DDevice_SetPixelShaderConstantI
(
pDevice
,
This
->
contained_ps_consts_i
[
i
],
This
->
pixelShaderConstantI
+
This
->
contained_ps_consts_i
[
i
]
*
4
,
1
);
}
for
(
i
=
0
;
i
<
MAX_CONST_B
;
++
i
)
{
if
(
This
->
changed
.
pixelShaderConstantsB
[
i
])
IWineD3DDevice_SetPixelShaderConstantB
(
pDevice
,
i
,
This
->
pixelShaderConstantB
+
i
,
1
);
for
(
i
=
0
;
i
<
This
->
num_contained_ps_consts_b
;
i
++
)
{
IWineD3DDevice_SetPixelShaderConstantB
(
pDevice
,
This
->
contained_ps_consts_b
[
i
],
This
->
pixelShaderConstantB
+
This
->
contained_ps_consts_b
[
i
]
,
1
);
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
865b82af
...
...
@@ -1375,6 +1375,10 @@ struct IWineD3DStateBlockImpl
unsigned
int
num_contained_vs_consts_i
;
DWORD
contained_vs_consts_b
[
MAX_CONST_B
];
unsigned
int
num_contained_vs_consts_b
;
DWORD
contained_ps_consts_i
[
MAX_CONST_I
];
unsigned
int
num_contained_ps_consts_i
;
DWORD
contained_ps_consts_b
[
MAX_CONST_B
];
unsigned
int
num_contained_ps_consts_b
;
};
extern
void
stateblock_savedstates_set
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment