Stefan Dösinger : wined3d: Attempt to clean up fbos only if a gl surface is destroyed.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jul 26 06:36:48 CDT 2007
Module: wine
Branch: master
Commit: 327aa543a432cd92d31850c4705e33402f369942
URL: http://source.winehq.org/git/wine.git/?a=commit;h=327aa543a432cd92d31850c4705e33402f369942
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jul 18 23:13:58 2007 +0200
wined3d: Attempt to clean up fbos only if a gl surface is destroyed.
---
dlls/wined3d/device.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0bdb753..43c65b6 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6443,19 +6443,21 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
case WINED3DRTYPE_SURFACE: {
unsigned int i;
- /* Cleanup any FBO attachments */
- for (i = 0; i < GL_LIMITS(buffers); ++i) {
- if (This->fbo_color_attachments[i] == (IWineD3DSurface *)resource) {
+ /* Cleanup any FBO attachments if d3d is enabled */
+ if(This->d3d_initialized) {
+ for (i = 0; i < GL_LIMITS(buffers); ++i) {
+ if (This->fbo_color_attachments[i] == (IWineD3DSurface *)resource) {
+ bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
+ set_render_target_fbo(iface, i, NULL);
+ This->fbo_color_attachments[i] = NULL;
+ }
+ }
+ if (This->fbo_depth_attachment == (IWineD3DSurface *)resource) {
bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
- set_render_target_fbo(iface, i, NULL);
- This->fbo_color_attachments[i] = NULL;
+ set_depth_stencil_fbo(iface, NULL);
+ This->fbo_depth_attachment = NULL;
}
}
- if (This->fbo_depth_attachment == (IWineD3DSurface *)resource) {
- bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
- set_depth_stencil_fbo(iface, NULL);
- This->fbo_depth_attachment = NULL;
- }
break;
}
More information about the wine-cvs
mailing list