Ran into the following vk validation message when reading a depth texture in a shader for a shadow mapping implementation in https://github.com/subdgtl/HURBAN-Selector/pull/124
VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (0)] : Submitted command buffer expects VkImage 0x686f310000000034[] (subresource: aspectMask 0x2 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL.
object info: (type: COMMAND_BUFFER, hndl: 2817864330592)
I didn't have time to investigate properly yet, but I plan to (feel free to assign me). The wgpu-rs shadow example does not trigger the validation error, so I think I will need to trim it down to a small reproducible example first (ugh). Any thoughts on what might be going wrong?
wgpu version: 0.4 (crates.io)
Looks similar to #459
I'll be happy to look once you provide the repro case.
Good news! Update to 0.5 in that particular project makes the validation error go away :)