summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_draw.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-03-04 17:49:52 +0000
committerJosé Fonseca <[email protected]>2009-03-04 17:49:52 +0000
commit8ad65a23d14f82461c00b1d8dcc1393167f36ab0 (patch)
treeb4cfbdb1e80c5900010ece803f1e77d182c62f48 /src/mesa/vbo/vbo_exec_draw.c
parent2a1f29c22003e819914d386f2117d6e186f59f20 (diff)
mesa: Follow ARB_map_buffer_range more stricly.
Namelly, FlushMappedBufferRange takes a subrange relative to the original range.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 6f8d1f8eb07..b3787459169 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -240,13 +240,16 @@ static void vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
if (exec->vtx.bufferobj->Name) {
GLcontext *ctx = exec->ctx;
- GLintptr offset = exec->vtx.buffer_used;
- GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float);
- if(ctx->Driver.FlushMappedBufferRange)
- ctx->Driver.FlushMappedBufferRange(ctx, target,
- offset, length,
- exec->vtx.bufferobj);
+ if(ctx->Driver.FlushMappedBufferRange) {
+ GLintptr offset = exec->vtx.buffer_used - exec->vtx.bufferobj->Offset;
+ GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float);
+
+ if(length)
+ ctx->Driver.FlushMappedBufferRange(ctx, target,
+ offset, length,
+ exec->vtx.bufferobj);
+ }
exec->vtx.buffer_used += (exec->vtx.buffer_ptr -
exec->vtx.buffer_map) * sizeof(float);