summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_pipe.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-12-07 20:04:40 +0100
committerMarek Olšák <[email protected]>2014-12-10 21:59:37 +0100
commit3382036946cf7c7859c9027c4ffe4881e30ead56 (patch)
tree649d1d6b106b4f90d8eb89707d6f3b19b850855b /src/gallium/drivers/radeonsi/si_pipe.h
parentb472709090c10d17686b0ae5a5112e43ba8ac0c6 (diff)
radeonsi: emit base vertex and start instance only if they change
v2: added a helper function for invalidation of the sh constants Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 15ca9a559e5..e3cc09a0b85 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -34,6 +34,11 @@
#define SI_BIG_ENDIAN 0
#endif
+/* The base vertex can be any number, but we must pick one which
+ * will mean "unknown" for the purpose of state tracking and the number
+ * shouldn't be a commonly-used one. */
+#define SI_BASE_VERTEX_UNKNOWN INT_MIN
+
#define SI_TRACE_CS 0
#define SI_TRACE_CS_DWORDS 6
@@ -169,6 +174,11 @@ struct si_context {
bool db_depth_clear;
bool db_depth_disable_expclear;
unsigned ps_db_shader_control;
+
+ /* Draw state. */
+ int last_base_vertex;
+ int last_start_instance;
+ int last_sh_base_reg;
};
/* si_blit.c */
@@ -227,4 +237,12 @@ si_resource_create_custom(struct pipe_screen *screen,
PIPE_BIND_CUSTOM, usage, size));
}
+static INLINE void
+si_invalidate_draw_sh_constants(struct si_context *sctx)
+{
+ sctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN;
+ sctx->last_start_instance = -1; /* reset to an unknown value */
+ sctx->last_sh_base_reg = -1; /* reset to an unknown value */
+}
+
#endif