zink: always use VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL for sampler bindings
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 9 Oct 2020 13:37:47 +0000 (09:37 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Mar 2021 16:32:53 +0000 (16:32 +0000)
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 <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>

src/gallium/drivers/zink/zink_context.c

index 9f5e844..7185f9d 100644 (file)
@@ -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);