OutOfOrderRasterization icon indicating copy to clipboard operation
OutOfOrderRasterization copied to clipboard

It's not allowed to transition swapchain images without first acquiring them

Open ratchetfreak opened this issue 10 years ago • 3 comments

https://github.com/GPUOpen-LibrariesAndSDKs/OutOfOrderRasterization/blob/master/Anvil/src/wrappers/swapchain.cpp#L325

Here you setup a resource transition for each image in the swapchain which you run during initialize without acquiring them. This is not allowed.

https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#_wsi_swapchain

Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR, and before it is presented by vkQueuePresentKHR. This includes transitioning the image layout and rendering commands.

Instead you can set the initialLayout of the renderpass attachment to VK_IMAGE_LAYOUT_UNDEFINED. Implying that you don't care about the existing data (which is made explicit by the load_op_clear).

For more info see http://stackoverflow.com/q/37524032/731620

ratchetfreak avatar Jun 15 '16 15:06 ratchetfreak

Thanks! Yeah, well spotted. Will patch this for the next Anvil release :-)

DominikWitczakAMD avatar Jun 15 '16 15:06 DominikWitczakAMD

Whenever I see a vulkan example this is the first thing I look for, I have yet to see an example that didn't make this mistake (copied from the lunarg examples) initially.

ratchetfreak avatar Jun 15 '16 15:06 ratchetfreak

Should be fixed now.

DominikWitczakAMD avatar Jul 14 '16 09:07 DominikWitczakAMD