Mesa (master): vbo: fix assertion, #define IMM_BUFFER_NAME

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Jun 11 18:04:09 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jun 10 13:00:35 2009 -0600

vbo: fix assertion, #define IMM_BUFFER_NAME

This was sometimes seen when Glean exited upon test failure when using
Gallium.

---

 src/mesa/vbo/vbo_exec_api.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index a8a0985..34e849a 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -51,6 +51,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #endif
 
 
+/** ID/name for immediate-mode VBO */
+#define IMM_BUFFER_NAME 0xaabbccdd
+
+
 static void reset_attrfv( struct vbo_exec_context *exec );
 
 
@@ -665,7 +669,7 @@ void vbo_use_buffer_objects(GLcontext *ctx)
    /* Any buffer name but 0 can be used here since this bufferobj won't
     * go into the bufferobj hashtable.
     */
-   GLuint bufName = 0xaabbccdd;
+   GLuint bufName = IMM_BUFFER_NAME;
    GLenum target = GL_ARRAY_BUFFER_ARB;
    GLenum usage = GL_STREAM_DRAW_ARB;
    GLsizei size = VBO_VERT_BUFFER_SIZE;
@@ -734,7 +738,8 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
    /* True VBOs should already be unmapped
     */
    if (exec->vtx.buffer_map) {
-      assert (exec->vtx.bufferobj->Name == 0);
+      ASSERT(exec->vtx.bufferobj->Name == 0 ||
+             exec->vtx.bufferobj->Name == IMM_BUFFER_NAME);
       if (exec->vtx.bufferobj->Name == 0) {
          ALIGN_FREE(exec->vtx.buffer_map);
          exec->vtx.buffer_map = NULL;




More information about the mesa-commit mailing list