I have a relatively simple scenario:
- Set compositor to a basic compositor to render the loading screen.
- After loading is finished disable basic compositor and immediately set compositor to the dynamic cubemap sample.
I get:
Ogre: ERROR: [Validation] Code 0 : vkQueuePresentKHR(): pPresentInfo->pSwapchains[0] images passed to present must be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.
The Vulkan spec states: Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice (https://vulkan.lunarg.com/doc/view/1.4. ... ices-01430)
I have modified the DynamicCubemap tutorial to exhibit this behavior and attached the source here. Make sure to overwrite the compositor file in Samples\Media\2.0\scripts\Compositors with the one from the archive.
In this case the rendering seems to continue just fine, while in my use case trying to get some dynamic cubemap from 2.1 to 3.0 the rendering seems borked (the compositor looks similar if not identical but I need to check further if something else isn't interfering). Still, I thought of getting rid of all validation errors.
The validation error happens on both AMD and nVidia.
EDIT: The rendering error on my side was because the cubemap used as SkyPostprocess was not exported correctly from Paint .NET. I forgot to check the "cubemap from crossed image" checkbox in the exporter. Also, I was passing the camera instead of the cubemap camera for the dynamic cubemap compositor. How was this working on 2.1... I don't know (it's the same buggy code)