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.
This commit is contained in:
parent
2d5c74fac3
commit
8096aa5213
|
@ -218,7 +218,9 @@ vbo_exec_bind_arrays( GLcontext *ctx )
|
||||||
/* a real buffer obj: Ptr is an offset, not a pointer*/
|
/* a real buffer obj: Ptr is an offset, not a pointer*/
|
||||||
GLsizeiptr offset;
|
GLsizeiptr offset;
|
||||||
assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
|
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);
|
assert(offset >= 0);
|
||||||
arrays[attr].Ptr = (void *) offset;
|
arrays[attr].Ptr = (void *) offset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue