st/mesa: tell VBO module to always unmap buffers before drawing
authorBrian Paul <brianp@vmware.com>
Tue, 25 Oct 2011 23:41:12 +0000 (17:41 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 26 Oct 2011 22:45:03 +0000 (16:45 -0600)
Without this it's possible to wind up in a draw call with the
glBegin/End VBO still in a mapped state.  This is a problem for
the SVGA3D driver and probably not good for other HW drivers.

src/mesa/state_tracker/st_context.c

index 6d4bc54..a181772 100644 (file)
@@ -144,6 +144,10 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe )
    /* we want all vertex data to be placed in buffer objects */
    vbo_use_buffer_objects(ctx);
 
+
+   /* make sure that no VBOs are left mapped when we're drawing. */
+   vbo_always_unmap_buffers(ctx);
+
    /* Need these flags:
     */
    st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;