diff options
author | Chia-I Wu <[email protected]> | 2013-07-14 03:56:44 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-07-14 05:59:52 +0800 |
commit | 62c546bbf87afe32e49c100e245e04bc35304481 (patch) | |
tree | dfe218a3ebc658b1fa7e381877ff2bb43df2f39a /src/gallium/drivers/ilo/ilo_3d.c | |
parent | 6bcbb0dc82f9f72c747ef39ed80a4ee0d883ce8e (diff) |
ilo: skip 3DSTATE_INDEX_BUFFER when possible
When only the offset to the index buffer is changed, we can skip the
3DSTATE_INDEX_BUFFER if we always use 0 for the offset, and add
(offset / index_size) to Start Vertex Location in 3DPRIMITIVE.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c index b8cb24f0f71..5b120e77d09 100644 --- a/src/gallium/drivers/ilo/ilo_3d.c +++ b/src/gallium/drivers/ilo/ilo_3d.c @@ -536,7 +536,7 @@ ilo_check_restart_index(const struct ilo_context *ilo, unsigned restart_index) return true; /* Note: indices must be unsigned byte, unsigned short or unsigned int */ - switch (ilo->ib.state.index_size) { + switch (ilo->ib.index_size) { case 1: return ((restart_index & 0xff) == 0xff); break; @@ -605,21 +605,21 @@ ilo_draw_vbo_with_sw_restart(struct pipe_context *pipe, return; } - if (ilo->ib.state.buffer) { + if (ilo->ib.buffer) { struct pipe_transfer *transfer; const void *map; - map = pipe_buffer_map(pipe, ilo->ib.state.buffer, + map = pipe_buffer_map(pipe, ilo->ib.buffer, PIPE_TRANSFER_READ, &transfer); - sub_prim_count = ilo_find_sub_primitives(map + ilo->ib.state.offset, - ilo->ib.state.index_size, info, restart_info); + sub_prim_count = ilo_find_sub_primitives(map + ilo->ib.offset, + ilo->ib.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); + sub_prim_count = ilo_find_sub_primitives(ilo->ib.user_buffer, + ilo->ib.index_size, info, restart_info); } info = restart_info; |