Rework get_queue_by_flags function so it can select a dedicated transfer queue if requested
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.
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
Devicewould need to hold aCommandPoolper queue family index, instead of just one; CommandBuffercreation would require the queue family index;- Some functions would require a
Queue, instead of aVkQueue, 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.