u_transfer_helper: Handle Z24S8 with z24_in_z32f but no interleaving
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 18 Sep 2022 14:54:29 +0000 (10:54 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 18 Oct 2022 21:49:24 +0000 (21:49 +0000)
commit87bc3066055c7cb38725f5d1c3ca28c2ea1e03de
treec4f60e111803cc8c6cf4c7e2cc1418d7896325a2
parent78adf448390e3866e0ccda7762bd869dd6d9ce0f
u_transfer_helper: Handle Z24S8 with z24_in_z32f but no interleaving

First, the separate Z/S condition kicks in, splitting up Z24S8 into
Z24X8 + S8. But then the driver is asked to create a Z24X8 resource,
which it may not be able to do. We need to further lower at create
time to Z32F + S8, so the driver is only asked to create supported
formats. We can do this with an extra condition at create time.

The alternate approach would be recursing into
transfer_helper_resource_create, but this seemed more obvious.

Fixes assertion failure running neverball on Asahi.

Assertion failed: (templ->format != PIPE_FORMAT_Z24X8_UNORM &&
      templ->format != PIPE_FORMAT_Z24_UNORM_S8_UINT &&
      "u_transfer_helper should have lowered"), function
agx_resource_create, file agx_pipe.c, line 174.

Fixes: 45a37ace287 ("u_transfer_helper: Handle Z24X8 for drivers that don't use the interleaved transfer_map")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18651>
src/gallium/auxiliary/util/u_transfer_helper.c