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
fc39831e
Commit
fc39831e
authored
Jan 05, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Convert transform to a bitmap in struct SAVEDSTATES.
parent
48973dad
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
device.c
dlls/wined3d/device.c
+10
-5
stateblock.c
dlls/wined3d/stateblock.c
+10
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
fc39831e
...
...
@@ -2669,7 +2669,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTransform(IWineD3DDevice *iface, W
/* Handle recording of state blocks */
if
(
This
->
isRecordingState
)
{
TRACE
(
"Recording... not performing anything
\n
"
);
This
->
updateStateBlock
->
changed
.
transform
[
d3dts
]
=
TRUE
;
This
->
updateStateBlock
->
changed
.
transform
[
d3dts
>>
5
]
|=
1
<<
(
d3dts
&
0x1f
)
;
This
->
updateStateBlock
->
transforms
[
d3dts
]
=
*
lpmatrix
;
return
WINED3D_OK
;
}
...
...
@@ -4752,10 +4752,15 @@ 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
++
;
for
(
i
=
0
;
i
<=
HIGHEST_TRANSFORMSTATE
>>
5
;
++
i
)
{
DWORD
map
=
object
->
changed
.
transform
[
i
];
for
(
j
=
0
;
map
;
map
>>=
1
,
++
j
)
{
if
(
!
(
map
&
1
))
continue
;
object
->
contained_transform_states
[
object
->
num_contained_transform_states
++
]
=
(
i
<<
5
)
|
j
;
}
}
for
(
i
=
0
;
i
<
GL_LIMITS
(
vshader_constantsF
);
i
++
)
{
...
...
dlls/wined3d/stateblock.c
View file @
fc39831e
...
...
@@ -89,7 +89,7 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
dest
->
streamSource
=
source
->
streamSource
;
dest
->
streamFreq
=
source
->
streamFreq
;
dest
->
textures
=
source
->
textures
;
memcpy
(
dest
->
transform
,
source
->
transform
,
bsize
*
(
HIGHEST_TRANSFORMSTATE
+
1
));
memcpy
(
dest
->
transform
,
source
->
transform
,
sizeof
(
source
->
transform
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
bsize
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memcpy
(
dest
->
textureState
,
source
->
textureState
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
memcpy
(
dest
->
samplerState
,
source
->
samplerState
,
bsize
*
MAX_COMBINED_SAMPLERS
*
(
WINED3D_HIGHEST_SAMPLER_STATE
+
1
));
...
...
@@ -104,6 +104,13 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
memcpy
(
dest
->
vertexShaderConstantsF
,
source
->
vertexShaderConstantsF
,
bsize
*
GL_LIMITS
(
vshader_constantsF
));
}
static
inline
void
stateblock_set_bits
(
DWORD
*
map
,
UINT
map_size
)
{
DWORD
mask
=
(
1
<<
(
map_size
&
0x1f
))
-
1
;
memset
(
map
,
0xff
,
(
map_size
>>
5
)
*
sizeof
(
*
map
));
if
(
mask
)
map
[
map_size
>>
5
]
=
mask
;
}
/** Set all members of a stateblock savedstate to the given value */
void
stateblock_savedstates_set
(
IWineD3DStateBlock
*
iface
,
...
...
@@ -126,7 +133,8 @@ void stateblock_savedstates_set(
states
->
streamSource
=
value
?
0xffff
:
0
;
states
->
streamFreq
=
value
?
0xffff
:
0
;
states
->
textures
=
value
?
0xfffff
:
0
;
memset
(
states
->
transform
,
value
,
bsize
*
(
HIGHEST_TRANSFORMSTATE
+
1
));
if
(
value
)
stateblock_set_bits
(
states
->
transform
,
HIGHEST_TRANSFORMSTATE
+
1
);
else
memset
(
states
->
transform
,
0
,
sizeof
(
states
->
transform
));
memset
(
states
->
renderState
,
value
,
bsize
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memset
(
states
->
textureState
,
value
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
));
memset
(
states
->
samplerState
,
value
,
bsize
*
MAX_COMBINED_SAMPLERS
*
(
WINED3D_HIGHEST_SAMPLER_STATE
+
1
));
...
...
dlls/wined3d/wined3d_private.h
View file @
fc39831e
...
...
@@ -1758,10 +1758,10 @@ extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl;
/* Note: Very long winded but gl Lists are not flexible enough */
/* to resolve everything we need, so doing it manually for now */
typedef
struct
SAVEDSTATES
{
DWORD
transform
[(
HIGHEST_TRANSFORMSTATE
>>
5
)
+
1
];
WORD
streamSource
;
/* MAX_STREAMS, 16 */
WORD
streamFreq
;
/* MAX_STREAMS, 16 */
DWORD
textures
;
/* MAX_COMBINED_SAMPLERS, 20 */
BOOL
transform
[
HIGHEST_TRANSFORMSTATE
+
1
];
BOOL
renderState
[
WINEHIGHEST_RENDER_STATE
+
1
];
BOOL
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
BOOL
samplerState
[
MAX_COMBINED_SAMPLERS
][
WINED3D_HIGHEST_SAMPLER_STATE
+
1
];
...
...
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