Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5e37345b
Commit
5e37345b
authored
Feb 17, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Activate a different context if the active render target is destroyed.
parent
762e2279
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
surface.c
dlls/wined3d/surface.c
+32
-4
No files found.
dlls/wined3d/surface.c
View file @
5e37345b
...
...
@@ -247,6 +247,38 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
if
(
ref
==
0
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
This
->
resource
.
wineD3DDevice
;
TRACE
(
"(%p) : cleaning up
\n
"
,
This
);
if
(
iface
==
device
->
lastActiveRenderTarget
)
{
IWineD3DSwapChainImpl
*
swapchain
=
device
->
swapchains
?
(
IWineD3DSwapChainImpl
*
)
device
->
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
]
!=
iface
)
{
TRACE
(
"Activating primary back buffer
\n
"
);
ActivateContext
(
device
,
swapchain
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
}
else
if
(
!
swapchain
->
backBuffer
&&
swapchain
->
frontBuffer
!=
iface
)
{
/* Single buffering environment */
TRACE
(
"Activating primary front buffer
\n
"
);
ActivateContext
(
device
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
}
else
{
TRACE
(
"Device is beeing destroyed, setting lastActiveRenderTarget = 0xdeadbabe
\n
"
);
/* Implicit render target destroyed, that means the device is beeing destroyed
* whatever we set here, it shouldn't matter
*/
device
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadbabe
;
}
}
else
{
/* May happen during ddraw uninitialization */
TRACE
(
"Render target set, but swapchain does not exist!
\n
"
);
device
->
lastActiveRenderTarget
=
(
IWineD3DSurface
*
)
0xdeadcafe
;
}
}
if
(
This
->
glDescription
.
textureName
!=
0
)
{
/* release the openGL texture.. */
ENTER_GL
();
TRACE
(
"Deleting texture %d
\n
"
,
This
->
glDescription
.
textureName
);
...
...
@@ -269,10 +301,6 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
if
(
iface
==
device
->
ddraw_primary
)
device
->
ddraw_primary
=
NULL
;
if
(
iface
==
device
->
lastActiveRenderTarget
)
{
device
->
lastActiveRenderTarget
=
NULL
;
}
TRACE
(
"(%p) Released
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
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