Mesa (main): freedreno/a6xx: Disable sample averaging on non-ubwc z24s8 MSAA blits.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 19 17:52:04 UTC 2021


Module: Mesa
Branch: main
Commit: cad0b6e2e58cc9f74c91461b3e717ac4e86085d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cad0b6e2e58cc9f74c91461b3e717ac4e86085d5

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Nov 17 16:04:45 2021 -0800

freedreno/a6xx: Disable sample averaging on non-ubwc z24s8 MSAA blits.

The fallback path we averages unorm textures, but if we don't have ubwc on
either then we can just cast them to uint which then just takes sample 0.

The proper UBWC format I think ends up averaging, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13867>

---

 src/freedreno/ci/freedreno-a630-fails.txt        | 15 ---------------
 src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/freedreno/ci/freedreno-a630-fails.txt b/src/freedreno/ci/freedreno-a630-fails.txt
index d6505d78433..9d6bc2b3d5a 100644
--- a/src/freedreno/ci/freedreno-a630-fails.txt
+++ b/src/freedreno/ci/freedreno-a630-fails.txt
@@ -262,21 +262,6 @@ spec at egl_khr_surfaceless_context@viewport,Fail
 spec at egl_mesa_configless_context@basic,Fail
 spec at ext_framebuffer_blit@fbo-blit-check-limits,Fail
 
-# "MESA: warning: sample averaging on fallback z24s8 blit when we shouldn't."
-# on glBlitFramebuffer() from the MSAA FB to non-MSAA.
-spec at ext_framebuffer_multisample@accuracy 2 depth_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 2 depth_resolve small depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 2 stencil_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 2 stencil_resolve small depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 4 depth_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 4 depth_resolve small depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 4 stencil_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy 4 stencil_resolve small depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy all_samples depth_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy all_samples depth_resolve small depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy all_samples stencil_resolve depthstencil,Fail
-spec at ext_framebuffer_multisample@accuracy all_samples stencil_resolve small depthstencil,Fail
-
 spec at ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 2,Fail
 spec at ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 4,Fail
 spec at ext_framebuffer_multisample@alpha-to-coverage-no-draw-buffer-zero 2,Fail
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
index 3feb8f729b9..ed81becd860 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
@@ -1071,12 +1071,17 @@ handle_zs_blit(struct fd_context *ctx,
        * 8888_unorm.
        */
       if (!ctx->screen->info->a6xx.has_z24uint_s8uint) {
-         if (!src->layout.ubwc)
-            blit.src.format = PIPE_FORMAT_RGBA8888_UNORM;
-         if (!dst->layout.ubwc)
-            blit.dst.format = PIPE_FORMAT_RGBA8888_UNORM;
+         if (!src->layout.ubwc && !dst->layout.ubwc) {
+            blit.src.format = PIPE_FORMAT_RGBA8888_UINT;
+            blit.dst.format = PIPE_FORMAT_RGBA8888_UINT;
+         } else {
+            if (!src->layout.ubwc)
+               blit.src.format = PIPE_FORMAT_RGBA8888_UNORM;
+            if (!dst->layout.ubwc)
+               blit.dst.format = PIPE_FORMAT_RGBA8888_UNORM;
+         }
       }
-      if (info->src.resource->nr_samples > 1)
+      if (info->src.resource->nr_samples > 1 && blit.src.format != PIPE_FORMAT_RGBA8888_UINT)
          mesa_logw("sample averaging on fallback z24s8 blit when we shouldn't.");
       return fd_blitter_blit(ctx, &blit);
 



More information about the mesa-commit mailing list