[PATCH] Fix a recursive ENTER_GL in read_from_framebuffer.

Roderick Colenbrander thunderbird2k at gmx.net
Sat Oct 18 18:21:46 CDT 2008


---
 dlls/wined3d/surface.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9119a9c..aea3f5a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -917,9 +917,10 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This)
      */
     ActivateContext(device, (IWineD3DSurface *) This, CTXUSAGE_RESOURCELOAD);
     surface_bind_and_dirtify(This);
-    ENTER_GL();
 
+    ENTER_GL();
     glGetIntegerv(GL_READ_BUFFER, &prevRead);
+    LEAVE_GL();
 
     /* Select the correct read buffer, and give some debug output.
      * There is no need to keep track of the current read buffer or reset it, every part of the code
@@ -929,8 +930,11 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This)
     {
         GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *) This, (IWineD3DSwapChain *)swapchain);
         TRACE("Locking %#x buffer\n", buffer);
+
+        ENTER_GL();
         glReadBuffer(buffer);
         checkGLcall("glReadBuffer");
+        LEAVE_GL();
 
         IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
     } else {
@@ -938,7 +942,9 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This)
          * Read from the back buffer
          */
         TRACE("Locking offscreen render target\n");
+        ENTER_GL();
         glReadBuffer(device->offscreenBuffer);
+        LEAVE_GL();
     }
 
     if(!(This->Flags & SFLAG_ALLOCATED)) {
@@ -948,6 +954,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This)
 
     clear_unused_channels(This);
 
+    ENTER_GL();
     /* If !SrcIsUpsideDown we should flip the surface.
      * This can be done using glCopyTexSubImage2D but this
      * is VERY slow, so don't do that. We should prevent
-- 
1.5.3.8


--========GMX316021224368275469385--



More information about the wine-patches mailing list