Mesa (master): mesa: Update _ElementSize in a few more places.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Apr 7 05:36:11 PDT 2011


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Apr  7 13:35:25 2011 +0100

mesa: Update _ElementSize in a few more places.

---

 src/mesa/vbo/vbo_context.c   |    1 +
 src/mesa/vbo/vbo_exec_api.c  |    2 ++
 src/mesa/vbo/vbo_save_draw.c |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index ae17ae2..9de770d 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -145,6 +145,7 @@ static void init_mat_currval(struct gl_context *ctx)
       cl->Stride = 0;
       cl->StrideB = 0;
       cl->Enabled = 1;
+      cl->_ElementSize = cl->Size * sizeof(GLfloat);
       _mesa_reference_buffer_object(ctx, &cl->BufferObj,
                                     ctx->Shared->NullBufferObj);
    }
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index fcd544d..3c7c439 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -168,6 +168,8 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
              * directly.
              */
             vbo->currval[i].Size = exec->vtx.attrsz[i];
+            assert(vbo->currval[i].Type == GL_FLOAT);
+            vbo->currval[i]._ElementSize = vbo->currval[i].Size * sizeof(GLfloat);
 
             /* This triggers rather too much recalculation of Mesa state
              * that doesn't get used (eg light positions).
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 26f1d96..ca4cff3 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -90,6 +90,8 @@ _playback_copy_to_current(struct gl_context *ctx,
             memcpy(current, tmp, 4 * sizeof(GLfloat));
 
             vbo->currval[i].Size = node->attrsz[i];
+            assert(vbo->currval[i].Type == GL_FLOAT);
+            vbo->currval[i]._ElementSize = vbo->currval[i].Size * sizeof(GLfloat);
 
             if (i >= VBO_ATTRIB_FIRST_MATERIAL &&
                 i <= VBO_ATTRIB_LAST_MATERIAL)



More information about the mesa-commit mailing list