summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c
index 69808d90751..ef3aeced340 100644
--- a/src/gallium/drivers/ilo/ilo_3d.c
+++ b/src/gallium/drivers/ilo/ilo_3d.c
@@ -605,15 +605,22 @@ ilo_draw_vbo_with_sw_restart(struct pipe_context *pipe,
return;
}
- struct pipe_transfer *transfer = NULL;
- const void *map = NULL;
- map = pipe_buffer_map(pipe, ilo->ib.state.buffer,
- PIPE_TRANSFER_READ, &transfer);
+ if (ilo->ib.state.buffer) {
+ struct pipe_transfer *transfer;
+ const void *map;
- sub_prim_count = ilo_find_sub_primitives(map + ilo->ib.state.offset,
- ilo->ib.state.index_size, info, restart_info);
+ map = pipe_buffer_map(pipe, ilo->ib.state.buffer,
+ PIPE_TRANSFER_READ, &transfer);
- pipe_buffer_unmap(pipe, transfer);
+ sub_prim_count = ilo_find_sub_primitives(map + ilo->ib.state.offset,
+ ilo->ib.state.index_size, info, restart_info);
+
+ pipe_buffer_unmap(pipe, transfer);
+ }
+ else {
+ sub_prim_count = ilo_find_sub_primitives(ilo->ib.state.user_buffer,
+ ilo->ib.state.index_size, info, restart_info);
+ }
info = restart_info;