summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_exec_draw.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-08-28 14:44:55 -0700
committerEric Anholt <eric@anholt.net>2009-08-28 15:29:35 -0700
commit8096aa521369c3bcf5226c060efa6dd06e48ddc8 (patch)
treefc74042e497b8af912f028661405d992d1c875ec /src/mesa/vbo/vbo_exec_draw.c
parent2d5c74fac3cc0f9d45a9e11b2fcdea1bc67928c4 (diff)
vbo: Fix array pointer calculation for MapBufferRange-mapped vertex data.
We would end up with the offset from the start of the mapping rather than the offset from the start of the buffer.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 53fa90b8af..0c258c535e 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -218,7 +218,9 @@ vbo_exec_bind_arrays( GLcontext *ctx )
/* a real buffer obj: Ptr is an offset, not a pointer*/
GLsizeiptr offset;
assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
- offset = (GLbyte *) data - (GLbyte *) exec->vtx.bufferobj->Pointer;
+ offset = (GLbyte *) data -
+ (GLbyte *) exec->vtx.bufferobj->Pointer +
+ exec->vtx.bufferobj->Offset;
assert(offset >= 0);
arrays[attr].Ptr = (void *) offset;
}