PacktPublishing / Vulkan-Cookbook

Code repository for Vulkan Cookbook by Packt
MIT License
816 stars 109 forks source link

Fix condition checking if a queue has the desired capabilities #6

Closed cyouden closed 6 years ago

cyouden commented 6 years ago

Not sure if you accept PRs on this, but I noticed a minor bug while working through the book: the existing condition will evaluate to true if one or more of the desired flags is set on the queue, this change will ensure all desired flags are set.

For example, if you ask for VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT, a queue with only one of those set would (incorrectly) pass the check.

Ekzuzy commented 6 years ago

There is a very similar condition when we look for a memory type index to allocate a memory object from for images or buffers. And the same approach applies here. Thanks for this fix!