Mesa (staging/20.0): radeonsi: don't expose 16xAA on chips with 1 RB due to an occlusion query issue

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 1 21:38:30 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 694232e53fefc90c36468f58c95403db2a3145c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=694232e53fefc90c36468f58c95403db2a3145c8

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu May 14 18:47:36 2020 -0400

radeonsi: don't expose 16xAA on chips with 1 RB due to an occlusion query issue

Only Stoney and Raven2 are affected.

Cc: 20.0 20.1 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5047>
(cherry picked from commit f80d653d701f51f00f88601707747554c9a7af1c)

---

 .pick_status.json                       |  2 +-
 src/gallium/drivers/radeonsi/si_state.c | 19 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index b44bed66b8f..a0eda751011 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -5998,7 +5998,7 @@
         "description": "radeonsi: don't expose 16xAA on chips with 1 RB due to an occlusion query issue",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 50a409d97ca..c44b376c514 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1452,11 +1452,6 @@ static void si_emit_db_render_state(struct si_context *sctx)
       if (sctx->chip_class >= GFX7) {
          unsigned log_sample_rate = sctx->framebuffer.log_samples;
 
-         /* Stoney doesn't increment occlusion query counters
-          * if the sample rate is 16x. Use 8x sample rate instead.
-          */
-         if (sctx->family == CHIP_STONEY)
-            log_sample_rate = MIN2(log_sample_rate, 3);
 
          db_count_control =
             S_028004_PERFECT_ZPASS_COUNTS(perfect) |
@@ -2254,20 +2249,24 @@ static bool si_is_format_supported(struct pipe_screen *screen,
           !util_is_power_of_two_or_zero(storage_sample_count))
          return false;
 
+      /* Chips with 1 RB don't increment occlusion queries at 16x MSAA sample rate,
+       * so don't expose 16 samples there.
+       */
+      const unsigned max_eqaa_samples = sscreen->info.num_render_backends == 1 ? 8 : 16;
+      const unsigned max_samples = 8;
+
       /* MSAA support without framebuffer attachments. */
-      if (format == PIPE_FORMAT_NONE && sample_count <= 16)
+      if (format == PIPE_FORMAT_NONE && sample_count <= max_eqaa_samples)
          return true;
 
       if (!sscreen->info.has_eqaa_surface_allocator ||
           util_format_is_depth_or_stencil(format)) {
          /* Color without EQAA or depth/stencil. */
-         if (sample_count > 8 ||
-             sample_count != storage_sample_count)
+         if (sample_count > max_samples || sample_count != storage_sample_count)
             return false;
       } else {
          /* Color with EQAA. */
-         if (sample_count > 16 ||
-             storage_sample_count > 8)
+         if (sample_count > max_eqaa_samples || storage_sample_count > max_samples)
             return false;
       }
    }



More information about the mesa-commit mailing list