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
c5029f83
Commit
c5029f83
authored
Oct 01, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify stateblock_savedstates_set().
We only need to handle the case where "value" is TRUE, since the stateblock data will be filled with zeroes by default.
parent
75fe879c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
45 deletions
+27
-45
stateblock.c
dlls/wined3d/stateblock.c
+27
-45
No files found.
dlls/wined3d/stateblock.c
View file @
c5029f83
...
...
@@ -79,54 +79,37 @@ static inline void stateblock_set_bits(DWORD *map, UINT map_size)
}
/* Set all members of a stateblock savedstate to the given value */
static
void
stateblock_savedstates_set
(
SAVEDSTATES
*
states
,
BOOL
value
,
const
struct
wined3d_gl_info
*
gl_info
)
static
void
stateblock_savedstates_set
(
SAVEDSTATES
*
states
,
const
struct
wined3d_gl_info
*
gl_info
)
{
unsigned
int
i
;
/* Single values */
states
->
primitive_type
=
value
;
states
->
indices
=
value
;
states
->
material
=
value
;
states
->
viewport
=
value
;
states
->
vertexDecl
=
value
;
states
->
pixelShader
=
value
;
states
->
vertexShader
=
value
;
states
->
scissorRect
=
value
;
states
->
primitive_type
=
1
;
states
->
indices
=
1
;
states
->
material
=
1
;
states
->
viewport
=
1
;
states
->
vertexDecl
=
1
;
states
->
pixelShader
=
1
;
states
->
vertexShader
=
1
;
states
->
scissorRect
=
1
;
/* Fixed size arrays */
if
(
value
)
{
int
i
;
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
);
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
states
->
textureState
[
i
]
=
0x3ffff
;
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
states
->
samplerState
[
i
]
=
0x3fff
;
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
));
memset
(
states
->
textureState
,
0
,
sizeof
(
states
->
textureState
));
memset
(
states
->
samplerState
,
0
,
sizeof
(
states
->
samplerState
));
states
->
clipplane
=
0
;
states
->
pixelShaderConstantsB
=
0
;
states
->
pixelShaderConstantsI
=
0
;
states
->
vertexShaderConstantsB
=
0
;
states
->
vertexShaderConstantsI
=
0
;
}
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
);
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
states
->
textureState
[
i
]
=
0x3ffff
;
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
states
->
samplerState
[
i
]
=
0x3fff
;
states
->
clipplane
=
0xffffffff
;
states
->
pixelShaderConstantsB
=
0xffff
;
states
->
pixelShaderConstantsI
=
0xffff
;
states
->
vertexShaderConstantsB
=
0xffff
;
states
->
vertexShaderConstantsI
=
0xffff
;
/* Dynamically sized arrays */
memset
(
states
->
pixelShaderConstantsF
,
value
,
sizeof
(
BOOL
)
*
gl_info
->
max_pshader_constantsF
);
memset
(
states
->
vertexShaderConstantsF
,
value
,
sizeof
(
BOOL
)
*
gl_info
->
max_vshader_constantsF
);
memset
(
states
->
pixelShaderConstantsF
,
TRUE
,
sizeof
(
BOOL
)
*
gl_info
->
max_pshader_constantsF
);
memset
(
states
->
vertexShaderConstantsF
,
TRUE
,
sizeof
(
BOOL
)
*
gl_info
->
max_vshader_constantsF
);
}
static
void
stateblock_copy_values
(
IWineD3DStateBlockImpl
*
dst
,
const
IWineD3DStateBlockImpl
*
src
,
...
...
@@ -1462,7 +1445,8 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
if
(
type
==
WINED3DSBT_ALL
)
{
TRACE
(
"ALL => Pretend everything has changed.
\n
"
);
stateblock_savedstates_set
(
&
stateblock
->
changed
,
TRUE
,
gl_info
);
stateblock_savedstates_set
(
&
stateblock
->
changed
,
gl_info
);
/* Lights are not part of the changed / set structure. */
for
(
i
=
0
;
i
<
LIGHTMAP_SIZE
;
++
i
)
...
...
@@ -1557,7 +1541,6 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
else
if
(
type
==
WINED3DSBT_PIXELSTATE
)
{
TRACE
(
"PIXELSTATE => Pretend all pixel states have changed.
\n
"
);
stateblock_savedstates_set
(
&
stateblock
->
changed
,
FALSE
,
gl_info
);
/* Pixel Shader Constants. */
for
(
i
=
0
;
i
<
gl_info
->
max_pshader_constantsF
;
++
i
)
...
...
@@ -1629,7 +1612,6 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
else
if
(
type
==
WINED3DSBT_VERTEXSTATE
)
{
TRACE
(
"VERTEXSTATE => Pretend all vertex shates have changed.
\n
"
);
stateblock_savedstates_set
(
&
stateblock
->
changed
,
FALSE
,
gl_info
);
/* Vertex Shader Constants. */
for
(
i
=
0
;
i
<
gl_info
->
max_vshader_constantsF
;
++
i
)
...
...
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