Mesa (master): zink: always use requested format for sampler view creation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 18 02:50:28 UTC 2021


Module: Mesa
Branch: master
Commit: e02d1eb95075b20e4de4008093755f1a72558faa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e02d1eb95075b20e4de4008093755f1a72558faa

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Mar 17 20:37:44 2021 -0400

zink: always use requested format for sampler view creation

this should be fine and good

Fixes: c768c5297a8 ("zink: force stencil format for stencil-only samplers and swizzle the right component")

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9673>

---

 src/gallium/drivers/zink/zink_context.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index f53d5cf8f8c..daabcf09f13 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -617,12 +617,11 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres,
       ivci.components.b = component_mapping(state->swizzle_b);
       ivci.components.a = component_mapping(state->swizzle_a);
       ivci.subresourceRange.aspectMask = sampler_aspect_from_format(state->format);
-      /* samplers for stencil aspects of packed formats need to always use stencil type */
+      /* samplers for stencil aspects of packed formats need to always use stencil swizzle */
       if (ivci.subresourceRange.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) {
-         ivci.format = VK_FORMAT_S8_UINT;
          ivci.components.g = VK_COMPONENT_SWIZZLE_R;
-      } else
-         ivci.format = zink_get_format(screen, state->format);
+      }
+      ivci.format = zink_get_format(screen, state->format);
       assert(ivci.format);
 
       ivci.subresourceRange.baseMipLevel = state->u.tex.first_level;



More information about the mesa-commit mailing list