Closed IAmNotHanni closed 1 year ago
Would like to get a short overview what the difference to this https://github.com/inexorgame/vulkan-renderer/pull/489 is.
@IceflowRE This pull request refactors the code which finds the queues we need to create the device. Pull request https://github.com/inexorgame/vulkan-renderer/pull/489 deals with finding the most suitable graphics card (or more general: physical device).
The problem
We are in the process of getting rid of
SettingsDecisionMaker
entirely. When it comes to finding the right queue family indices, the old code contained several functions like this:That's a lot of code considering how little it does. Even worse, there was a lot of duplicate code like this!
The solution
All we need is:
I also implemented
get_all_physical_device_queue_family_properties
andis_presentation_supported
. Now we can easily search for queue family indices as we like. All we need is to give a lambda to filter out the unsuitable queue family indices.Examples
Need one which supports graphics and presentation?
Need one which supports only transfer but no graphics?
Closing remarks
Btw if we merge https://github.com/inexorgame/vulkan-renderer/pull/498 before this, we can get rid of
SettingsDecisionMaker
entirely! :) (we could also merge them in the other order and get remove it as well..)Links
Vulkan spec chapter 5: Devices and Queues Stackoverflow question: What is actually a Queue family in Vulkan? Vulkan tutorial: Physical devices and queue families