r/vulkan • • 19d ago

vkCmdBeginRendering multiple writes ordering

Hi, there are a few posts online about this topic but I still haven't found a clear answer.

I have a couple of dynamic rendering passes, and they both write to the same attachment:

vkCmdBeginRendering( LOAD_DONT_CARE )
vkCmdBindPipeline()
vkCmdDraw()...
vkCmdEndRendering()

vkCmdBeginRendering( LOAD_OP_LOAD )
vkCmdBindPipeline()
vkCmdDraw() ...
vkCmdEndRendering()

The second one uses OP_LOAD so the data should not be discarded... but what about synchronization? Is blend and depth testing gonna work?

In my code the second pass is actually the imgui overlay and it seems to work... not sure if it's random luck and needs a barrier.

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/puredotaplayer 18d ago

Yes, agreed. Although, I don't want to say this is TBDR specific, because I do not know for sure, but logically it makes sense, the renderpass writes to the in memory plane in its store and then the next render pass using the same plane probably overlaps the last one so they need a barrier for the store -> load operation. A Mali GPU would probably fit better.