diff options
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 38b6c56f47..c85e142a5a 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -240,6 +240,13 @@ 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); exec->vtx.buffer_used += (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float); @@ -281,11 +288,8 @@ void vbo_exec_vtx_map( struct vbo_exec_context *exec ) MESA_MAP_NOWAIT_BIT), exec->vtx.bufferobj); } - - if (exec->vtx.buffer_map) { - exec->vtx.buffer_map += exec->vtx.buffer_used / sizeof(float); - } - else { + + if (!exec->vtx.buffer_map) { exec->vtx.buffer_used = 0; ctx->Driver.BufferData(ctx, target, |