From 8096aa521369c3bcf5226c060efa6dd06e48ddc8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 28 Aug 2009 14:44:55 -0700 Subject: [PATCH] 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. --- src/mesa/vbo/vbo_exec_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.30.2