diff options
| author | Ash Hopkins <ashleighhopkins87@gmail.com> | 2026-11-22 14:21:37 +0000 |
|---|---|---|
| committer | Ash Hopkins <ashleighhopkins87@gmail.com> | 2026-11-22 14:21:37 +0000 |
| commit | eebf85b60f021ce567427ce766f4ec1c88b0f13a (patch) | |
| tree | f8ee32c3f47c57a6beae5705b35c97cd69b44afe /runtime/src/vulkan13_features.h | |
| parent | 19b261bb99735ceb33dd2daaefe31ac9ef9ed26a (diff) | |
| parent | 003e78129303643a3fdc9e5f0e31a01b09759236 (diff) | |
Merge remote-tracking branch 'origin/main' into runtime-vulkan12-khr
# Conflicts:
# runtime/shims/d3d12_vulkan_device.cpp
# runtime/test/vk_test_device.h
Diffstat (limited to 'runtime/src/vulkan13_features.h')
| -rw-r--r-- | runtime/src/vulkan13_features.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/src/vulkan13_features.h b/runtime/src/vulkan13_features.h index 111d81df3..2057d953b 100644 --- a/runtime/src/vulkan13_features.h +++ b/runtime/src/vulkan13_features.h | |||
| @@ -31,6 +31,9 @@ public: | |||
| 31 | bool core = false; // a Vulkan 1.3 device: the features are core | 31 | bool core = false; // a Vulkan 1.3 device: the features are core |
| 32 | bool dynamic_rendering = false; // supported, as a core feature or through VK_KHR_dynamic_rendering | 32 | bool dynamic_rendering = false; // supported, as a core feature or through VK_KHR_dynamic_rendering |
| 33 | bool synchronization2 = false; // supported, as a core feature or through VK_KHR_synchronization2 | 33 | bool synchronization2 = false; // supported, as a core feature or through VK_KHR_synchronization2 |
| 34 | // Optional 1.3 core features, enabled where supported; on a 1.2 device they stay off (no required subgroup size). | ||
| 35 | bool subgroup_size_control = false; | ||
| 36 | bool compute_full_subgroups = false; | ||
| 34 | 37 | ||
| 35 | bool usable() const { return dynamic_rendering && synchronization2; } | 38 | bool usable() const { return dynamic_rendering && synchronization2; } |
| 36 | 39 | ||
| @@ -38,7 +41,7 @@ public: | |||
| 38 | void query(VkPhysicalDevice physical, std::uint32_t api_version, PFN_vkGetPhysicalDeviceFeatures2 features2, | 41 | void query(VkPhysicalDevice physical, std::uint32_t api_version, PFN_vkGetPhysicalDeviceFeatures2 features2, |
| 39 | PFN_vkEnumerateDeviceExtensionProperties enumerate_extensions) { | 42 | PFN_vkEnumerateDeviceExtensionProperties enumerate_extensions) { |
| 40 | core = api_version >= VK_API_VERSION_1_3; | 43 | core = api_version >= VK_API_VERSION_1_3; |
| 41 | dynamic_rendering = synchronization2 = false; | 44 | dynamic_rendering = synchronization2 = subgroup_size_control = compute_full_subgroups = false; |
| 42 | if (!features2) return; | 45 | if (!features2) return; |
| 43 | if (core) { | 46 | if (core) { |
| 44 | VkPhysicalDeviceVulkan13Features f13{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES}; | 47 | VkPhysicalDeviceVulkan13Features f13{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES}; |
| @@ -46,6 +49,8 @@ public: | |||
| 46 | features2(physical, &query); | 49 | features2(physical, &query); |
| 47 | dynamic_rendering = f13.dynamicRendering == VK_TRUE; | 50 | dynamic_rendering = f13.dynamicRendering == VK_TRUE; |
| 48 | synchronization2 = f13.synchronization2 == VK_TRUE; | 51 | synchronization2 = f13.synchronization2 == VK_TRUE; |
| 52 | subgroup_size_control = f13.subgroupSizeControl == VK_TRUE; | ||
| 53 | compute_full_subgroups = f13.computeFullSubgroups == VK_TRUE; | ||
| 49 | return; | 54 | return; |
| 50 | } | 55 | } |
| 51 | if (api_version < VK_API_VERSION_1_2 || !enumerate_extensions) return; | 56 | if (api_version < VK_API_VERSION_1_2 || !enumerate_extensions) return; |
| @@ -73,6 +78,8 @@ public: | |||
| 73 | core = from.core; | 78 | core = from.core; |
| 74 | dynamic_rendering = from.dynamic_rendering; | 79 | dynamic_rendering = from.dynamic_rendering; |
| 75 | synchronization2 = from.synchronization2; | 80 | synchronization2 = from.synchronization2; |
| 81 | subgroup_size_control = from.subgroup_size_control; | ||
| 82 | compute_full_subgroups = from.compute_full_subgroups; | ||
| 76 | } | 83 | } |
| 77 | 84 | ||
| 78 | // The structs that enable both features, ahead of `chain`; returns their head for VkPhysicalDeviceVulkan12Features' | 85 | // The structs that enable both features, ahead of `chain`; returns their head for VkPhysicalDeviceVulkan12Features' |
| @@ -82,6 +89,8 @@ public: | |||
| 82 | enable13_.pNext = chain; | 89 | enable13_.pNext = chain; |
| 83 | enable13_.dynamicRendering = VK_TRUE; | 90 | enable13_.dynamicRendering = VK_TRUE; |
| 84 | enable13_.synchronization2 = VK_TRUE; | 91 | enable13_.synchronization2 = VK_TRUE; |
| 92 | enable13_.subgroupSizeControl = subgroup_size_control ? VK_TRUE : VK_FALSE; | ||
| 93 | enable13_.computeFullSubgroups = compute_full_subgroups ? VK_TRUE : VK_FALSE; | ||
| 85 | return &enable13_; | 94 | return &enable13_; |
| 86 | } | 95 | } |
| 87 | sync2_.pNext = chain; | 96 | sync2_.pNext = chain; |