aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_resource_buffer.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-08-31 14:49:41 -0600
committerBrian Paul <[email protected]>2016-09-17 10:09:00 -0600
commit4f74b379aa05e133cdd19865662eceacee4f63f4 (patch)
tree934b907b9f6c06cd24fbaae6a705b0719045812e /src/gallium/drivers/svga/svga_resource_buffer.h
parent581292a78c67335814a3ffb33409f7a62ecedd79 (diff)
svga: implement an index buffer translation cache
Some OpenGL apps, like Cinebench R15, have many glDrawElements(GL_QUADS) calls. Since we don't directly support quads we have to convert these calls into GL_TRIANGLES which involves generating a new index buffer. This patch saves the new/translated index buffer in the hope that it can be reused for a later draw call. Cinebench R15 increases by about 20% with this change. The NobelClinician Viewer app also hits this code. Tested with full piglit run. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_buffer.h')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h
index daf9c18a95a..69075888892 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.h
+++ b/src/gallium/drivers/svga/svga_resource_buffer.h
@@ -192,6 +192,17 @@ struct svga_buffer
unsigned size; /**< Approximate size in bytes */
boolean dirty; /**< Need to do a readback before mapping? */
+
+ /** In some cases we try to keep the results of the translate_indices()
+ * function from svga_draw_elements.c
+ */
+ struct {
+ enum pipe_prim_type orig_prim, new_prim;
+ struct pipe_resource *buffer;
+ unsigned index_size;
+ unsigned offset; /**< first index */
+ unsigned count; /**< num indices */
+ } translated_indices;
};