| 357 | } |
| 358 | |
| 359 | std::optional<uint32_t> Device::QueueFamily(VkQueueFlags with, VkQueueFlags without) const { |
| 360 | for (uint32_t i = 0; i < physical_device_.queue_properties_.size(); i++) { |
| 361 | if (physical_device_.queue_properties_[i].queueCount > 0) { |
| 362 | const auto flags = physical_device_.queue_properties_[i].queueFlags; |
| 363 | const bool matches = (flags & with) == with; |
| 364 | if (matches && ((flags & without) == 0)) { |
| 365 | return i; |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | return {}; |
| 370 | } |
| 371 | |
| 372 | std::optional<uint32_t> Device::QueueFamilyWithoutCapabilities(VkQueueFlags without) const { |
| 373 | for (uint32_t i = 0; i < physical_device_.queue_properties_.size(); i++) { |