From: Marek Olšák Date: Wed, 26 May 2010 17:36:21 +0000 (+0200) Subject: r300g/swtcl: vbo transfer sanity checks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=500160a3c9b0a777586c60abd3d136a5c30937f4;p=mesa.git r300g/swtcl: vbo transfer sanity checks --- diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 3f66f75943e..1961e0e53a0 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -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)