Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
92ce028a
Commit
92ce028a
authored
Jul 31, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Optimize transform state in stateblocks.
parent
b56afd0c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
device.c
dlls/wined3d/device.c
+11
-1
stateblock.c
dlls/wined3d/stateblock.c
+7
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/device.c
View file @
92ce028a
...
...
@@ -469,7 +469,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
for
(
j
=
1
;
j
<=
WINEHIGHEST_RENDER_STATE
;
j
++
)
{
object
->
contained_render_states
[
j
-
1
]
=
j
;
}
object
->
num_contained_render_states
=
WINEHIGHEST_RENDER_STATE
;
/* TODO: Filter unused transforms between TEXTURE8 and WORLD0? */
for
(
j
=
1
;
j
<=
HIGHEST_TRANSFORMSTATE
;
j
++
)
{
object
->
contained_transform_states
[
j
-
1
]
=
j
;
}
object
->
num_contained_transform_states
=
HIGHEST_TRANSFORMSTATE
;
}
else
if
(
Type
==
WINED3DSBT_PIXELSTATE
)
{
...
...
@@ -4324,6 +4328,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW
object
->
num_contained_render_states
++
;
}
}
for
(
i
=
1
;
i
<=
HIGHEST_TRANSFORMSTATE
;
i
++
)
{
if
(
object
->
changed
.
transform
[
i
])
{
object
->
contained_transform_states
[
object
->
num_contained_transform_states
]
=
i
;
object
->
num_contained_transform_states
++
;
}
}
*
ppStateBlock
=
(
IWineD3DStateBlock
*
)
object
;
This
->
isRecordingState
=
FALSE
;
...
...
dlls/wined3d/stateblock.c
View file @
92ce028a
...
...
@@ -485,13 +485,11 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
}
/* Others + Render & Texture */
for
(
i
=
1
;
i
<=
HIGHEST_TRANSFORMSTATE
;
i
++
)
{
if
(
This
->
changed
.
transform
[
i
]
&&
memcmp
(
&
targetStateBlock
->
transforms
[
i
],
&
This
->
transforms
[
i
],
sizeof
(
WINED3DMATRIX
))
!=
0
)
{
for
(
i
=
0
;
i
<
This
->
num_contained_transform_states
;
i
++
)
{
TRACE
(
"Updating transform %d
\n
"
,
i
);
memcpy
(
&
This
->
transforms
[
i
],
&
targetStateBlock
->
transforms
[
i
],
sizeof
(
WINED3DMATRIX
));
}
memcpy
(
&
This
->
transforms
[
This
->
contained_transform_states
[
i
]],
&
targetStateBlock
->
transforms
[
This
->
contained_transform_states
[
i
]],
sizeof
(
WINED3DMATRIX
));
}
if
(
This
->
changed
.
indices
&&
((
This
->
pIndexData
!=
targetStateBlock
->
pIndexData
)
...
...
@@ -695,9 +693,9 @@ should really perform a delta so that only the changes get updated*/
/* Others + Render & Texture */
if
(
/*TODO: 'magic' statetype, replace with BOOL This->blockType == D3DSBT_RECORDED || */
This
->
blockType
==
WINED3DSBT_ALL
||
This
->
blockType
==
WINED3DSBT_INIT
)
{
for
(
i
=
1
;
i
<=
HIGHEST_TRANSFORMSTATE
;
i
++
)
{
if
(
This
->
changed
.
transform
[
i
])
IWineD3DDevice_SetTransform
(
pDevice
,
i
,
&
This
->
transforms
[
i
]);
for
(
i
=
0
;
i
<
This
->
num_contained_transform_states
;
i
++
)
{
IWineD3DDevice_SetTransform
(
pDevice
,
This
->
contained_transform_states
[
i
],
&
This
->
transforms
[
This
->
contained_transform_states
[
i
]
]);
}
if
(
This
->
changed
.
indices
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
92ce028a
...
...
@@ -1369,6 +1369,8 @@ struct IWineD3DStateBlockImpl
/* Contained state management */
DWORD
contained_render_states
[
WINEHIGHEST_RENDER_STATE
+
1
];
unsigned
int
num_contained_render_states
;
DWORD
contained_transform_states
[
WINEHIGHEST_RENDER_STATE
+
1
];
unsigned
int
num_contained_transform_states
;
};
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