You don't transition the image layouts between acquiring, rendering and presenting.
You can fix that by setting the initialLayout and finalLayout in createRenderPass to UNDEFINED and PRESENT resp.
swapchain images start UNDEFINED then must be transitioned to COLOR_ATTACHMENT when you want to render to it and then to PRESENT when you present to the surface.
You can always transition the layout away from UNDEFINED if you don't care about the data inside it (which you don't at the start of the renderpass because you clear).
You don't transition the image layouts between acquiring, rendering and presenting.
You can fix that by setting the
initialLayout
andfinalLayout
increateRenderPass
toUNDEFINED
andPRESENT
resp.swapchain images start
UNDEFINED
then must be transitioned toCOLOR_ATTACHMENT
when you want to render to it and then toPRESENT
when you present to the surface.You can always transition the layout away from
UNDEFINED
if you don't care about the data inside it (which you don't at the start of the renderpass because you clear).