Reputation: 4078
I have a image that I write via imageStore. In this part, this image is in GENERAL layout. However, at the end of this pass, I make an image memory barrier to transition it to the layout SHADER_READ_ONLY. It was a "kind of mistake". After that, I give this image to a DescriptorImageInfo with the layout GENERAL and I do not have any error from the layers (and it works well, but I use one NVIDIA, so it is may be normal).
However, after reading the specification, it is write :
imageLayout is the layout that the image subresources accessible from imageView will be in at the time this descriptor is accessed. imageLayout is used in descriptor updates for types VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT.
The "will be" make me think about an automatic layout transition. Am I right? Wrong? If I am wrong, why the layer do not tell me that? Is that a bug?
Upvotes: 0
Views: 250
Reputation: 6787
"Will be" here doesn't imply an automatic transition: you're declaring that you will arrange for the image to be in that layout when accessing it via the descriptor.
The validation layers ought to issue an error if you draw with that descriptor active and the image is in a different layout than the descriptor expects. If they're not, that's a validation bug, which can be filed here: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.
Upvotes: 2