summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_swtnl_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
committerMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
commitbb4c5d72d7c7cb1d9e7016e2c07c36875f30011a (patch)
tree153444ff535900f82ae63b5af8ccd09fb2f063af /src/gallium/drivers/svga/svga_swtnl_draw.c
parent96956dc5076fc03b9290368ca90e3f3b870ee613 (diff)
parent8dd3e341b337ca2d22bcc0e7548a78a6c36ca77d (diff)
Merge branch 'gallium-userbuf'
Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
Diffstat (limited to 'src/gallium/drivers/svga/svga_swtnl_draw.c')
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_draw.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index 377026411f2..bb6870f6572 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -66,12 +66,14 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
* Map vertex buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- map = pipe_buffer_map(&svga->pipe,
- svga->curr.vb[i].buffer,
- PIPE_TRANSFER_READ,
- &vb_transfer[i]);
-
- draw_set_mapped_vertex_buffer(draw, i, map);
+ if (svga->curr.vb[i].buffer) {
+ map = pipe_buffer_map(&svga->pipe,
+ svga->curr.vb[i].buffer,
+ PIPE_TRANSFER_READ,
+ &vb_transfer[i]);
+
+ draw_set_mapped_vertex_buffer(draw, i, map);
+ }
}
/* TODO move this to update_swtnl_draw */
@@ -109,8 +111,10 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
* unmap vertex/index buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
- draw_set_mapped_vertex_buffer(draw, i, NULL);
+ if (svga->curr.vb[i].buffer) {
+ pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
+ draw_set_mapped_vertex_buffer(draw, i, NULL);
+ }
}
if (ib_transfer) {