summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-03-30 22:15:52 -0400
committerMarek Olšák <[email protected]>2018-04-05 15:34:58 -0400
commit0669dca9c00261849cee14d69fdea0a5e323c7f7 (patch)
treeefb27c38b9c4ad9c9324b4b1a4d036ea2267b4f6
parent6ac87c17695ebf300a81ecc61e5703c6492b6e5c (diff)
radeonsi: skip DCC render feedback checking if color writes are disabled
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c5
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h17
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c6
3 files changed, 23 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index d9d489825f8..22916b6c73b 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -713,6 +713,11 @@ static void si_check_render_feedback_resident_images(struct si_context *sctx)
static void si_check_render_feedback(struct si_context *sctx)
{
+ /* There is no render feedback if color writes are disabled.
+ * (e.g. a pixel shader with image stores)
+ */
+ if (!si_get_total_colormask(sctx))
+ return;
if (!sctx->need_check_render_feedback)
return;
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index e3d45ef6c3b..e65c946d186 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -940,4 +940,21 @@ static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)
return sctx->ps_iter_samples;
}
+static inline unsigned si_get_total_colormask(struct si_context *sctx)
+{
+ if (sctx->queued.named.rasterizer->rasterizer_discard)
+ return 0;
+
+ struct si_shader_selector *ps = sctx->ps_shader.cso;
+ unsigned colormask = sctx->framebuffer.colorbuf_enabled_4bit &
+ sctx->queued.named.blend->cb_target_mask;
+
+ if (!ps->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
+ colormask &= ps->colors_written_4bit;
+ else if (!ps->colors_written_4bit)
+ colormask = 0; /* color0 writes all cbufs, but it's not written */
+
+ return colormask;
+}
+
#endif
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index d7742eafb04..f2d29e40744 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1215,11 +1215,7 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
ps->info.writes_samplemask ||
alpha_to_coverage ||
si_get_alpha_test_func(sctx) != PIPE_FUNC_ALWAYS;
-
- unsigned ps_colormask = sctx->framebuffer.colorbuf_enabled_4bit &
- sctx->queued.named.blend->cb_target_mask;
- if (!ps->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
- ps_colormask &= ps->colors_written_4bit;
+ unsigned ps_colormask = si_get_total_colormask(sctx);
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard ||
(!ps_colormask &&