From 4a7946dca25523a7a13f9116839cffdc528d6518 Mon Sep 17 00:00:00 2001 From: Sergey Kosarevsky Date: Mon, 2 Dec 2024 03:15:02 -0800 Subject: [PATCH] Fixed image layout transition for non-sampled images --- lvk/vulkan/VulkanClasses.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvk/vulkan/VulkanClasses.cpp b/lvk/vulkan/VulkanClasses.cpp index 78ab2f77c7..d3a0f11d9a 100644 --- a/lvk/vulkan/VulkanClasses.cpp +++ b/lvk/vulkan/VulkanClasses.cpp @@ -1870,7 +1870,7 @@ void lvk::CommandBuffer::transitionToShaderReadOnly(TextureHandle handle) const } // set the result of the previous render pass img.transitionLayout(wrapper_->cmdBuf_, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, + img.isSampledImage() ? VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL, srcStage, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, // wait for subsequent // fragment/compute shaders