r300g/swtcl: vbo transfer sanity checks
authorMarek Olšák <maraeo@gmail.com>
Wed, 26 May 2010 17:36:21 +0000 (19:36 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 26 May 2010 20:22:52 +0000 (22:22 +0200)
src/gallium/drivers/r300/r300_render.c

index 3f66f75943e296807490b3182c115fab905bb2e8..1961e0e53a0b46b3454ec065d1c5ad193851d09b 100644 (file)
@@ -886,6 +886,8 @@ static void* r300_render_map_vertices(struct vbuf_render* render)
 {
     struct r300_render* r300render = r300_render(render);
 
+    assert(!r300render->vbo_transfer);
+
     r300render->vbo_ptr = pipe_buffer_map(&r300render->r300->context,
                                          r300render->vbo,
                                           PIPE_TRANSFER_WRITE,
@@ -901,9 +903,13 @@ static void r300_render_unmap_vertices(struct vbuf_render* render,
     struct r300_render* r300render = r300_render(render);
     struct pipe_context* context = &r300render->r300->context;
 
+    assert(r300render->vbo_transfer);
+
     r300render->vbo_max_used = MAX2(r300render->vbo_max_used,
                                     r300render->vertex_size * (max + 1));
     pipe_buffer_unmap(context, r300render->vbo, r300render->vbo_transfer);
+
+    r300render->vbo_transfer = NULL;
 }
 
 static void r300_render_release_vertices(struct vbuf_render* render)