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
5a01619d
Commit
5a01619d
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: Add a separate function to initialize the saved states for WINED3DSBT_PIXELSTATE.
parent
841afe48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
15 deletions
+31
-15
stateblock.c
dlls/wined3d/stateblock.c
+31
-15
No files found.
dlls/wined3d/stateblock.c
View file @
5a01619d
...
...
@@ -79,7 +79,7 @@ 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
,
const
struct
wined3d_gl_info
*
gl_info
)
static
void
stateblock_savedstates_set
_all
(
SAVEDSTATES
*
states
,
const
struct
wined3d_gl_info
*
gl_info
)
{
unsigned
int
i
;
...
...
@@ -112,6 +112,30 @@ static void stateblock_savedstates_set(SAVEDSTATES *states, const struct wined3d
memset
(
states
->
vertexShaderConstantsF
,
TRUE
,
sizeof
(
BOOL
)
*
gl_info
->
max_vshader_constantsF
);
}
static
void
stateblock_savedstates_set_pixel
(
SAVEDSTATES
*
states
,
const
struct
wined3d_gl_info
*
gl_info
)
{
DWORD
texture_mask
=
0
;
WORD
sampler_mask
=
0
;
unsigned
int
i
;
states
->
pixelShader
=
1
;
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_R
;
++
i
)
{
DWORD
rs
=
SavedPixelStates_R
[
i
];
states
->
renderState
[
rs
>>
5
]
|=
1
<<
(
rs
&
0x1f
);
}
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_T
;
++
i
)
texture_mask
|=
1
<<
SavedPixelStates_T
[
i
];
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
states
->
textureState
[
i
]
=
texture_mask
;
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_S
;
++
i
)
sampler_mask
|=
1
<<
SavedPixelStates_S
[
i
];
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
states
->
samplerState
[
i
]
=
sampler_mask
;
states
->
pixelShaderConstantsB
=
0xffff
;
states
->
pixelShaderConstantsI
=
0xffff
;
memset
(
states
->
pixelShaderConstantsF
,
TRUE
,
sizeof
(
BOOL
)
*
gl_info
->
max_pshader_constantsF
);
}
static
void
stateblock_copy_values
(
IWineD3DStateBlockImpl
*
dst
,
const
IWineD3DStateBlockImpl
*
src
,
const
struct
wined3d_gl_info
*
gl_info
)
{
...
...
@@ -1446,7 +1470,7 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
{
TRACE
(
"ALL => Pretend everything has changed.
\n
"
);
stateblock_savedstates_set
(
&
stateblock
->
changed
,
gl_info
);
stateblock_savedstates_set
_all
(
&
stateblock
->
changed
,
gl_info
);
stateblock_init_contained_states
(
stateblock
);
/* Lights are not part of the changed / set structure. */
...
...
@@ -1474,33 +1498,30 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
{
TRACE
(
"PIXELSTATE => Pretend all pixel states have changed.
\n
"
);
stateblock_savedstates_set_pixel
(
&
stateblock
->
changed
,
gl_info
);
/* Pixel Shader Constants. */
for
(
i
=
0
;
i
<
gl_info
->
max_pshader_constantsF
;
++
i
)
{
stateblock
->
contained_ps_consts_f
[
i
]
=
i
;
stateblock
->
changed
.
pixelShaderConstantsF
[
i
]
=
TRUE
;
}
stateblock
->
num_contained_ps_consts_f
=
gl_info
->
max_pshader_constantsF
;
for
(
i
=
0
;
i
<
MAX_CONST_B
;
++
i
)
{
stateblock
->
contained_ps_consts_b
[
i
]
=
i
;
stateblock
->
changed
.
pixelShaderConstantsB
|=
(
1
<<
i
);
}
stateblock
->
num_contained_ps_consts_b
=
MAX_CONST_B
;
for
(
i
=
0
;
i
<
MAX_CONST_I
;
++
i
)
{
stateblock
->
contained_ps_consts_i
[
i
]
=
i
;
stateblock
->
changed
.
pixelShaderConstantsI
|=
(
1
<<
i
);
}
stateblock
->
num_contained_ps_consts_i
=
MAX_CONST_I
;
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_R
;
i
++
)
{
DWORD
rs
=
SavedPixelStates_R
[
i
];
stateblock
->
changed
.
renderState
[
rs
>>
5
]
|=
1
<<
(
rs
&
0x1f
);
stateblock
->
contained_render_states
[
i
]
=
rs
;
stateblock
->
contained_render_states
[
i
]
=
SavedPixelStates_R
[
i
];
}
stateblock
->
num_contained_render_states
=
NUM_SAVEDPIXELSTATES_R
;
...
...
@@ -1508,10 +1529,8 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
{
for
(
j
=
0
;
j
<
NUM_SAVEDPIXELSTATES_T
;
++
j
)
{
DWORD
state
=
SavedPixelStates_T
[
j
];
stateblock
->
changed
.
textureState
[
i
]
|=
1
<<
state
;
stateblock
->
contained_tss_states
[
stateblock
->
num_contained_tss_states
].
stage
=
i
;
stateblock
->
contained_tss_states
[
stateblock
->
num_contained_tss_states
].
state
=
state
;
stateblock
->
contained_tss_states
[
stateblock
->
num_contained_tss_states
].
state
=
SavedPixelStates_T
[
j
]
;
++
stateblock
->
num_contained_tss_states
;
}
}
...
...
@@ -1520,15 +1539,12 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
{
for
(
j
=
0
;
j
<
NUM_SAVEDPIXELSTATES_S
;
++
j
)
{
DWORD
state
=
SavedPixelStates_S
[
j
];
stateblock
->
changed
.
samplerState
[
i
]
|=
1
<<
state
;
stateblock
->
contained_sampler_states
[
stateblock
->
num_contained_sampler_states
].
stage
=
i
;
stateblock
->
contained_sampler_states
[
stateblock
->
num_contained_sampler_states
].
state
=
state
;
stateblock
->
contained_sampler_states
[
stateblock
->
num_contained_sampler_states
].
state
=
SavedPixelStates_S
[
j
]
;
stateblock
->
num_contained_sampler_states
++
;
}
}
stateblock
->
changed
.
pixelShader
=
TRUE
;
if
(
stateblock
->
pixelShader
)
IWineD3DPixelShader_AddRef
(
stateblock
->
pixelShader
);
/* Pixel state blocks do not contain vertex buffers. Set them to NULL
...
...
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