mesa: Update _ElementSize.
authorBrian Paul <brianp@vmware.com>
Thu, 7 Apr 2011 11:07:32 +0000 (12:07 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 7 Apr 2011 11:20:06 +0000 (12:20 +0100)
src/mesa/main/arrayobj.c
src/mesa/vbo/vbo_context.c
src/mesa/vbo/vbo_exec_draw.c
src/mesa/vbo/vbo_save_draw.c
src/mesa/vbo/vbo_split_copy.c

index 85a8e0e569be9a902a04b318e6b3a2bf63e805c0..4bfb2424004c1d3a4f7b5885af2944032dab2da5 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "glheader.h"
 #include "hash.h"
+#include "image.h"
 #include "imports.h"
 #include "context.h"
 #include "mfeatures.h"
@@ -207,6 +208,7 @@ init_array(struct gl_context *ctx,
    array->Ptr = NULL;
    array->Enabled = GL_FALSE;
    array->Normalized = GL_FALSE;
+   array->_ElementSize = size * _mesa_sizeof_type(type);
 #if FEATURE_ARB_vertex_buffer_object
    /* Vertex array buffers */
    _mesa_reference_buffer_object(ctx, &array->BufferObj,
index 6656ed898169b73bd6f7fd4a9ddb71d6d187fae2..ae17ae29a0c1e17adfa5eaea82696254ab9d5c65 100644 (file)
@@ -72,6 +72,7 @@ static void init_legacy_currval(struct gl_context *ctx)
       cl->Type = GL_FLOAT;
       cl->Format = GL_RGBA;
       cl->Ptr = (const void *)ctx->Current.Attrib[i];
+      cl->_ElementSize = cl->Size * sizeof(GLfloat);
       _mesa_reference_buffer_object(ctx, &cl->BufferObj,
                                     ctx->Shared->NullBufferObj);
    }
@@ -98,6 +99,7 @@ static void init_generic_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 539658021e3868210bba0b608c9dbdd561882411..7e8d8602093bdc83260131d26a58b6fd71d241f6 100644 (file)
@@ -239,6 +239,7 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
         arrays[attr].Type = GL_FLOAT;
          arrays[attr].Format = GL_RGBA;
         arrays[attr].Enabled = 1;
+         arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat);
          _mesa_reference_buffer_object(ctx,
                                        &arrays[attr].BufferObj,
                                        exec->vtx.bufferobj);
index 634a6d3f84b6725a9ccff0c8891da526bd4f54df..26f1d96de33facb40748885ad41efefbe4d54e1c 100644 (file)
@@ -193,6 +193,7 @@ static void vbo_bind_vertex_list(struct gl_context *ctx,
         arrays[attr].Type = GL_FLOAT;
          arrays[attr].Format = GL_RGBA;
         arrays[attr].Enabled = 1;
+         arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat);
          _mesa_reference_buffer_object(ctx,
                                        &arrays[attr].BufferObj,
                                        node->vertex_store->bufferobj);
index 8c981f93e5c66c0f25204ae4d55e474462e833c9..ecca11716730ac48c27eeff5b4a097dcd6a2ca75 100644 (file)
@@ -519,6 +519,7 @@ replay_init( struct copy_context *copy )
       dst->Enabled = GL_TRUE;
       dst->Normalized = src->Normalized; 
       dst->BufferObj = ctx->Shared->NullBufferObj;
+      dst->_ElementSize = src->_ElementSize;
       dst->_MaxElement = copy->dstbuf_size; /* may be less! */
 
       offset += copy->varying[i].size;