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
94cd8656
Commit
94cd8656
authored
Jun 25, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make context_resource_released() responsible for activating a different GL context.
In case lastActiveRenderTarget is destroyed.
parent
964f4b01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
33 deletions
+49
-33
context.c
dlls/wined3d/context.c
+47
-0
device.c
dlls/wined3d/device.c
+2
-33
No files found.
dlls/wined3d/context.c
View file @
94cd8656
...
...
@@ -426,6 +426,53 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
{
case
WINED3DRTYPE_SURFACE
:
{
if
((
IWineD3DSurface
*
)
resource
==
This
->
lastActiveRenderTarget
)
{
IWineD3DSwapChainImpl
*
swapchain
;
TRACE
(
"Last active render target destroyed.
\n
"
);
/* Find a replacement surface for the currently active back
* buffer. The context manager does not do NULL checks, so
* switch to a valid target as long as the currently set
* surface is still valid. Use the surface of the implicit
* swpchain. If that is the same as the destroyed surface the
* device is destroyed and the lastActiveRenderTarget member
* shouldn't matter. */
swapchain
=
This
->
swapchains
?
(
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
]
:
NULL
;
if
(
swapchain
)
{
if
(
swapchain
->
backBuffer
&&
swapchain
->
backBuffer
[
0
]
!=
(
IWineD3DSurface
*
)
resource
)
{
TRACE
(
"Activating primary back buffer.
\n
"
);
ActivateContext
(
This
,
swapchain
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
}
else
if
(
!
swapchain
->
backBuffer
&&
swapchain
->
frontBuffer
!=
(
IWineD3DSurface
*
)
resource
)
{
/* Single buffering environment */
TRACE
(
"Activating primary front buffer.
\n
"
);
ActivateContext
(
This
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
}
else
{
/* Implicit render target destroyed, that means the
* device is being destroyed whatever we set here, it
* shouldn't matter. */
TRACE
(
"Device is being destroyed, setting lastActiveRenderTarget to 0xdeadbabe.
\n
"
);
This
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadbabe
;
}
}
else
{
WARN
(
"Render target set, but swapchain does not exist!
\n
"
);
/* May happen during ddraw uninitialization. */
This
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadcafe
;
}
}
for
(
i
=
0
;
i
<
This
->
numContexts
;
++
i
)
{
WineD3DContext
*
context
=
This
->
contexts
[
i
];
...
...
dlls/wined3d/device.c
View file @
94cd8656
...
...
@@ -7327,39 +7327,8 @@ void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resour
case
WINED3DRTYPE_SURFACE
:
{
unsigned
int
i
;
/* Cleanup any FBO attachments if d3d is enabled */
if
(
This
->
d3d_initialized
)
{
if
((
IWineD3DSurface
*
)
resource
==
This
->
lastActiveRenderTarget
)
{
IWineD3DSwapChainImpl
*
swapchain
=
This
->
swapchains
?
(
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
]
:
NULL
;
TRACE
(
"Last active render target destroyed
\n
"
);
/* Find a replacement surface for the currently active back buffer. The context manager does not do NULL
* checks, so switch to a valid target as long as the currently set surface is still valid. Use the
* surface of the implicit swpchain. If that is the same as the destroyed surface the device is destroyed
* and the lastActiveRenderTarget member shouldn't matter
*/
if
(
swapchain
)
{
if
(
swapchain
->
backBuffer
&&
swapchain
->
backBuffer
[
0
]
!=
(
IWineD3DSurface
*
)
resource
)
{
TRACE
(
"Activating primary back buffer
\n
"
);
ActivateContext
(
This
,
swapchain
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
}
else
if
(
!
swapchain
->
backBuffer
&&
swapchain
->
frontBuffer
!=
(
IWineD3DSurface
*
)
resource
)
{
/* Single buffering environment */
TRACE
(
"Activating primary front buffer
\n
"
);
ActivateContext
(
This
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
}
else
{
TRACE
(
"Device is being destroyed, setting lastActiveRenderTarget = 0xdeadbabe
\n
"
);
/* Implicit render target destroyed, that means the device is being destroyed
* whatever we set here, it shouldn't matter
*/
This
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadbabe
;
}
}
else
{
/* May happen during ddraw uninitialization */
TRACE
(
"Render target set, but swapchain does not exist!
\n
"
);
This
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadcafe
;
}
}
if
(
This
->
d3d_initialized
)
{
for
(
i
=
0
;
i
<
GL_LIMITS
(
buffers
);
++
i
)
{
if
(
This
->
render_targets
[
i
]
==
(
IWineD3DSurface
*
)
resource
)
{
This
->
render_targets
[
i
]
=
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