I’ve been using Vulkan for about 7 months now and I’ve decided to start building a render graph. I was working on barrier generation when I realized I knew nothing about cross queue transfers and release/acquire barrier pairs. Most of what I know has been through AI, so forgive me if anything I say is flawed. I have a handful of questions regarding this matter that I would love help from a real person from though.
1: I noticed on this website this note:
VkSharingMode is ignored by the driver, so VK_SHARING_MODE_CONCURRENT incurs no overhead relative to VK_SHARING_MODE_EXCLUSIVE.
Is that really true? Can I still write relatively simple barriers for no cost?
2: If I have a release barrier at the end of a frame that should send a resource from Queue A to Queue B, but my render graph is recompiled and barriers are re-generated, can I treat the orphaned release barrier as if it never existed, or do I have to place an acquire on Queue B before I can do anything meaningful with the resource again?
3: I’m assuming the answer is yes, but is queue family ownership static? For example, if a resource is used on Queue B, I assume I can’t use it Queue A even if I want a couple frames.
Any help would be appreciated on all of these.
Are you writing solely for NVIDIA hardware? Because that’s NVIDIA’s website telling you about behavior specific to NVIDIA’s drivers.
What do you mean by that? I don’t think it’s reasonable to re-generate barriers that are already in use. Any recompilation and re-generation of Vulkan objects needs to happen at a time when it is safe to do so.
The whole point of queue family ownership transfers is that they’re not static. Ownership is under your control. A resource starts owned by one queue family, but you can transfer ownership to another.
1 Like
No, I am not.
Sorry, I should have been more clear. What I meant to say was this: If I place a release barrier for a resource and cease to use that resource for some time, when I want to use it again, do I have to place the acquire barrier on the corresponding queue family or can I pretend as if that release barrier never existed?
I already knew that, but I was curious if queue family index was something I needed to keep track of. For example, if I use a resource on Queue A and wait a couple frames, can I use it Queue B without any barrier, or does a queue family more literally own a resource? For this one, I’m pretty confident a release/acquire pair would always be needed, unless I were to use VK_SHARING_MODE_CONCURRENT.
Thank you for your help! I really appreciate it.
Barriers and ownership are not ephemeral; they don’t vanish after some arbitrary period of time. Ownership release and acquire operations need to be paired for ownership transfers to happen. It does not matter how much time there is between the two. The same goes for a resource being owned. The owning queue owns a resource until the transfer happens.
1 Like
In regards to the orphaned release barrier, would ownership actually be transferred? You said they have to go in pairs for a transfer, but what if I later decide I don’t want to transfer the resource that already placed a release barrier? Do I have to acquire it on the other queue and then transfer it right back?
Thank you for all your help.