From 54d16dbe2999a0aabd70ee06c60841d2ee6f5982 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 10 Jul 2024 11:16:17 -0400 Subject: [PATCH] zink: only clamp samplerview aspect for zs formats this otherwise breaks planar images Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 87c43e497f7..ffec53ec6e8 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1140,7 +1140,7 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres, ivci = create_ivci(screen, res, &templ, state->target); ivci.subresourceRange.levelCount = state->u.tex.last_level - state->u.tex.first_level + 1; - ivci.subresourceRange.aspectMask = sampler_aspect_from_format(state->format); + ivci.subresourceRange.aspectMask = util_format_is_depth_or_stencil(state->format) ? sampler_aspect_from_format(state->format) : res->aspect; bool red_depth_sampler_view = false; /* samplers for stencil aspects of packed formats need to always use stencil swizzle */ if (ivci.subresourceRange.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {