diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-03-17 20:37:44 -0400 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-03-18 09:34:34 -0700 |
commit | aafc4fe93e7b50247a76390f67af0600988c6cde (patch) | |
tree | 37a36ff2a16c4475ced91e334cd05da04e9e6d4e | |
parent | d2f8d08e9d5006355f6d0efc78f84250bc1e9dfe (diff) |
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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9673>
(cherry picked from commit e02d1eb95075b20e4de4008093755f1a72558faa)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 22362be06a4..f01e058772f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -265,7 +265,7 @@ "description": "zink: always use requested format for sampler view creation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "c768c5297a89841d80f65f6a4e8de50509baed7c" }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index fe5d4460755..fc15883f644 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -346,12 +346,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; |