summaryrefslogtreecommitdiff
path: root/src/mesa/vbo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c14
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 59e176b837..6f8d1f8eb0 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);
@@ -286,11 +293,8 @@ void vbo_exec_vtx_map( struct vbo_exec_context *exec )
exec->vtx.bufferobj);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
}
-
- 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,