asahi: Fix Z32S8 harder

Fixes dEQP-GLES3.functional.texture.format.sized.2d.depth32f_stencil8_pot after
stencil texturing broke it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
This commit is contained in:
Alyssa Rosenzweig
2022-11-28 21:30:49 -05:00
parent 0c2500168d
commit 949a760c9f
+13 -5
View File
@@ -624,11 +624,19 @@ agx_create_sampler_view(struct pipe_context *pctx,
struct pipe_resource *texture = orig_texture;
enum pipe_format format = state->format;
/* Use stencil attachment, separate stencil always used on G13 */
if (rsrc->separate_stencil) {
rsrc = rsrc->separate_stencil;
texture = &rsrc->base;
format = texture->format;
const struct util_format_description *desc = util_format_description(format);
/* Separate stencil always used on G13, so we need to fix up for Z32S8 */
if (util_format_has_stencil(desc) && rsrc->separate_stencil) {
if (util_format_has_depth(desc)) {
/* Reinterpret as the depth-only part */
format = util_format_get_depth_only(format);
} else {
/* Use the stencil-only-part */
rsrc = rsrc->separate_stencil;
texture = &rsrc->base;
format = texture->format;
}
}
/* Save off the resource that we actually use, with the stencil fixed up */