From: Eric Anholt Date: Fri, 28 Aug 2009 21:44:55 +0000 (-0700) Subject: vbo: Fix array pointer calculation for MapBufferRange-mapped vertex data. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8096aa521369c3bcf5226c060efa6dd06e48ddc8;p=mesa.git 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. --- diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 53fa90b8afa..0c258c535e0 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; }