summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-19 10:27:55 -0600
committerBrian Paul <[email protected]>2010-04-19 10:27:57 -0600
commit96b0807253a491442e336844f997fdc4e1761303 (patch)
tree4b1d605f144469339f1b688ce8a5ba05103856c3 /src/mesa/vbo/vbo_exec_api.c
parenta59771fb5305a4a8bda35bc7175eceecd0a950ee (diff)
mesa: unmap the immediate mode VB before destroying it
Fixes failed assertion from fd.o bug 27713. The assertion was added with the new resource/transfer changes. This patch could apply to the 7.8 branch but it's not essential.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index e83bd9e4045..0ccbb423831 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -850,8 +850,11 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
NULL);
}
- /* Free the vertex buffer:
+ /* Free the vertex buffer. Unmap first if needed.
*/
+ if (_mesa_bufferobj_mapped(exec->vtx.bufferobj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, exec->vtx.bufferobj);
+ }
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
}