diff options
author | Marek Olšák <[email protected]> | 2012-04-24 20:58:47 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-30 01:14:26 +0200 |
commit | 4552fd50d959ab99546cfa994f8ba5bdf5d66bc7 (patch) | |
tree | 6fa793d4b11531704029adfd33bfd5a94b90e230 /src/gallium/drivers/r300 | |
parent | 7a0545972694e6afc6c5ac60db563defa79c20d9 (diff) |
gallium: add void *user_buffer in pipe_vertex_buffer
This reduces CPU overhead in st_draw_vbo and removes a lot of unnecessary code
in that function which was required only to comply with the gallium interface,
but wasn't any useful really.
Adapted drivers: i915, llvmpipe, r300, softpipe.
No changes required in: r600, radeonsi.
User vertex buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 99302dc8b0a..76165f51a1b 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -873,7 +873,10 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe, indexed ? 256 : 6); for (i = 0; i < r300->nr_vertex_buffers; i++) { - if (r300->vertex_buffer[i].buffer) { + if (r300->vertex_buffer[i].user_buffer) { + draw_set_mapped_vertex_buffer(r300->draw, i, + r300->vertex_buffer[i].user_buffer); + } else if (r300->vertex_buffer[i].buffer) { void *buf = pipe_buffer_map(pipe, r300->vertex_buffer[i].buffer, PIPE_TRANSFER_READ | @@ -899,7 +902,8 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe, for (i = 0; i < r300->nr_vertex_buffers; i++) { if (r300->vertex_buffer[i].buffer) { - pipe_buffer_unmap(pipe, vb_transfer[i]); + if (vb_transfer[i]) + pipe_buffer_unmap(pipe, vb_transfer[i]); draw_set_mapped_vertex_buffer(r300->draw, i, NULL); } } |