leander
leander

Reputation: 8727

Is there a Vulkan command equivalent to the synchronization guarantees from separate commandbuffers in the same queue submit?

I have a Vulkan backend for my renderer that uses multiple command buffers -- some for uploads, one per raster pass, one per compute pass, etc.

I'd like to take more advantage of Vulkan's SYNCHRONIZATION_VALIDATION extension. From the Current Feature Set section of the synchronization_usage docs:

Hazard detection for memory usage for commands within the same command buffer.

So I've changed my renderer and engine to allow me to (optionally, during debugging) emit all my commands into a single command buffer, in order, from a single thread. The hope is that I might enable the layer to detect more issues this way.

However, now I'm detecting issues that I believe are covered by "Implicit Synchronization Guarantees" or similar that I had when I had separate command buffers.

Is there any command (e.g. a specific vkCmdPipelineBarrier or vkCmdPipelineBarrier2KHR) or synchronization primitive that either exactly matches the execution/memory/visibility guarantees that I'd naturally get from separate commandbuffers within a single queue submission, or only slightly exceeds them? Something I could add where previously I had vkEndCommandBuffer and vkBeginCommandBuffer?

Or, more generally, are there better strategies for improving SYNCHRONIZATION_VALIDATION's ability to see issues?

Upvotes: 1

Views: 90

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473352

To my knowledge, there is no special synchronization behavior given to the boundaries of command buffers specifically. Submit commands get some special boundary treatment (mostly pertaining to host memory operations), and batches within submit commands might have some implicit synchronization relative to other batches.

But I don't know of any form of implicit synchronization that happens between CBs within the same batch.

Upvotes: 2

Related Questions