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
0d88a382
Commit
0d88a382
authored
Apr 11, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Dirtify the shader and declaration states if the bound interface is destroyed.
parent
21e6beed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+12
-0
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+5
-0
vertexshader.c
dlls/wined3d/vertexshader.c
+5
-0
No files found.
dlls/wined3d/pixelshader.c
View file @
0d88a382
...
...
@@ -73,6 +73,18 @@ static ULONG WINAPI IWineD3DPixelShaderImpl_Release(IWineD3DPixelShader *iface)
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
/* SetPixelShader does not AddRef. If the bound pixel shader is destroyed, the pointer in the stateblock remains
* unchanged. Drawing again will most likely crash, even on windows. A problem can occur if the application creates
* a new pixel shader which resides at the same address. Then SetPixelShader will think it is a NOP change, and won't
* dirtify the state.
*
* Do NOT call GetPixelShader here. This will addRef and cause a recursion. And do NOT set the pixel shader to NULL,
* Windows does not do that(Although no test exists since they'd crash randomly)
*/
if
(
iface
==
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
stateBlock
->
pixelShader
)
{
IWineD3DDeviceImpl_MarkStateDirty
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
,
STATE_PIXELSHADER
);
}
if
(
This
->
baseShader
.
shader_mode
==
SHADER_GLSL
&&
This
->
baseShader
.
prgId
!=
0
)
{
struct
list
*
linked_programs
=
&
This
->
baseShader
.
linked_programs
;
...
...
dlls/wined3d/vertexdeclaration.c
View file @
0d88a382
...
...
@@ -98,6 +98,11 @@ 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
)
{
/* See comment in PixelShader::Release */
IWineD3DDeviceImpl_MarkStateDirty
(
This
->
wineD3DDevice
,
STATE_VDECL
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pDeclarationWine
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/wined3d/vertexshader.c
View file @
0d88a382
...
...
@@ -464,6 +464,11 @@ static ULONG WINAPI IWineD3DVertexShaderImpl_Release(IWineD3DVertexShader *iface
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
iface
==
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
stateBlock
->
vertexShader
)
{
/* See comment in PixelShader::Release */
IWineD3DDeviceImpl_MarkStateDirty
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
,
STATE_VSHADER
);
}
if
(
This
->
baseShader
.
shader_mode
==
SHADER_GLSL
&&
This
->
baseShader
.
prgId
!=
0
)
{
struct
list
*
linked_programs
=
&
This
->
baseShader
.
linked_programs
;
...
...
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