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
dca3c6e7
Commit
dca3c6e7
authored
Sep 28, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Keep vertex declaration references in the stateblock.
parent
709aedf5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
device.c
dlls/wined3d/device.c
+3
-0
stateblock.c
dlls/wined3d/stateblock.c
+11
-1
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+2
-1
No files found.
dlls/wined3d/device.c
View file @
dca3c6e7
...
...
@@ -3328,6 +3328,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* if
TRACE
(
"(%p) : pDecl=%p
\n
"
,
This
,
pDecl
);
if
(
pDecl
)
IWineD3DVertexDeclaration_AddRef
(
pDecl
);
if
(
oldDecl
)
IWineD3DVertexDeclaration_Release
(
oldDecl
);
This
->
updateStateBlock
->
vertexDecl
=
pDecl
;
This
->
updateStateBlock
->
changed
.
vertexDecl
=
TRUE
;
...
...
dlls/wined3d/stateblock.c
View file @
dca3c6e7
...
...
@@ -279,6 +279,8 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
if
(
!
refCount
)
{
int
counter
;
if
(
This
->
vertexDecl
)
IWineD3DVertexDeclaration_Release
(
This
->
vertexDecl
);
for
(
counter
=
0
;
counter
<
MAX_COMBINED_SAMPLERS
;
counter
++
)
{
if
(
This
->
textures
[
counter
])
IWineD3DBaseTexture_Release
(
This
->
textures
[
counter
]);
...
...
@@ -511,6 +513,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
if
(
This
->
changed
.
vertexDecl
&&
This
->
vertexDecl
!=
targetStateBlock
->
vertexDecl
){
TRACE
(
"Updating vertex declaration from %p to %p
\n
"
,
This
->
vertexDecl
,
targetStateBlock
->
vertexDecl
);
if
(
targetStateBlock
->
vertexDecl
)
IWineD3DVertexDeclaration_AddRef
(
targetStateBlock
->
vertexDecl
);
if
(
This
->
vertexDecl
)
IWineD3DVertexDeclaration_Release
(
This
->
vertexDecl
);
This
->
vertexDecl
=
targetStateBlock
->
vertexDecl
;
}
...
...
@@ -624,7 +628,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
record_lights
(
This
,
targetStateBlock
);
}
else
if
(
This
->
blockType
==
WINED3DSBT_ALL
)
{
This
->
vertexDecl
=
targetStateBlock
->
vertexDecl
;
memcpy
(
This
->
vertexShaderConstantB
,
targetStateBlock
->
vertexShaderConstantB
,
sizeof
(
This
->
vertexShaderConstantI
));
memcpy
(
This
->
vertexShaderConstantI
,
targetStateBlock
->
vertexShaderConstantI
,
sizeof
(
This
->
vertexShaderConstantF
));
memcpy
(
This
->
vertexShaderConstantF
,
targetStateBlock
->
vertexShaderConstantF
,
sizeof
(
float
)
*
GL_LIMITS
(
vshader_constantsF
)
*
4
);
...
...
@@ -648,6 +651,13 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
memcpy
(
This
->
samplerState
,
targetStateBlock
->
samplerState
,
sizeof
(
This
->
samplerState
));
This
->
scissorRect
=
targetStateBlock
->
scissorRect
;
if
(
This
->
vertexDecl
!=
targetStateBlock
->
vertexDecl
)
{
if
(
targetStateBlock
->
vertexDecl
)
IWineD3DVertexDeclaration_AddRef
(
targetStateBlock
->
vertexDecl
);
if
(
This
->
vertexDecl
)
IWineD3DVertexDeclaration_Release
(
This
->
vertexDecl
);
This
->
vertexDecl
=
targetStateBlock
->
vertexDecl
;
}
for
(
i
=
0
;
i
<
MAX_COMBINED_SAMPLERS
;
++
i
)
{
if
(
targetStateBlock
->
textures
[
i
]
!=
This
->
textures
[
i
])
...
...
dlls/wined3d/vertexdeclaration.c
View file @
dca3c6e7
...
...
@@ -69,7 +69,8 @@ static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclarat
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
iface
==
This
->
wineD3DDevice
->
stateBlock
->
vertexDecl
)
{
if
(
This
->
wineD3DDevice
->
stateBlock
&&
iface
==
This
->
wineD3DDevice
->
stateBlock
->
vertexDecl
)
{
/* See comment in PixelShader::Release */
IWineD3DDeviceImpl_MarkStateDirty
(
This
->
wineD3DDevice
,
STATE_VDECL
);
}
...
...
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