mesa: Update _ElementSize in a few more places.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 7 Apr 2011 12:35:25 +0000 (13:35 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 7 Apr 2011 12:35:25 +0000 (13:35 +0100)
src/mesa/vbo/vbo_context.c
src/mesa/vbo/vbo_exec_api.c
src/mesa/vbo/vbo_save_draw.c

index ae17ae29a0c1e17adfa5eaea82696254ab9d5c65..9de770d0bcfa21ee0a6f0bfd20ac41f5b0778826 100644 (file)
@@ -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);
    }
index fcd544de7636a8fe2853254c906f46b78f309817..3c7c439b64c88a55fac1e6315647a1ddd98e9d2e 100644 (file)
@@ -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).
index 26f1d96de33facb40748885ad41efefbe4d54e1c..ca4cff38a89f10c6c415405c4f23bbabfa4bb1ff 100644 (file)
@@ -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)