freedreno/a6xx: Disable sample averaging on non-ubwc z24s8 MSAA blits.
authorEmma Anholt <emma@anholt.net>
Thu, 18 Nov 2021 00:04:45 +0000 (16:04 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 19 Nov 2021 17:24:11 +0000 (17:24 +0000)
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
src/gallium/drivers/freedreno/a6xx/fd6_blitter.c

index d6505d7..9d6bc2b 100644 (file)
@@ -262,21 +262,6 @@ spec@egl_khr_surfaceless_context@viewport,Fail
 spec@egl_mesa_configless_context@basic,Fail
 spec@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@ext_framebuffer_multisample@accuracy 2 depth_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 2 depth_resolve small depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 2 stencil_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 2 stencil_resolve small depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 4 depth_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 4 depth_resolve small depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 4 stencil_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy 4 stencil_resolve small depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy all_samples depth_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy all_samples depth_resolve small depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy all_samples stencil_resolve depthstencil,Fail
-spec@ext_framebuffer_multisample@accuracy all_samples stencil_resolve small depthstencil,Fail
-
 spec@ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 2,Fail
 spec@ext_framebuffer_multisample@alpha-to-coverage-dual-src-blend 4,Fail
 spec@ext_framebuffer_multisample@alpha-to-coverage-no-draw-buffer-zero 2,Fail
index 3feb8f7..ed81bec 100644 (file)
@@ -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);