summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-02-02 11:06:37 +0000
committerKeith Whitwell <[email protected]>2007-02-02 11:06:37 +0000
commit2ddc8799a8e243cb10cd69ea9424f72b6c4de534 (patch)
tree099e1eb61e79e56c10ba3c0f380b1b9bc939061a /src
parent47d463e954efcd15d20ab2c96a455aa16ddffdcc (diff)
parent8ebda479d90b0c95df50f790316f451a32f4bd4e (diff)
Merge branch 'vbo-0.2-origin' into vbo-0.2
Diffstat (limited to 'src')
-rw-r--r--src/mesa/vbo/vbo_split_copy.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index ef97acbce70..e142dde6803 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -360,6 +360,7 @@ static void replay_init( struct copy_context *copy )
GLcontext *ctx = copy->ctx;
GLuint i;
GLuint offset;
+ const GLvoid *srcptr;
/* Make a list of varying attributes and their vbo's. Also
* calculate vertex size.
@@ -402,13 +403,15 @@ static void replay_init( struct copy_context *copy )
GL_WRITE_ONLY, /* XXX */
copy->ib->obj);
+ srcptr = (const GLubyte *)ADD_POINTERS(copy->ib->obj->Pointer, copy->ib->ptr);
+
switch (copy->ib->type) {
case GL_UNSIGNED_BYTE:
copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count);
copy->srcelt = copy->translated_elt_buf;
-
+
for (i = 0; i < copy->ib->count; i++)
- copy->translated_elt_buf[i] = ((const GLubyte *)copy->ib->ptr)[i];
+ copy->translated_elt_buf[i] = ((const GLubyte *)srcptr)[i];
break;
case GL_UNSIGNED_SHORT:
@@ -416,13 +419,12 @@ static void replay_init( struct copy_context *copy )
copy->srcelt = copy->translated_elt_buf;
for (i = 0; i < copy->ib->count; i++)
- copy->translated_elt_buf[i] = ((const GLushort *)copy->ib->ptr)[i];
+ copy->translated_elt_buf[i] = ((const GLushort *)srcptr)[i];
break;
case GL_UNSIGNED_INT:
copy->translated_elt_buf = NULL;
- copy->srcelt = (const GLuint *)ADD_POINTERS(copy->ib->obj->Pointer,
- copy->ib->ptr);
+ copy->srcelt = (const GLuint *)srcptr;
break;
}