summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 1ba39c8aa2..c0ffdb55e4 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -156,7 +156,6 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
if (memcmp(current, tmp, sizeof(tmp)) != 0)
{
memcpy(current, tmp, sizeof(tmp));
-
/* Given that we explicitly state size here, there is no need
* for the COPY_CLEAN above, could just copy 16 bytes and be
@@ -705,6 +704,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
&exec->vtx.bufferobj,
ctx->Array.NullBufferObj);
+ ASSERT(!exec->vtx.buffer_map);
exec->vtx.buffer_map = (GLfloat *)ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE, 64);
vbo_exec_vtxfmt_init( exec );
@@ -731,13 +731,13 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
{
- GLcontext *ctx = exec->ctx;
if (exec->vtx.bufferobj->Name) {
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, exec->vtx.bufferobj);
- ctx->Driver.DeleteBuffer(ctx, exec->vtx.bufferobj);
- exec->vtx.bufferobj = NULL;
+ /* using a real VBO for vertex data */
+ GLcontext *ctx = exec->ctx;
+ _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
}
else {
+ /* just using malloc'd space for vertex data */
if (exec->vtx.buffer_map) {
ALIGN_FREE(exec->vtx.buffer_map);
exec->vtx.buffer_map = NULL;