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>
This commit is contained in:
Emma Anholt 2021-11-17 16:04:45 -08:00 committed by Marge Bot
parent 93eb697a8d
commit cad0b6e2e5
2 changed files with 10 additions and 20 deletions

View 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

View 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);