From 5700cbfa1a45f029afd14b1427b893d673e8fec3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 9 Oct 2020 09:37:47 -0400 Subject: [PATCH] zink: always use VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL for sampler bindings if a resource is used multiple times with different samplers then this can result in conflicting layouts, so it's better to just use the general case here Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/gallium/drivers/zink/zink_context.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9f5e8444664..7185f9d3884 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -96,11 +96,7 @@ calc_descriptor_hash_sampler_view(struct zink_context *ctx, struct zink_sampler_ hash_data = &sampler_view->image_view; data_size = sizeof(VkImageView); hash = XXH32(hash_data, data_size, hash); - VkImageLayout layout; - if (util_format_is_depth_and_stencil(sampler_view->base.format)) - layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL; - else - layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + VkImageLayout layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; hash_data = &layout; data_size = sizeof(VkImageLayout); sampler_view->hash = XXH32(hash_data, data_size, hash);