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
c33b3811
Commit
c33b3811
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 renderState to a bitmap in struct SAVEDSTATES.
parent
fc39831e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
22 deletions
+43
-22
device.c
dlls/wined3d/device.c
+15
-9
stateblock.c
dlls/wined3d/stateblock.c
+27
-12
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
c33b3811
...
...
@@ -470,8 +470,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
object
->
num_contained_ps_consts_i
=
MAX_CONST_I
;
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_R
;
i
++
)
{
object
->
changed
.
renderState
[
SavedPixelStates_R
[
i
]]
=
TRUE
;
object
->
contained_render_states
[
i
]
=
SavedPixelStates_R
[
i
];
DWORD
rs
=
SavedPixelStates_R
[
i
];
object
->
changed
.
renderState
[
rs
>>
5
]
|=
1
<<
(
rs
&
0x1f
);
object
->
contained_render_states
[
i
]
=
rs
;
}
object
->
num_contained_render_states
=
NUM_SAVEDPIXELSTATES_R
;
for
(
j
=
0
;
j
<
MAX_TEXTURES
;
j
++
)
{
...
...
@@ -527,8 +528,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
}
object
->
num_contained_vs_consts_i
=
MAX_CONST_I
;
for
(
i
=
0
;
i
<
NUM_SAVEDVERTEXSTATES_R
;
i
++
)
{
object
->
changed
.
renderState
[
SavedVertexStates_R
[
i
]]
=
TRUE
;
object
->
contained_render_states
[
i
]
=
SavedVertexStates_R
[
i
];
DWORD
rs
=
SavedVertexStates_R
[
i
];
object
->
changed
.
renderState
[
rs
>>
5
]
|=
1
<<
(
rs
&
0x1f
);
object
->
contained_render_states
[
i
]
=
rs
;
}
object
->
num_contained_render_states
=
NUM_SAVEDVERTEXSTATES_R
;
for
(
j
=
0
;
j
<
MAX_TEXTURES
;
j
++
)
{
...
...
@@ -3262,7 +3264,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
TRACE
(
"(%p)->state = %s(%d), value = %d
\n
"
,
This
,
debug_d3drenderstate
(
State
),
State
,
Value
);
This
->
updateStateBlock
->
changed
.
renderState
[
State
]
=
TRUE
;
This
->
updateStateBlock
->
changed
.
renderState
[
State
>>
5
]
|=
1
<<
(
State
&
0x1f
)
;
This
->
updateStateBlock
->
renderState
[
State
]
=
Value
;
/* Handle recording of state blocks */
...
...
@@ -4746,10 +4748,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW
return
WINED3DERR_INVALIDCALL
;
}
for
(
i
=
1
;
i
<=
WINEHIGHEST_RENDER_STATE
;
i
++
)
{
if
(
object
->
changed
.
renderState
[
i
])
{
object
->
contained_render_states
[
object
->
num_contained_render_states
]
=
i
;
object
->
num_contained_render_states
++
;
for
(
i
=
0
;
i
<=
WINEHIGHEST_RENDER_STATE
>>
5
;
++
i
)
{
DWORD
map
=
object
->
changed
.
renderState
[
i
];
for
(
j
=
0
;
map
;
map
>>=
1
,
++
j
)
{
if
(
!
(
map
&
1
))
continue
;
object
->
contained_render_states
[
object
->
num_contained_render_states
++
]
=
(
i
<<
5
)
|
j
;
}
}
...
...
dlls/wined3d/stateblock.c
View file @
c33b3811
...
...
@@ -90,7 +90,7 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
dest
->
streamFreq
=
source
->
streamFreq
;
dest
->
textures
=
source
->
textures
;
memcpy
(
dest
->
transform
,
source
->
transform
,
sizeof
(
source
->
transform
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
bsize
*
(
WINEHIGHEST_RENDER_STATE
+
1
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
sizeof
(
source
->
renderState
));
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
));
dest
->
clipplane
=
source
->
clipplane
;
...
...
@@ -130,19 +130,34 @@ void stateblock_savedstates_set(
states
->
scissorRect
=
value
;
/* Fixed size arrays */
states
->
streamSource
=
value
?
0xffff
:
0
;
states
->
streamFreq
=
value
?
0xffff
:
0
;
states
->
textures
=
value
?
0xfffff
:
0
;
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
));
if
(
value
)
{
states
->
streamSource
=
0xffff
;
states
->
streamFreq
=
0xffff
;
states
->
textures
=
0xfffff
;
stateblock_set_bits
(
states
->
transform
,
HIGHEST_TRANSFORMSTATE
+
1
);
stateblock_set_bits
(
states
->
renderState
,
WINEHIGHEST_RENDER_STATE
+
1
);
states
->
clipplane
=
0xffffffff
;
states
->
pixelShaderConstantsB
=
0xffff
;
states
->
pixelShaderConstantsI
=
0xffff
;
states
->
vertexShaderConstantsB
=
0xffff
;
states
->
vertexShaderConstantsI
=
0xffff
;
}
else
{
states
->
streamSource
=
0
;
states
->
streamFreq
=
0
;
states
->
textures
=
0
;
memset
(
states
->
transform
,
0
,
sizeof
(
states
->
transform
));
memset
(
states
->
renderState
,
0
,
sizeof
(
states
->
renderState
));
states
->
clipplane
=
0
;
states
->
pixelShaderConstantsB
=
0
;
states
->
pixelShaderConstantsI
=
0
;
states
->
vertexShaderConstantsB
=
0
;
states
->
vertexShaderConstantsI
=
0
;
}
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
));
states
->
clipplane
=
value
?
0xffffffff
:
0
;
states
->
pixelShaderConstantsB
=
value
?
0xffff
:
0
;
states
->
pixelShaderConstantsI
=
value
?
0xffff
:
0
;
states
->
vertexShaderConstantsB
=
value
?
0xffff
:
0
;
states
->
vertexShaderConstantsI
=
value
?
0xffff
:
0
;
/* Dynamically sized arrays */
memset
(
states
->
pixelShaderConstantsF
,
value
,
bsize
*
GL_LIMITS
(
pshader_constantsF
));
...
...
dlls/wined3d/wined3d_private.h
View file @
c33b3811
...
...
@@ -1762,7 +1762,7 @@ typedef struct SAVEDSTATES {
WORD
streamSource
;
/* MAX_STREAMS, 16 */
WORD
streamFreq
;
/* MAX_STREAMS, 16 */
DWORD
textures
;
/* MAX_COMBINED_SAMPLERS, 20 */
BOOL
renderState
[
WINEHIGHEST_RENDER_STATE
+
1
];
DWORD
renderState
[(
WINEHIGHEST_RENDER_STATE
>>
5
)
+
1
];
BOOL
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
BOOL
samplerState
[
MAX_COMBINED_SAMPLERS
][
WINED3D_HIGHEST_SAMPLER_STATE
+
1
];
DWORD
clipplane
;
/* WINED3DMAXUSERCLIPPLANES, 32 */
...
...
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