Henri Verbeet : wined3d: Add missing GL locking to calls to FBO functions.

Alexandre Julliard julliard at winehq.org
Thu May 14 11:07:41 CDT 2009


Module: wine
Branch: master
Commit: 1070e075e49adde577e553dd6062f26847a7036f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1070e075e49adde577e553dd6062f26847a7036f

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed May 13 18:22:54 2009 +0200

wined3d: Add missing GL locking to calls to FBO functions.

---

 dlls/wined3d/context.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 0fe00fc..a25d5ea 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -371,6 +371,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
             {
                 struct fbo_entry *entry, *entry2;
 
+                ENTER_GL();
+
                 LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->contexts[i]->fbo_list, struct fbo_entry, entry)
                 {
                     BOOL destroyed = FALSE;
@@ -388,6 +390,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
                     if (!destroyed && entry->depth_stencil == (IWineD3DSurface *)resource)
                         context_destroy_fbo_entry(This, entry);
                 }
+
+                LEAVE_GL();
             }
 
             break;
@@ -1599,7 +1603,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
         case CTXUSAGE_CLEAR:
         case CTXUSAGE_DRAWPRIM:
             if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
+                ENTER_GL();
                 context_apply_fbo_state((IWineD3DDevice *)This);
+                LEAVE_GL();
             }
             if (context->draw_buffer_dirty) {
                 apply_draw_buffer(This, target, FALSE);
@@ -1611,10 +1617,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
             if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
                 if (This->render_offscreen) {
                     FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n");
+                    ENTER_GL();
                     context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo);
                     context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target);
-
-                    ENTER_GL();
                     GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0));
                     checkGLcall("glFramebufferRenderbufferEXT");
                     LEAVE_GL();




More information about the wine-cvs mailing list