summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-04-07 12:07:32 +0100
committerJosé Fonseca <jfonseca@vmware.com>2011-04-07 12:20:06 +0100
commit204991bf5d29caa3fa54df9e4f6898faa73752cf (patch)
tree9bd1011d1ecf1fb498ae52ab12f9fdc68f3e9d84
parent23d75936a72b9a9b9e1d04a901a86a75d93dbffb (diff)
mesa: Update _ElementSize.
-rw-r--r--src/mesa/main/arrayobj.c2
-rw-r--r--src/mesa/vbo/vbo_context.c2
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c1
-rw-r--r--src/mesa/vbo/vbo_save_draw.c1
-rw-r--r--src/mesa/vbo/vbo_split_copy.c1
5 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 85a8e0e569b..4bfb2424004 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -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,
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 6656ed89816..ae17ae29a0c 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -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);
}
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 539658021e3..7e8d8602093 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -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);
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 634a6d3f84b..26f1d96de33 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -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);
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index 8c981f93e5c..ecca1171673 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -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;