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
6d3e5a9c
Commit
6d3e5a9c
authored
Sep 29, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass IWineD3DStateBlockImpl pointers to stateblock_copy().
parent
4ed126f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
52 deletions
+49
-52
stateblock.c
dlls/wined3d/stateblock.c
+49
-52
No files found.
dlls/wined3d/stateblock.c
View file @
6d3e5a9c
...
...
@@ -167,80 +167,77 @@ static void stateblock_savedstates_set(IWineD3DStateBlock *iface, SAVEDSTATES *s
memset
(
states
->
vertexShaderConstantsF
,
value
,
bsize
*
GL_LIMITS
(
vshader_constantsF
));
}
static
void
stateblock_copy
(
IWineD3DStateBlock
*
destination
,
IWineD3DStateBlock
*
source
)
static
void
stateblock_copy
(
IWineD3DStateBlock
Impl
*
dst
,
IWineD3DStateBlockImpl
*
src
)
{
int
l
;
const
struct
wined3d_gl_info
*
gl_info
=
&
src
->
wineD3DDevice
->
adapter
->
gl_info
;
unsigned
int
l
;
IWineD3DStateBlockImpl
*
This
=
(
IWineD3DStateBlockImpl
*
)
source
;
IWineD3DStateBlockImpl
*
Dest
=
(
IWineD3DStateBlockImpl
*
)
destination
;
/* IUnknown fields */
Dest
->
lpVtbl
=
This
->
lpVtbl
;
Dest
->
ref
=
This
->
ref
;
/* IWineD3DStateBlock information */
Dest
->
parent
=
This
->
parent
;
Dest
->
wineD3DDevice
=
This
->
wineD3DDevice
;
Dest
->
blockType
=
This
->
blockType
;
dst
->
lpVtbl
=
src
->
lpVtbl
;
dst
->
ref
=
src
->
ref
;
dst
->
parent
=
src
->
parent
;
dst
->
wineD3DDevice
=
src
->
wineD3DDevice
;
dst
->
blockType
=
src
->
blockType
;
/* Saved states */
stateblock_savedstates_copy
(
source
,
&
Dest
->
changed
,
&
This
->
changed
);
stateblock_savedstates_copy
(
(
IWineD3DStateBlock
*
)
src
,
&
dst
->
changed
,
&
src
->
changed
);
/* Single items */
Dest
->
gl_primitive_type
=
This
->
gl_primitive_type
;
Dest
->
vertexDecl
=
This
->
vertexDecl
;
Dest
->
vertexShader
=
This
->
vertexShader
;
Dest
->
streamIsUP
=
This
->
streamIsUP
;
Dest
->
pIndexData
=
This
->
pIndexData
;
Dest
->
IndexFmt
=
This
->
IndexFmt
;
Dest
->
baseVertexIndex
=
This
->
baseVertexIndex
;
/* Dest->lights = This->lights; */
Dest
->
clip_status
=
This
->
clip_status
;
Dest
->
viewport
=
This
->
viewport
;
Dest
->
material
=
This
->
material
;
Dest
->
pixelShader
=
This
->
pixelShader
;
Dest
->
scissorRect
=
This
->
scissorRect
;
dst
->
gl_primitive_type
=
src
->
gl_primitive_type
;
dst
->
vertexDecl
=
src
->
vertexDecl
;
dst
->
vertexShader
=
src
->
vertexShader
;
dst
->
streamIsUP
=
src
->
streamIsUP
;
dst
->
pIndexData
=
src
->
pIndexData
;
dst
->
IndexFmt
=
src
->
IndexFmt
;
dst
->
baseVertexIndex
=
src
->
baseVertexIndex
;
dst
->
clip_status
=
src
->
clip_status
;
dst
->
viewport
=
src
->
viewport
;
dst
->
material
=
src
->
material
;
dst
->
pixelShader
=
src
->
pixelShader
;
dst
->
scissorRect
=
src
->
scissorRect
;
/* Lights */
memset
(
Dest
->
activeLights
,
0
,
sizeof
(
Dest
->
activeLights
));
for
(
l
=
0
;
l
<
LIGHTMAP_SIZE
;
l
++
)
{
memset
(
dst
->
activeLights
,
0
,
sizeof
(
dst
->
activeLights
));
for
(
l
=
0
;
l
<
LIGHTMAP_SIZE
;
++
l
)
{
struct
list
*
e1
,
*
e2
;
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
Dest
->
lightMap
[
l
])
{
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
dst
->
lightMap
[
l
])
{
PLIGHTINFOEL
*
light
=
LIST_ENTRY
(
e1
,
PLIGHTINFOEL
,
entry
);
list_remove
(
&
light
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
light
);
}
LIST_FOR_EACH
(
e1
,
&
This
->
lightMap
[
l
])
{
LIST_FOR_EACH
(
e1
,
&
src
->
lightMap
[
l
])
{
PLIGHTINFOEL
*
light
=
LIST_ENTRY
(
e1
,
PLIGHTINFOEL
,
entry
),
*
light2
;
light2
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
light
));
*
light2
=
*
light
;
list_add_tail
(
&
De
st
->
lightMap
[
l
],
&
light2
->
entry
);
if
(
light2
->
glIndex
!=
-
1
)
De
st
->
activeLights
[
light2
->
glIndex
]
=
light2
;
list_add_tail
(
&
d
st
->
lightMap
[
l
],
&
light2
->
entry
);
if
(
light2
->
glIndex
!=
-
1
)
d
st
->
activeLights
[
light2
->
glIndex
]
=
light2
;
}
}
/* Fixed size arrays */
memcpy
(
Dest
->
vertexShaderConstantB
,
This
->
vertexShaderConstantB
,
sizeof
(
De
st
->
vertexShaderConstantB
));
memcpy
(
Dest
->
vertexShaderConstantI
,
This
->
vertexShaderConstantI
,
sizeof
(
De
st
->
vertexShaderConstantI
));
memcpy
(
Dest
->
pixelShaderConstantB
,
This
->
pixelShaderConstantB
,
sizeof
(
De
st
->
pixelShaderConstantB
));
memcpy
(
Dest
->
pixelShaderConstantI
,
This
->
pixelShaderConstantI
,
sizeof
(
De
st
->
pixelShaderConstantI
));
memcpy
(
Dest
->
streamStride
,
This
->
streamStride
,
sizeof
(
De
st
->
streamStride
));
memcpy
(
Dest
->
streamOffset
,
This
->
streamOffset
,
sizeof
(
De
st
->
streamOffset
));
memcpy
(
Dest
->
streamSource
,
This
->
streamSource
,
sizeof
(
De
st
->
streamSource
));
memcpy
(
Dest
->
streamFreq
,
This
->
streamFreq
,
sizeof
(
De
st
->
streamFreq
));
memcpy
(
Dest
->
streamFlags
,
This
->
streamFlags
,
sizeof
(
De
st
->
streamFlags
));
memcpy
(
Dest
->
transforms
,
This
->
transforms
,
sizeof
(
De
st
->
transforms
));
memcpy
(
Dest
->
clipplane
,
This
->
clipplane
,
sizeof
(
De
st
->
clipplane
));
memcpy
(
Dest
->
renderState
,
This
->
renderState
,
sizeof
(
De
st
->
renderState
));
memcpy
(
Dest
->
textures
,
This
->
textures
,
sizeof
(
De
st
->
textures
));
memcpy
(
Dest
->
textureState
,
This
->
textureState
,
sizeof
(
De
st
->
textureState
));
memcpy
(
Dest
->
samplerState
,
This
->
samplerState
,
sizeof
(
De
st
->
samplerState
));
memcpy
(
dst
->
vertexShaderConstantB
,
src
->
vertexShaderConstantB
,
sizeof
(
d
st
->
vertexShaderConstantB
));
memcpy
(
dst
->
vertexShaderConstantI
,
src
->
vertexShaderConstantI
,
sizeof
(
d
st
->
vertexShaderConstantI
));
memcpy
(
dst
->
pixelShaderConstantB
,
src
->
pixelShaderConstantB
,
sizeof
(
d
st
->
pixelShaderConstantB
));
memcpy
(
dst
->
pixelShaderConstantI
,
src
->
pixelShaderConstantI
,
sizeof
(
d
st
->
pixelShaderConstantI
));
memcpy
(
dst
->
streamStride
,
src
->
streamStride
,
sizeof
(
d
st
->
streamStride
));
memcpy
(
dst
->
streamOffset
,
src
->
streamOffset
,
sizeof
(
d
st
->
streamOffset
));
memcpy
(
dst
->
streamSource
,
src
->
streamSource
,
sizeof
(
d
st
->
streamSource
));
memcpy
(
dst
->
streamFreq
,
src
->
streamFreq
,
sizeof
(
d
st
->
streamFreq
));
memcpy
(
dst
->
streamFlags
,
src
->
streamFlags
,
sizeof
(
d
st
->
streamFlags
));
memcpy
(
dst
->
transforms
,
src
->
transforms
,
sizeof
(
d
st
->
transforms
));
memcpy
(
dst
->
clipplane
,
src
->
clipplane
,
sizeof
(
d
st
->
clipplane
));
memcpy
(
dst
->
renderState
,
src
->
renderState
,
sizeof
(
d
st
->
renderState
));
memcpy
(
dst
->
textures
,
src
->
textures
,
sizeof
(
d
st
->
textures
));
memcpy
(
dst
->
textureState
,
src
->
textureState
,
sizeof
(
d
st
->
textureState
));
memcpy
(
dst
->
samplerState
,
src
->
samplerState
,
sizeof
(
d
st
->
samplerState
));
/* Dynamically sized arrays */
memcpy
(
Dest
->
vertexShaderConstantF
,
This
->
vertexShaderConstantF
,
sizeof
(
float
)
*
GL_LIMITS
(
vshader_constantsF
)
*
4
);
memcpy
(
Dest
->
pixelShaderConstantF
,
This
->
pixelShaderConstantF
,
sizeof
(
float
)
*
GL_LIMITS
(
pshader_constantsF
)
*
4
);
memcpy
(
dst
->
vertexShaderConstantF
,
src
->
vertexShaderConstantF
,
sizeof
(
float
)
*
gl_info
->
max_vshader_constantsF
*
4
);
memcpy
(
dst
->
pixelShaderConstantF
,
src
->
pixelShaderConstantF
,
sizeof
(
float
)
*
gl_info
->
max_pshader_constantsF
*
4
);
}
/**********************************************************
...
...
@@ -1383,7 +1380,7 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
if
(
type
==
WINED3DSBT_INIT
||
type
==
WINED3DSBT_RECORDED
)
return
WINED3D_OK
;
/* Otherwise, might as well set the whole state block to the appropriate values */
if
(
device
->
stateBlock
)
stateblock_copy
(
(
IWineD3DStateBlock
*
)
stateblock
,
(
IWineD3DStateBlock
*
)
device
->
stateBlock
);
if
(
device
->
stateBlock
)
stateblock_copy
(
stateblock
,
device
->
stateBlock
);
else
memset
(
stateblock
->
streamFreq
,
1
,
sizeof
(
stateblock
->
streamFreq
));
/* Reset the ref and type after kludging it. */
...
...
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