Mesa (master): mesa: unmap the immediate mode VB before destroying it
Brian Paul
brianp at kemper.freedesktop.org
Mon Apr 19 16:29:30 UTC 2010
Module: Mesa
Branch: master
Commit: 96b0807253a491442e336844f997fdc4e1761303
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=96b0807253a491442e336844f997fdc4e1761303
Author: Brian Paul <brianp at vmware.com>
Date: Mon Apr 19 10:27:55 2010 -0600
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.
---
src/mesa/vbo/vbo_exec_api.c | 5 ++++-
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 e83bd9e..0ccbb42 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);
}
More information about the mesa-commit
mailing list