Mesa (8.0): mesa: Set the gl_array_object:: ARBsemantics flag at the right time

Ian Romanick idr at kemper.freedesktop.org
Thu Feb 2 18:51:57 UTC 2012


Module: Mesa
Branch: 8.0
Commit: c34947dbb10f7211c351d02a3f64df284a40ee49
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c34947dbb10f7211c351d02a3f64df284a40ee49

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Jan 31 09:00:48 2012 -0700

mesa: Set the gl_array_object::ARBsemantics flag at the right time

With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
(cherry picked from commit e06b1c65bc576a9b239841cbe3a8a8c2d6a8d09f)

---

 src/mesa/main/arrayobj.c |    6 +++++-
 src/mesa/main/mtypes.h   |    5 +++++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index de1391f..04c403c 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -360,6 +360,10 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
             return;
          }
 
+         save_array_object(ctx, newObj);
+      }
+
+      if (!newObj->_Used) {
          /* The "Interactions with APPLE_vertex_array_object" section of the
           * GL_ARB_vertex_array_object spec says:
           *
@@ -367,7 +371,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
           *     BindVertexArrayAPPLE, determines the semantic of the object."
           */
          newObj->ARBsemantics = genRequired;
-         save_array_object(ctx, newObj);
+         newObj->_Used = GL_TRUE;
       }
    }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1d37008..bce5de2 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1627,6 +1627,11 @@ struct gl_array_object
     */
    GLboolean ARBsemantics;
 
+   /**
+    * Has this array object been bound?
+    */
+   GLboolean _Used;
+
    /** Vertex attribute arrays */
    struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX];
 




More information about the mesa-commit mailing list