In Vulkan, let's just say I transfer from the GPU to the host. Then I transfer from the host to the GPU and I want to set up a barrier so that the transfer from the host to the GPU completes first. So I set a barrier with src stage VK_PIPELINE_STAGE_TRANSFER_BIT. However my understanding is that this means that it will wait for ALL previous transfer commands, including those from the GPU to the host, which I don't want. How do I get more fine-grained control?
Pipeline barriers are scoped to a queue, and a queue ultimately represents a sequential "timeline" of command stream operations. It is not possible to reorder work around barriers of that work type within a single queue - the entire point of a pipeline barrier is to stop that happening!
If you have two independent workloads that you want to complete out of submit order then you would need to submit them to two different queues, which would give you two independent synchronization scopes for your pipeline barriers, and avoid the false dependencies.