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
33d012ef
Commit
33d012ef
authored
Jan 25, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Unload implicit depth stencil buffers correctly.
We have to destroy potential fbo renderbuffers, and make sure the texture is gone
parent
c1538f80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
surface.c
dlls/wined3d/surface.c
+27
-9
No files found.
dlls/wined3d/surface.c
View file @
33d012ef
...
...
@@ -510,25 +510,43 @@ static void surface_remove_pbo(IWineD3DSurfaceImpl *This) {
static
void
WINAPI
IWineD3DSurfaceImpl_UnLoad
(
IWineD3DSurface
*
iface
)
{
IWineD3DBaseTexture
*
texture
=
NULL
;
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
renderbuffer_entry_t
*
entry
,
*
entry2
;
TRACE
(
"(%p)
\n
"
,
iface
);
/* Default pool resources are supposed to be destroyed before Reset is called.
* Implicit resources stay however. So this means we have an implicit render target
* or depth stencil, and the content isn't supposed to survive the reset anyway
*/
if
(
This
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
TRACE
(
"Default pool - nothing to do
\n
"
);
return
;
/* Default pool resources are supposed to be destroyed before Reset is called.
* Implicit resources stay however. So this means we have an implicit render target
* or depth stencil. The content may be destroyed, but we still have to tear down
* opengl resources, so we cannot leave early.
*/
IWineD3DSurface_ModifyLocation
(
iface
,
SFLAG_INSYSMEM
,
TRUE
);
}
else
{
/* Load the surface into system memory */
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INSYSMEM
,
NULL
);
}
/* Load the surface into system memory */
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INSYSMEM
,
NULL
)
;
IWineD3DSurface_ModifyLocation
(
iface
,
SFLAG_INTEXTURE
,
FALSE
);
IWineD3DSurface_ModifyLocation
(
iface
,
SFLAG_INDRAWABLE
,
FALSE
);
This
->
Flags
&=
~
SFLAG_ALLOCATED
;
/* Destroy PBOs, but load them into real sysmem before */
if
(
This
->
Flags
&
SFLAG_PBO
)
{
surface_remove_pbo
(
This
);
}
/* Destroy fbo render buffers. This is needed for implicit render targets, for
* all application-created targets the application has to release the surface
* before calling _Reset
*/
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
This
->
renderbuffers
,
renderbuffer_entry_t
,
entry
)
{
ENTER_GL
();
GL_EXTCALL
(
glDeleteRenderbuffersEXT
(
1
,
&
entry
->
id
));
LEAVE_GL
();
list_remove
(
&
entry
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
list_init
(
&
This
->
renderbuffers
);
This
->
current_renderbuffer
=
NULL
;
/* If we're in a texture, the texture name belongs to the texture. Otherwise,
* destroy 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