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
fd33f0f9
Commit
fd33f0f9
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 samplerState to a bitmap in struct SAVEDSTATES.
parent
c33b3811
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
device.c
dlls/wined3d/device.c
+14
-9
stateblock.c
dlls/wined3d/stateblock.c
+5
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
fd33f0f9
...
@@ -485,9 +485,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
...
@@ -485,9 +485,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
}
}
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
)
{
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
)
{
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_S
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_SAVEDPIXELSTATES_S
;
i
++
)
{
object
->
changed
.
samplerState
[
j
][
SavedPixelStates_S
[
i
]]
=
TRUE
;
DWORD
state
=
SavedPixelStates_S
[
i
];
object
->
changed
.
samplerState
[
j
]
|=
1
<<
state
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
j
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
j
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
SavedPixelStates_S
[
i
]
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
state
;
object
->
num_contained_sampler_states
++
;
object
->
num_contained_sampler_states
++
;
}
}
}
}
...
@@ -543,9 +544,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
...
@@ -543,9 +544,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
}
}
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
){
for
(
j
=
0
;
j
<
MAX_COMBINED_SAMPLERS
;
j
++
){
for
(
i
=
0
;
i
<
NUM_SAVEDVERTEXSTATES_S
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_SAVEDVERTEXSTATES_S
;
i
++
)
{
object
->
changed
.
samplerState
[
j
][
SavedVertexStates_S
[
i
]]
=
TRUE
;
DWORD
state
=
SavedVertexStates_S
[
i
];
object
->
changed
.
samplerState
[
j
]
|=
1
<<
state
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
j
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
j
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
SavedVertexStates_S
[
i
]
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
state
;
object
->
num_contained_sampler_states
++
;
object
->
num_contained_sampler_states
++
;
}
}
}
}
...
@@ -3327,7 +3329,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
...
@@ -3327,7 +3329,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
oldValue
=
This
->
stateBlock
->
samplerState
[
Sampler
][
Type
];
oldValue
=
This
->
stateBlock
->
samplerState
[
Sampler
][
Type
];
This
->
updateStateBlock
->
samplerState
[
Sampler
][
Type
]
=
Value
;
This
->
updateStateBlock
->
samplerState
[
Sampler
][
Type
]
=
Value
;
This
->
updateStateBlock
->
changed
.
samplerState
[
Sampler
]
[
Type
]
=
Valu
e
;
This
->
updateStateBlock
->
changed
.
samplerState
[
Sampler
]
|=
1
<<
Typ
e
;
/* Handle recording of state blocks */
/* Handle recording of state blocks */
if
(
This
->
isRecordingState
)
{
if
(
This
->
isRecordingState
)
{
...
@@ -4821,12 +4823,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW
...
@@ -4821,12 +4823,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW
}
}
}
}
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
i
++
){
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
i
++
){
for
(
j
=
1
;
j
<
WINED3D_HIGHEST_SAMPLER_STATE
;
j
++
)
{
DWORD
map
=
object
->
changed
.
samplerState
[
i
];
if
(
object
->
changed
.
samplerState
[
i
][
j
])
{
for
(
j
=
0
;
map
;
map
>>=
1
,
++
j
)
{
if
(
!
(
map
&
1
))
continue
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
i
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
stage
=
i
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
j
;
object
->
contained_sampler_states
[
object
->
num_contained_sampler_states
].
state
=
j
;
object
->
num_contained_sampler_states
++
;
++
object
->
num_contained_sampler_states
;
}
}
}
}
}
...
...
dlls/wined3d/stateblock.c
View file @
fd33f0f9
...
@@ -92,7 +92,7 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
...
@@ -92,7 +92,7 @@ static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *
memcpy
(
dest
->
transform
,
source
->
transform
,
sizeof
(
source
->
transform
));
memcpy
(
dest
->
transform
,
source
->
transform
,
sizeof
(
source
->
transform
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
sizeof
(
source
->
renderState
));
memcpy
(
dest
->
renderState
,
source
->
renderState
,
sizeof
(
source
->
renderState
));
memcpy
(
dest
->
textureState
,
source
->
textureState
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_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
));
memcpy
(
dest
->
samplerState
,
source
->
samplerState
,
sizeof
(
source
->
samplerState
));
dest
->
clipplane
=
source
->
clipplane
;
dest
->
clipplane
=
source
->
clipplane
;
dest
->
pixelShaderConstantsB
=
source
->
pixelShaderConstantsB
;
dest
->
pixelShaderConstantsB
=
source
->
pixelShaderConstantsB
;
dest
->
pixelShaderConstantsI
=
source
->
pixelShaderConstantsI
;
dest
->
pixelShaderConstantsI
=
source
->
pixelShaderConstantsI
;
...
@@ -132,11 +132,13 @@ void stateblock_savedstates_set(
...
@@ -132,11 +132,13 @@ void stateblock_savedstates_set(
/* Fixed size arrays */
/* Fixed size arrays */
if
(
value
)
if
(
value
)
{
{
int
i
;
states
->
streamSource
=
0xffff
;
states
->
streamSource
=
0xffff
;
states
->
streamFreq
=
0xffff
;
states
->
streamFreq
=
0xffff
;
states
->
textures
=
0xfffff
;
states
->
textures
=
0xfffff
;
stateblock_set_bits
(
states
->
transform
,
HIGHEST_TRANSFORMSTATE
+
1
);
stateblock_set_bits
(
states
->
transform
,
HIGHEST_TRANSFORMSTATE
+
1
);
stateblock_set_bits
(
states
->
renderState
,
WINEHIGHEST_RENDER_STATE
+
1
);
stateblock_set_bits
(
states
->
renderState
,
WINEHIGHEST_RENDER_STATE
+
1
);
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
states
->
samplerState
[
i
]
=
0x3fff
;
states
->
clipplane
=
0xffffffff
;
states
->
clipplane
=
0xffffffff
;
states
->
pixelShaderConstantsB
=
0xffff
;
states
->
pixelShaderConstantsB
=
0xffff
;
states
->
pixelShaderConstantsI
=
0xffff
;
states
->
pixelShaderConstantsI
=
0xffff
;
...
@@ -150,6 +152,7 @@ void stateblock_savedstates_set(
...
@@ -150,6 +152,7 @@ void stateblock_savedstates_set(
states
->
textures
=
0
;
states
->
textures
=
0
;
memset
(
states
->
transform
,
0
,
sizeof
(
states
->
transform
));
memset
(
states
->
transform
,
0
,
sizeof
(
states
->
transform
));
memset
(
states
->
renderState
,
0
,
sizeof
(
states
->
renderState
));
memset
(
states
->
renderState
,
0
,
sizeof
(
states
->
renderState
));
memset
(
states
->
samplerState
,
0
,
sizeof
(
states
->
samplerState
));
states
->
clipplane
=
0
;
states
->
clipplane
=
0
;
states
->
pixelShaderConstantsB
=
0
;
states
->
pixelShaderConstantsB
=
0
;
states
->
pixelShaderConstantsI
=
0
;
states
->
pixelShaderConstantsI
=
0
;
...
@@ -157,7 +160,6 @@ void stateblock_savedstates_set(
...
@@ -157,7 +160,6 @@ void stateblock_savedstates_set(
states
->
vertexShaderConstantsI
=
0
;
states
->
vertexShaderConstantsI
=
0
;
}
}
memset
(
states
->
textureState
,
value
,
bsize
*
MAX_TEXTURES
*
(
WINED3D_HIGHEST_TEXTURE_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
));
/* Dynamically sized arrays */
/* Dynamically sized arrays */
memset
(
states
->
pixelShaderConstantsF
,
value
,
bsize
*
GL_LIMITS
(
pshader_constantsF
));
memset
(
states
->
pixelShaderConstantsF
,
value
,
bsize
*
GL_LIMITS
(
pshader_constantsF
));
...
@@ -815,7 +817,7 @@ should really perform a delta so that only the changes get updated*/
...
@@ -815,7 +817,7 @@ should really perform a delta so that only the changes get updated*/
DWORD
stage
=
This
->
contained_sampler_states
[
i
].
stage
;
DWORD
stage
=
This
->
contained_sampler_states
[
i
].
stage
;
DWORD
state
=
This
->
contained_sampler_states
[
i
].
state
;
DWORD
state
=
This
->
contained_sampler_states
[
i
].
state
;
((
IWineD3DDeviceImpl
*
)
pDevice
)
->
stateBlock
->
samplerState
[
stage
][
state
]
=
This
->
samplerState
[
stage
][
state
];
((
IWineD3DDeviceImpl
*
)
pDevice
)
->
stateBlock
->
samplerState
[
stage
][
state
]
=
This
->
samplerState
[
stage
][
state
];
((
IWineD3DDeviceImpl
*
)
pDevice
)
->
stateBlock
->
changed
.
samplerState
[
stage
]
[
state
]
=
TRUE
;
((
IWineD3DDeviceImpl
*
)
pDevice
)
->
stateBlock
->
changed
.
samplerState
[
stage
]
|=
1
<<
state
;
IWineD3DDeviceImpl_MarkStateDirty
((
IWineD3DDeviceImpl
*
)
pDevice
,
STATE_SAMPLER
(
stage
));
IWineD3DDeviceImpl_MarkStateDirty
((
IWineD3DDeviceImpl
*
)
pDevice
,
STATE_SAMPLER
(
stage
));
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
fd33f0f9
...
@@ -1764,7 +1764,7 @@ typedef struct SAVEDSTATES {
...
@@ -1764,7 +1764,7 @@ typedef struct SAVEDSTATES {
DWORD
textures
;
/* MAX_COMBINED_SAMPLERS, 20 */
DWORD
textures
;
/* MAX_COMBINED_SAMPLERS, 20 */
DWORD
renderState
[(
WINEHIGHEST_RENDER_STATE
>>
5
)
+
1
];
DWORD
renderState
[(
WINEHIGHEST_RENDER_STATE
>>
5
)
+
1
];
BOOL
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
BOOL
textureState
[
MAX_TEXTURES
][
WINED3D_HIGHEST_TEXTURE_STATE
+
1
];
BOOL
samplerState
[
MAX_COMBINED_SAMPLERS
][
WINED3D_HIGHEST_SAMPLER_STATE
+
1
];
WORD
samplerState
[
MAX_COMBINED_SAMPLERS
];
/* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14*/
DWORD
clipplane
;
/* WINED3DMAXUSERCLIPPLANES, 32 */
DWORD
clipplane
;
/* WINED3DMAXUSERCLIPPLANES, 32 */
WORD
pixelShaderConstantsB
;
/* MAX_CONST_B, 16 */
WORD
pixelShaderConstantsB
;
/* MAX_CONST_B, 16 */
WORD
pixelShaderConstantsI
;
/* MAX_CONST_I, 16 */
WORD
pixelShaderConstantsI
;
/* MAX_CONST_I, 16 */
...
...
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