diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-04-07 19:17:08 +1000 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-04-07 19:17:08 +1000 |
| commit | 69764a869d99e9abd0fbe10c2773d3556d7f35e8 (patch) | |
| tree | 0d0037f447b1f85e00d09ce87391ea2c17291a26 /src/physical_device_context.cc | |
| parent | 9d6a2beb98085c0ebbddbbb311a5a3a93b4ec202 (diff) | |
Check for Vulkan 1.1 via not null GetPhysicalDeviceQueueFamilyProperties2KHR
Diffstat (limited to 'src/physical_device_context.cc')
| -rw-r--r-- | src/physical_device_context.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/physical_device_context.cc b/src/physical_device_context.cc index 7a57759..78d3d9c 100644 --- a/src/physical_device_context.cc +++ b/src/physical_device_context.cc @@ -22,17 +22,24 @@ PhysicalDeviceContext::PhysicalDeviceContext( return std::make_unique<VkPhysicalDeviceProperties>(std::move(props)); }(); + // Check if we support Vulkan 1.1 by checking if this function exists. If we + // don't, the layer cannot work, so we set 'supports required extensions' to + // false and bail. + if (!vtable.GetPhysicalDeviceQueueFamilyProperties2KHR) { + this->supports_required_extensions = false; + return; + } + this->queue_properties = [&]() { auto count = std::uint32_t{}; - vtable.GetPhysicalDeviceQueueFamilyProperties2KHR(physical_device, &count, - nullptr); + vtable.GetPhysicalDeviceQueueFamilyProperties2KHR(physical_device, + &count, nullptr); auto result = std::vector<VkQueueFamilyProperties2>( count, VkQueueFamilyProperties2{ .sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2}); - vtable.GetPhysicalDeviceQueueFamilyProperties2KHR(physical_device, &count, - std::data(result)); - + vtable.GetPhysicalDeviceQueueFamilyProperties2KHR( + physical_device, &count, std::data(result)); return std::make_unique<std::vector<VkQueueFamilyProperties2>>( std::move(result)); }(); |
