Mesa (master): mesa: protect driver.flush() with FLUSH_CURRENT

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Apr 22 08:03:27 UTC 2009


Module: Mesa
Branch: master
Commit: 009749b4a8c3ec54f47f3f85552e5ae275ab6ae6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=009749b4a8c3ec54f47f3f85552e5ae275ab6ae6

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Apr 21 16:55:57 2009 +0100

mesa: protect driver.flush() with FLUSH_CURRENT

Need to do this to ensure vbo code unmaps its buffers before calling
the driver, which may be sitting on top of a memory manager which
objects to firing commands from a mapped buffer.

---

 src/mesa/main/context.c  |    3 ++-
 src/mesa/main/fbobject.c |   13 ++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 4cff36a..5726dbd 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -187,7 +187,7 @@ GLfloat _mesa_ubyte_to_float_color_tab[256];
 void
 _mesa_notifySwapBuffers(__GLcontext *ctx)
 {
-   FLUSH_VERTICES( ctx, 0 );
+   FLUSH_CURRENT( ctx, 0 );
    if (ctx->Driver.Flush) {
       ctx->Driver.Flush(ctx);
    }
@@ -1514,6 +1514,7 @@ _mesa_Flush(void)
 {
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+   FLUSH_CURRENT( ctx, 0 );
    if (ctx->Driver.Flush) {
       ctx->Driver.Flush(ctx);
    }
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 151e290..9c5a590 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -692,7 +692,7 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    /* The above doesn't fully flush the drivers in the way that a
     * glFlush does, but that is required here:
     */
@@ -1187,8 +1187,7 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    if (ctx->Driver.Flush) {  
       ctx->Driver.Flush(ctx);
    }
@@ -1269,7 +1268,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
    GET_CURRENT_CONTEXT(ctx);
 
    ASSERT_OUTSIDE_BEGIN_END(ctx);
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    /* The above doesn't fully flush the drivers in the way that a
     * glFlush does, but that is required here:
     */
@@ -1507,7 +1506,7 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
       }
    }
 
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    /* The above doesn't fully flush the drivers in the way that a
     * glFlush does, but that is required here:
     */
@@ -1688,7 +1687,7 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
    }
 
 
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    /* The above doesn't fully flush the drivers in the way that a
     * glFlush does, but that is required here:
     */
@@ -1769,7 +1768,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
       }
    }
 
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+   FLUSH_CURRENT(ctx, _NEW_BUFFERS);
    /* The above doesn't fully flush the drivers in the way that a
     * glFlush does, but that is required here:
     */




More information about the mesa-commit mailing list