radeonsi: improve a comment about an MSAA bug workaround
authorMarek Olšák <marek.olsak@amd.com>
Wed, 9 Dec 2020 23:18:33 +0000 (18:18 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 16 Dec 2020 05:43:51 +0000 (00:43 -0500)
It doesn't make complete sense to me, but it's copied from the commit
message that made this change.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8022>

src/gallium/drivers/radeonsi/si_state.c

index 4e91fb8eebd942fdab70cd7498c451f481c7b373..f407c6d89d559112870ab0b5c741aba61f07b2a2 100644 (file)
@@ -3297,9 +3297,16 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx)
          /* line bug */
          S_028830_LINE_FILTER_DISABLE(sctx->family <= CHIP_POLARIS12);
 
-      /* The alternative of setting sample locations to 0 would
-       * require a DB flush to avoid Z errors, see
-       * https://bugs.freedesktop.org/show_bug.cgi?id=96908
+      /* For hardware with the sample location bug, the problem is that in order to use the small
+       * primitive filter, we need to explicitly set the sample locations to 0. But the DB doesn't
+       * properly process the change of sample locations without a flush, and so we can end up
+       * with incorrect Z values.
+       *
+       * Instead of doing a flush, just disable the small primitive filter when MSAA is
+       * force-disabled.
+       *
+       * The alternative of setting sample locations to 0 would require a DB flush to avoid
+       * Z errors, see https://bugs.freedesktop.org/show_bug.cgi?id=96908
        */
       if (has_msaa_sample_loc_bug && sctx->framebuffer.nr_samples > 1 && !rs->multisample_enable)
          small_prim_filter_cntl &= C_028830_SMALL_PRIM_FILTER_ENABLE;