Mesa (master): mesa: added _ElementSize field to gl_client_array

Brian Paul brianp at kemper.freedesktop.org
Thu May 7 16:17:01 UTC 2009


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

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

mesa: added _ElementSize field to gl_client_array

Will be handy for bounds checking later...

---

 src/mesa/main/mtypes.h |    1 +
 src/mesa/main/varray.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index bdb1081..716e5c6 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1541,6 +1541,7 @@ struct gl_client_array
    const GLubyte *Ptr;          /**< Points to array data */
    GLboolean Enabled;		/**< Enabled flag is a boolean */
    GLboolean Normalized;        /**< GL_ARB_vertex_program */
+   GLuint _ElementSize;         /**< size of each element in bytes */
 
    struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */
    GLuint _MaxElement;          /**< max element index into array buffer */
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 106252e..629be60 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -63,6 +63,8 @@ update_array(GLcontext *ctx, struct gl_client_array *array,
    array->StrideB = stride ? stride : elementSize;
    array->Normalized = normalized;
    array->Ptr = (const GLubyte *) ptr;
+   array->_ElementSize = elementSize;
+
 #if FEATURE_ARB_vertex_buffer_object
    _mesa_reference_buffer_object(ctx, &array->BufferObj,
                                  ctx->Array.ArrayBufferObj);




More information about the mesa-commit mailing list