From 62c546bbf87afe32e49c100e245e04bc35304481 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 14 Jul 2013 03:56:44 +0800 Subject: 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. --- src/gallium/drivers/ilo/ilo_gpe.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/ilo/ilo_gpe.h') diff --git a/src/gallium/drivers/ilo/ilo_gpe.h b/src/gallium/drivers/ilo/ilo_gpe.h index 27fa57e2d38..73a94304bf4 100644 --- a/src/gallium/drivers/ilo/ilo_gpe.h +++ b/src/gallium/drivers/ilo/ilo_gpe.h @@ -63,9 +63,15 @@ struct ilo_vb_state { }; struct ilo_ib_state { - struct pipe_index_buffer state; + struct pipe_resource *buffer; + const void *user_buffer; + unsigned offset; + unsigned index_size; - struct pipe_resource *resource; + /* these are not valid until the state is finalized */ + struct pipe_resource *hw_resource; + unsigned hw_index_size; + /* an offset to be added to pipe_draw_info::start */ int64_t draw_start_offset; }; -- cgit v1.2.3