summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_pipe.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-08-18 15:51:59 +0200
committerMarek Olšák <[email protected]>2017-08-22 13:29:47 +0200
commit5b62eb237c5253f5315c6fd948307e7f2247de2c (patch)
treea384d08911a75041b79b59daaa86884107e2f352 /src/gallium/drivers/radeonsi/si_pipe.h
parent287b0a28f486c9e47f227e2a702577e2b812c7f2 (diff)
radeonsi/gfx9: don't flush TC L2 between rendering and texturing if not needed
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 69a35ea1945..f2a20ba4668 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -611,4 +611,27 @@ si_saved_cs_reference(struct si_saved_cs **dst, struct si_saved_cs *src)
*dst = src;
}
+static inline void
+si_make_CB_shader_coherent(struct si_context *sctx, unsigned num_samples)
+{
+ sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB |
+ SI_CONTEXT_INV_VMEM_L1;
+
+ /* Single-sample color is coherent with shaders on GFX9. */
+ if (sctx->b.chip_class <= VI || num_samples >= 2)
+ sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+}
+
+static inline void
+si_make_DB_shader_coherent(struct si_context *sctx, unsigned num_samples,
+ bool include_stencil)
+{
+ sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_DB |
+ SI_CONTEXT_INV_VMEM_L1;
+
+ /* Single-sample depth (not stencil) is coherent with shaders on GFX9. */
+ if (sctx->b.chip_class <= VI || num_samples >= 2 || include_stencil)
+ sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+}
+
#endif