Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

Rework get_queue_by_flags function so it can select a dedicated transfer queue if requested

Open asuessenbach opened this issue 2 years ago • 1 comments

Currently, when you ask for a transfer queue, for example, you would get the first queue that supports transfer, which probably is the same as you get when asking for graphics support. When a dedicated transfer queue can be requested and is used (in the gltfLoader, for example), ownership of uploaded data needs to be handled properly. And a separate CommandPool would be needed for the CommandBuffer submitted to that queue.

asuessenbach avatar Jul 19 '23 10:07 asuessenbach

Extending the functionality of get_queue_by_flags to optionally return a queue that supports all the required flags but as few additional flags as possible is simple. Just a few lines of additional code. But using that correctly would need substantial changes, both in the framework and in some samples:

  • The Device would need to hold a CommandPool per queue family index, instead of just one;
  • CommandBuffer creation would require the queue family index;
  • Some functions would require a Queue, instead of a VkQueue, to have the queue family index available;

And probably more, I stopped investigating here. Considering that complexity of changes, should we go that route (I'd say: yes!) or just close this issue as "will not fix"?

Note: I say "fix", as it's currently working by accident: we programmatically determine some queue family to use at various places, but assume the very same one is used everywhere.

asuessenbach avatar Sep 06 '23 08:09 asuessenbach