List of which commands use which VK_PIPELINE_STAGE sync points

I’m new with Vulkan and have some questions:

Can someone tell me if there is a condensed list of which Vulkan commands offer which synchronisation points defined in VK_PIPELINE_STAGE enum? I assume that for example draw commands offer stuff like FRAGMENT_SHADER_BIT or VERTEX_SHADER_BIT but copy commands for example shouldn’t need these but other stuff right?


I don’t think anyone has compiled a list, but do you really need one? It’s usually pretty obvious which commands use which stages. And if you’re doing synchronization, you generally have some idea what the source and destination of those operations are.

Well it requires you to know which internal steps each command has and guess to which bits that maps and I find that cumbersome.

Do I understand right that the VK_PIPELINE_STAGE bits are basically global queues that all commands share? And that triggers a semaphore once all work before the command that queries the semaphore is finished?

Btw do I understand right that copy commands only have one stage which is equivalent to VK_PIPELINE_STAGE_TRANSFER_BIT ?

What exactly requires that? What are you doing that requires you to “guess” what stages an action command will use?

Here’s what I mean. Let’s say that you want to upload some data into a buffer, then read from that buffer in a compute shader operation. By merely saying what you’re doing, you’ve already stated which stages you need to use in your synchronization for this operation. No “guessing” is involved.

That is, I don’t need to read the details of the dispatch command to know that I want to make memory visible to the compute shader stage.

As far as I understand one command maps to multiple stages. However, all possible stages are all packed in the same enum so I dont’t know which command maps to which set of stages. My assumption is that there are some nice diagrams somewhere that show the pipeline for each command whose stages I can easily map to the synchronization bits but I didn’t find that yet.

You’re not answering my question: why do you need to know? What are you doing where the answer as to which stage to use is not obvious?

The only thing I can come up with as to how this information might be useful is if you are writing some Vulkan code, and you want to shove a stage bitmask into a Vulkan data structure, and you need to know which one to use. And my point is that the bitmask you use should not be based on the commands per-se, but based on the operations you are doing.

If you’re synchronizing between a transfer and a compute shader, then you synchronize between the transfer stage and the compute stage. If you’re synchronizing between a vertex shader and a vertex reading operation (transform feedback), then you use those stages in your pipeline barrier. You don’t use them because a specific command says that these are the stages that it involves, but because those stages are the stages where the operations you’re synchronizing take place.

Nevermind, I think this is what I want:

Ok, next question:

Is the layout used in vkCmdBindDescriptorSets always the same as the one used for the creation of the pipeline the command buffers are bound to using vkCmdBindPipeline?

This is a completely different issue, so you shouldn’t add it to an unrelated thread. And the specification has rules for pipeline layout compatibility.

" Layout compatibility means that descriptor sets can be bound to a command buffer for use by any pipeline created with a compatible pipeline layout, and without having bound a particular pipeline first."

Sounds like a confirmation, right?

Ok, I shall finish here afterwards.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.