diff options
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 15 |
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); |