Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.12k stars 513 forks source link

Physical_devices_and_queue_families code question #173

Closed mj-saunders closed 4 years ago

mj-saunders commented 4 years ago

Not so much an issue as a question.

Regarding this page: https://vulkan-tutorial.com/en/Drawing_a_triangle/Setup/Physical_devices_and_queue_families

Regarding the very last code block.

indices.isComplete() is used to check whether to break out of the for loop. Is this not an un-necessary check? Is it not simpler to simply break once indices.graphicsFamily = i is run?

Maybe I'm missing something...

Overv commented 4 years ago

In that chapter yes, but the check will be more extensive in the later chapters.