I have the Vulkan part of my application based on the official Vulkan tutorial. It perfectly displays 3D objects and camera movements.
I tried to image copy by doing my best to transcribe as best as possible the example of Sacha Willems, the saveScreenshot () function of the source screenshot.cpp. I use LWJGL as my code is in java, on MacOs and Vulkan version 18.104.22.168.
Before transcribing the whole function, I wanted to test the absence of error. What is implemented is:
- Recovery of the source image from the swapchain.
- Creation of the destination image.
- Memory allocation of the destination image.
- Creation and start of the command buffer.
- insertion of ImageMemoryBarrier before invoking the copy.
- Invoking the copy (vkCmdCopyImage).
- insertion of ImageMemoryBarrier after the invocation of the copy.
- End and submit the buffer command.
At runtime, the application freezes when called vkQueueSubmit () and no error is reported since the extension of debug Vulkan.
If the call to vkCmdCopyImage () is commented out, the copy is obviously not made but the application no longer hangs and still no Vulkan error is reported.
I checked each part of code several times and since Vulkan does not report any anomalies, I do not know where to look for a solution.
I wonder if the problem would not come from the source image of the swapchain but I do not see how I could verify this.
Thanks for your help.