zeux / niagara

A Vulkan renderer written from scratch on stream
MIT License
1.33k stars 75 forks source link

Image layouts are incorrect. #1

Closed ratchetfreak closed 6 years ago

ratchetfreak commented 6 years ago

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).

zeux commented 6 years ago

We were intentionally ignoring image layouts up until today.