radeonsi: disable occlusion queries if they are not needed
authorMarek Olšák <marek.olsak@amd.com>
Sat, 23 Aug 2014 09:12:01 +0000 (11:12 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 1 Sep 2014 19:18:51 +0000 (21:18 +0200)
We always left them enabled, which turned off HiZ in some cases.
This should improve performace with Hyper-Z.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index b0fcb071e2e6ab08ab42a25c2d3a0dbace64b033..3926e5ff15b2a2844f49653274e1033f1a8c0db0 100644 (file)
@@ -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) {