Mesa (master): radeonsi: improve a comment about an MSAA bug workaround

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 16 06:03:06 UTC 2020


Module: Mesa
Branch: master
Commit: 27097ca6b52f3b84a8fd8f7427487440980fae29
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=27097ca6b52f3b84a8fd8f7427487440980fae29

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Dec  9 18:18:33 2020 -0500

radeonsi: improve a comment about an MSAA bug workaround

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 at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8022>

---

 src/gallium/drivers/radeonsi/si_state.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 4e91fb8eebd..f407c6d89d5 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -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;



More information about the mesa-commit mailing list