[Mesa-dev] [PATCH 2/6] radeonsi: disable occlusion queries if they are not needed

Marek Olšák maraeo at gmail.com
Sat Aug 23 12:23:51 PDT 2014


From: Marek Olšák <marek.olsak at amd.com>

We always left them enabled, which turned off HiZ in some cases.
This should improve performace with Hyper-Z.
---
 src/gallium/drivers/radeonsi/si_state_draw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 0f700a8..d3a5bc1 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -729,6 +729,14 @@ static void si_state_draw(struct si_context *sctx,
 				       S_028004_PERFECT_ZPASS_COUNTS(1) |
 				       S_028004_SAMPLE_RATE(sctx->framebuffer.log_samples));
 		}
+	} else {
+		/* Disable occlusion queries. */
+		if (sctx->b.chip_class >= CIK) {
+			si_pm4_set_reg(pm4, R_028004_DB_COUNT_CONTROL, 0);
+		} else {
+			si_pm4_set_reg(pm4, R_028004_DB_COUNT_CONTROL,
+				       S_028004_ZPASS_INCREMENT_DISABLE(1));
+		}
 	}
 
 	if (info->count_from_stream_output) {
-- 
1.9.1



More information about the mesa-dev mailing list