From 5c1ce2edb82bd4e85b2124ee747b5e3f875916d5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sun, 13 Dec 2020 21:33:29 -0500 Subject: [PATCH] zink: use GENERAL layout for sampler images that are also bound as shader images we can't have the same image with 2 layouts, so just go with the more global one Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_descriptors.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index e699941a2fe..c243cfdd062 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1054,7 +1054,8 @@ update_sampler_descriptors(struct zink_context *ctx, struct zink_descriptor_set bufferview = sampler_view->buffer_view->buffer_view; } else if (res) { imageview = sampler_view->image_view->image_view; - layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + layout = (res->bind_history & BITFIELD64_BIT(ZINK_DESCRIPTOR_TYPE_IMAGE)) ? + VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; sampler = ctx->sampler_states[stage][index + k]; } assert(num_resources < num_bindings);