1 // This file is auto-generated by vulkano autogen from vk.xml header version 1.3.238. 2 // It should not be edited manually. Changes should be made by editing autogen. 3 4 #[doc = r" List of extensions that are enabled or available."] 5 #[derive(Copy, Clone, PartialEq, Eq)] 6 pub struct InstanceExtensions { 7 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_android_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 8 pub khr_android_surface: bool, 9 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_device_group_creation.html)\n- Promoted to Vulkan 1.1"] 10 pub khr_device_group_creation: bool, 11 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_display.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 12 pub khr_display: bool, 13 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_capabilities.html)\n- Promoted to Vulkan 1.1\n- Requires:\n - One of: Vulkan API version 1.1, instance extension [`khr_get_physical_device_properties2`](crate::instance::InstanceExtensions::khr_get_physical_device_properties2)"] 14 pub khr_external_fence_capabilities: bool, 15 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory_capabilities.html)\n- Promoted to Vulkan 1.1\n- Requires:\n - One of: Vulkan API version 1.1, instance extension [`khr_get_physical_device_properties2`](crate::instance::InstanceExtensions::khr_get_physical_device_properties2)"] 16 pub khr_external_memory_capabilities: bool, 17 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_capabilities.html)\n- Promoted to Vulkan 1.1\n- Requires:\n - One of: Vulkan API version 1.1, instance extension [`khr_get_physical_device_properties2`](crate::instance::InstanceExtensions::khr_get_physical_device_properties2)"] 18 pub khr_external_semaphore_capabilities: bool, 19 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_display_properties2.html)\n- Requires:\n - instance extension [`khr_display`](crate::instance::InstanceExtensions::khr_display)"] 20 pub khr_get_display_properties2: bool, 21 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_physical_device_properties2.html)\n- Promoted to Vulkan 1.1"] 22 pub khr_get_physical_device_properties2: bool, 23 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_surface_capabilities2.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 24 pub khr_get_surface_capabilities2: bool, 25 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_portability_enumeration.html)"] 26 pub khr_portability_enumeration: bool, 27 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html)"] 28 pub khr_surface: bool, 29 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface_protected_capabilities.html)\n- Requires:\n - Vulkan API version 1.1\n - instance extension [`khr_get_surface_capabilities2`](crate::instance::InstanceExtensions::khr_get_surface_capabilities2)"] 30 pub khr_surface_protected_capabilities: bool, 31 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_wayland_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 32 pub khr_wayland_surface: bool, 33 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_win32_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 34 pub khr_win32_surface: bool, 35 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_xcb_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 36 pub khr_xcb_surface: bool, 37 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_xlib_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 38 pub khr_xlib_surface: bool, 39 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_acquire_drm_display.html)\n- Requires:\n - instance extension [`ext_direct_mode_display`](crate::instance::InstanceExtensions::ext_direct_mode_display)"] 40 pub ext_acquire_drm_display: bool, 41 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_acquire_xlib_display.html)\n- Requires:\n - instance extension [`ext_direct_mode_display`](crate::instance::InstanceExtensions::ext_direct_mode_display)"] 42 pub ext_acquire_xlib_display: bool, 43 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_report.html)\n- Deprecated by [`ext_debug_utils`](crate::instance::InstanceExtensions::ext_debug_utils)"] 44 pub ext_debug_report: bool, 45 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_utils.html)"] 46 pub ext_debug_utils: bool, 47 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_direct_mode_display.html)\n- Requires:\n - instance extension [`khr_display`](crate::instance::InstanceExtensions::khr_display)"] 48 pub ext_direct_mode_display: bool, 49 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_directfb_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 50 pub ext_directfb_surface: bool, 51 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_display_surface_counter.html)\n- Requires:\n - instance extension [`khr_display`](crate::instance::InstanceExtensions::khr_display)"] 52 pub ext_display_surface_counter: bool, 53 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_headless_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 54 pub ext_headless_surface: bool, 55 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_metal_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 56 pub ext_metal_surface: bool, 57 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_surface_maintenance1.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)\n - instance extension [`khr_get_surface_capabilities2`](crate::instance::InstanceExtensions::khr_get_surface_capabilities2)"] 58 pub ext_surface_maintenance1: bool, 59 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_swapchain_colorspace.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 60 pub ext_swapchain_colorspace: bool, 61 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_validation_features.html)"] 62 pub ext_validation_features: bool, 63 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_validation_flags.html)\n- Deprecated by [`ext_validation_features`](crate::instance::InstanceExtensions::ext_validation_features)"] 64 pub ext_validation_flags: bool, 65 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_FUCHSIA_imagepipe_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 66 pub fuchsia_imagepipe_surface: bool, 67 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_GGP_stream_descriptor_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 68 pub ggp_stream_descriptor_surface: bool, 69 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_GOOGLE_surfaceless_query.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 70 pub google_surfaceless_query: bool, 71 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_LUNARG_direct_driver_loading.html)"] 72 pub lunarg_direct_driver_loading: bool, 73 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_MVK_ios_surface.html)\n- Deprecated by [`ext_metal_surface`](crate::instance::InstanceExtensions::ext_metal_surface)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 74 pub mvk_ios_surface: bool, 75 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_MVK_macos_surface.html)\n- Deprecated by [`ext_metal_surface`](crate::instance::InstanceExtensions::ext_metal_surface)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 76 pub mvk_macos_surface: bool, 77 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NN_vi_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 78 pub nn_vi_surface: bool, 79 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_external_memory_capabilities.html)\n- Deprecated by [`khr_external_memory_capabilities`](crate::instance::InstanceExtensions::khr_external_memory_capabilities)"] 80 pub nv_external_memory_capabilities: bool, 81 #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_QNX_screen_surface.html)\n- Requires:\n - instance extension [`khr_surface`](crate::instance::InstanceExtensions::khr_surface)"] 82 pub qnx_screen_surface: bool, 83 pub _ne: crate::NonExhaustive, 84 } 85 impl Default for InstanceExtensions { 86 #[inline] default() -> Self87 fn default() -> Self { 88 Self::empty() 89 } 90 } 91 impl InstanceExtensions { 92 #[doc = r" Returns an `Extensions` object with none of the members set."] 93 #[inline] empty() -> Self94 pub const fn empty() -> Self { 95 Self { 96 khr_android_surface: false, 97 khr_device_group_creation: false, 98 khr_display: false, 99 khr_external_fence_capabilities: false, 100 khr_external_memory_capabilities: false, 101 khr_external_semaphore_capabilities: false, 102 khr_get_display_properties2: false, 103 khr_get_physical_device_properties2: false, 104 khr_get_surface_capabilities2: false, 105 khr_portability_enumeration: false, 106 khr_surface: false, 107 khr_surface_protected_capabilities: false, 108 khr_wayland_surface: false, 109 khr_win32_surface: false, 110 khr_xcb_surface: false, 111 khr_xlib_surface: false, 112 ext_acquire_drm_display: false, 113 ext_acquire_xlib_display: false, 114 ext_debug_report: false, 115 ext_debug_utils: false, 116 ext_direct_mode_display: false, 117 ext_directfb_surface: false, 118 ext_display_surface_counter: false, 119 ext_headless_surface: false, 120 ext_metal_surface: false, 121 ext_surface_maintenance1: false, 122 ext_swapchain_colorspace: false, 123 ext_validation_features: false, 124 ext_validation_flags: false, 125 fuchsia_imagepipe_surface: false, 126 ggp_stream_descriptor_surface: false, 127 google_surfaceless_query: false, 128 lunarg_direct_driver_loading: false, 129 mvk_ios_surface: false, 130 mvk_macos_surface: false, 131 nn_vi_surface: false, 132 nv_external_memory_capabilities: false, 133 qnx_screen_surface: false, 134 _ne: crate::NonExhaustive(()), 135 } 136 } 137 #[doc = r" Returns an `Extensions` object with none of the members set."] 138 #[deprecated(since = "0.31.0", note = "Use `empty` instead.")] 139 #[inline] none() -> Self140 pub const fn none() -> Self { 141 Self::empty() 142 } 143 #[doc = r" Returns whether any members are set in both `self` and `other`."] 144 #[inline] intersects(&self, other: &Self) -> bool145 pub const fn intersects(&self, other: &Self) -> bool { 146 (self.khr_android_surface && other.khr_android_surface) 147 || (self.khr_device_group_creation && other.khr_device_group_creation) 148 || (self.khr_display && other.khr_display) 149 || (self.khr_external_fence_capabilities && other.khr_external_fence_capabilities) 150 || (self.khr_external_memory_capabilities && other.khr_external_memory_capabilities) 151 || (self.khr_external_semaphore_capabilities 152 && other.khr_external_semaphore_capabilities) 153 || (self.khr_get_display_properties2 && other.khr_get_display_properties2) 154 || (self.khr_get_physical_device_properties2 155 && other.khr_get_physical_device_properties2) 156 || (self.khr_get_surface_capabilities2 && other.khr_get_surface_capabilities2) 157 || (self.khr_portability_enumeration && other.khr_portability_enumeration) 158 || (self.khr_surface && other.khr_surface) 159 || (self.khr_surface_protected_capabilities && other.khr_surface_protected_capabilities) 160 || (self.khr_wayland_surface && other.khr_wayland_surface) 161 || (self.khr_win32_surface && other.khr_win32_surface) 162 || (self.khr_xcb_surface && other.khr_xcb_surface) 163 || (self.khr_xlib_surface && other.khr_xlib_surface) 164 || (self.ext_acquire_drm_display && other.ext_acquire_drm_display) 165 || (self.ext_acquire_xlib_display && other.ext_acquire_xlib_display) 166 || (self.ext_debug_report && other.ext_debug_report) 167 || (self.ext_debug_utils && other.ext_debug_utils) 168 || (self.ext_direct_mode_display && other.ext_direct_mode_display) 169 || (self.ext_directfb_surface && other.ext_directfb_surface) 170 || (self.ext_display_surface_counter && other.ext_display_surface_counter) 171 || (self.ext_headless_surface && other.ext_headless_surface) 172 || (self.ext_metal_surface && other.ext_metal_surface) 173 || (self.ext_surface_maintenance1 && other.ext_surface_maintenance1) 174 || (self.ext_swapchain_colorspace && other.ext_swapchain_colorspace) 175 || (self.ext_validation_features && other.ext_validation_features) 176 || (self.ext_validation_flags && other.ext_validation_flags) 177 || (self.fuchsia_imagepipe_surface && other.fuchsia_imagepipe_surface) 178 || (self.ggp_stream_descriptor_surface && other.ggp_stream_descriptor_surface) 179 || (self.google_surfaceless_query && other.google_surfaceless_query) 180 || (self.lunarg_direct_driver_loading && other.lunarg_direct_driver_loading) 181 || (self.mvk_ios_surface && other.mvk_ios_surface) 182 || (self.mvk_macos_surface && other.mvk_macos_surface) 183 || (self.nn_vi_surface && other.nn_vi_surface) 184 || (self.nv_external_memory_capabilities && other.nv_external_memory_capabilities) 185 || (self.qnx_screen_surface && other.qnx_screen_surface) 186 } 187 #[doc = r" Returns whether all members in `other` are set in `self`."] 188 #[inline] contains(&self, other: &Self) -> bool189 pub const fn contains(&self, other: &Self) -> bool { 190 (self.khr_android_surface || !other.khr_android_surface) 191 && (self.khr_device_group_creation || !other.khr_device_group_creation) 192 && (self.khr_display || !other.khr_display) 193 && (self.khr_external_fence_capabilities || !other.khr_external_fence_capabilities) 194 && (self.khr_external_memory_capabilities || !other.khr_external_memory_capabilities) 195 && (self.khr_external_semaphore_capabilities 196 || !other.khr_external_semaphore_capabilities) 197 && (self.khr_get_display_properties2 || !other.khr_get_display_properties2) 198 && (self.khr_get_physical_device_properties2 199 || !other.khr_get_physical_device_properties2) 200 && (self.khr_get_surface_capabilities2 || !other.khr_get_surface_capabilities2) 201 && (self.khr_portability_enumeration || !other.khr_portability_enumeration) 202 && (self.khr_surface || !other.khr_surface) 203 && (self.khr_surface_protected_capabilities 204 || !other.khr_surface_protected_capabilities) 205 && (self.khr_wayland_surface || !other.khr_wayland_surface) 206 && (self.khr_win32_surface || !other.khr_win32_surface) 207 && (self.khr_xcb_surface || !other.khr_xcb_surface) 208 && (self.khr_xlib_surface || !other.khr_xlib_surface) 209 && (self.ext_acquire_drm_display || !other.ext_acquire_drm_display) 210 && (self.ext_acquire_xlib_display || !other.ext_acquire_xlib_display) 211 && (self.ext_debug_report || !other.ext_debug_report) 212 && (self.ext_debug_utils || !other.ext_debug_utils) 213 && (self.ext_direct_mode_display || !other.ext_direct_mode_display) 214 && (self.ext_directfb_surface || !other.ext_directfb_surface) 215 && (self.ext_display_surface_counter || !other.ext_display_surface_counter) 216 && (self.ext_headless_surface || !other.ext_headless_surface) 217 && (self.ext_metal_surface || !other.ext_metal_surface) 218 && (self.ext_surface_maintenance1 || !other.ext_surface_maintenance1) 219 && (self.ext_swapchain_colorspace || !other.ext_swapchain_colorspace) 220 && (self.ext_validation_features || !other.ext_validation_features) 221 && (self.ext_validation_flags || !other.ext_validation_flags) 222 && (self.fuchsia_imagepipe_surface || !other.fuchsia_imagepipe_surface) 223 && (self.ggp_stream_descriptor_surface || !other.ggp_stream_descriptor_surface) 224 && (self.google_surfaceless_query || !other.google_surfaceless_query) 225 && (self.lunarg_direct_driver_loading || !other.lunarg_direct_driver_loading) 226 && (self.mvk_ios_surface || !other.mvk_ios_surface) 227 && (self.mvk_macos_surface || !other.mvk_macos_surface) 228 && (self.nn_vi_surface || !other.nn_vi_surface) 229 && (self.nv_external_memory_capabilities || !other.nv_external_memory_capabilities) 230 && (self.qnx_screen_surface || !other.qnx_screen_surface) 231 } 232 #[doc = r" Returns whether all members in `other` are set in `self`."] 233 #[deprecated(since = "0.31.0", note = "Use `contains` instead.")] 234 #[inline] is_superset_of(&self, other: &Self) -> bool235 pub const fn is_superset_of(&self, other: &Self) -> bool { 236 self.contains(other) 237 } 238 #[doc = r" Returns the union of `self` and `other`."] 239 #[inline] union(&self, other: &Self) -> Self240 pub const fn union(&self, other: &Self) -> Self { 241 Self { 242 khr_android_surface: self.khr_android_surface || other.khr_android_surface, 243 khr_device_group_creation: self.khr_device_group_creation 244 || other.khr_device_group_creation, 245 khr_display: self.khr_display || other.khr_display, 246 khr_external_fence_capabilities: self.khr_external_fence_capabilities 247 || other.khr_external_fence_capabilities, 248 khr_external_memory_capabilities: self.khr_external_memory_capabilities 249 || other.khr_external_memory_capabilities, 250 khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities 251 || other.khr_external_semaphore_capabilities, 252 khr_get_display_properties2: self.khr_get_display_properties2 253 || other.khr_get_display_properties2, 254 khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 255 || other.khr_get_physical_device_properties2, 256 khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 257 || other.khr_get_surface_capabilities2, 258 khr_portability_enumeration: self.khr_portability_enumeration 259 || other.khr_portability_enumeration, 260 khr_surface: self.khr_surface || other.khr_surface, 261 khr_surface_protected_capabilities: self.khr_surface_protected_capabilities 262 || other.khr_surface_protected_capabilities, 263 khr_wayland_surface: self.khr_wayland_surface || other.khr_wayland_surface, 264 khr_win32_surface: self.khr_win32_surface || other.khr_win32_surface, 265 khr_xcb_surface: self.khr_xcb_surface || other.khr_xcb_surface, 266 khr_xlib_surface: self.khr_xlib_surface || other.khr_xlib_surface, 267 ext_acquire_drm_display: self.ext_acquire_drm_display || other.ext_acquire_drm_display, 268 ext_acquire_xlib_display: self.ext_acquire_xlib_display 269 || other.ext_acquire_xlib_display, 270 ext_debug_report: self.ext_debug_report || other.ext_debug_report, 271 ext_debug_utils: self.ext_debug_utils || other.ext_debug_utils, 272 ext_direct_mode_display: self.ext_direct_mode_display || other.ext_direct_mode_display, 273 ext_directfb_surface: self.ext_directfb_surface || other.ext_directfb_surface, 274 ext_display_surface_counter: self.ext_display_surface_counter 275 || other.ext_display_surface_counter, 276 ext_headless_surface: self.ext_headless_surface || other.ext_headless_surface, 277 ext_metal_surface: self.ext_metal_surface || other.ext_metal_surface, 278 ext_surface_maintenance1: self.ext_surface_maintenance1 279 || other.ext_surface_maintenance1, 280 ext_swapchain_colorspace: self.ext_swapchain_colorspace 281 || other.ext_swapchain_colorspace, 282 ext_validation_features: self.ext_validation_features || other.ext_validation_features, 283 ext_validation_flags: self.ext_validation_flags || other.ext_validation_flags, 284 fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface 285 || other.fuchsia_imagepipe_surface, 286 ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface 287 || other.ggp_stream_descriptor_surface, 288 google_surfaceless_query: self.google_surfaceless_query 289 || other.google_surfaceless_query, 290 lunarg_direct_driver_loading: self.lunarg_direct_driver_loading 291 || other.lunarg_direct_driver_loading, 292 mvk_ios_surface: self.mvk_ios_surface || other.mvk_ios_surface, 293 mvk_macos_surface: self.mvk_macos_surface || other.mvk_macos_surface, 294 nn_vi_surface: self.nn_vi_surface || other.nn_vi_surface, 295 nv_external_memory_capabilities: self.nv_external_memory_capabilities 296 || other.nv_external_memory_capabilities, 297 qnx_screen_surface: self.qnx_screen_surface || other.qnx_screen_surface, 298 _ne: crate::NonExhaustive(()), 299 } 300 } 301 #[doc = r" Returns the intersection of `self` and `other`."] 302 #[inline] intersection(&self, other: &Self) -> Self303 pub const fn intersection(&self, other: &Self) -> Self { 304 Self { 305 khr_android_surface: self.khr_android_surface && other.khr_android_surface, 306 khr_device_group_creation: self.khr_device_group_creation 307 && other.khr_device_group_creation, 308 khr_display: self.khr_display && other.khr_display, 309 khr_external_fence_capabilities: self.khr_external_fence_capabilities 310 && other.khr_external_fence_capabilities, 311 khr_external_memory_capabilities: self.khr_external_memory_capabilities 312 && other.khr_external_memory_capabilities, 313 khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities 314 && other.khr_external_semaphore_capabilities, 315 khr_get_display_properties2: self.khr_get_display_properties2 316 && other.khr_get_display_properties2, 317 khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 318 && other.khr_get_physical_device_properties2, 319 khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 320 && other.khr_get_surface_capabilities2, 321 khr_portability_enumeration: self.khr_portability_enumeration 322 && other.khr_portability_enumeration, 323 khr_surface: self.khr_surface && other.khr_surface, 324 khr_surface_protected_capabilities: self.khr_surface_protected_capabilities 325 && other.khr_surface_protected_capabilities, 326 khr_wayland_surface: self.khr_wayland_surface && other.khr_wayland_surface, 327 khr_win32_surface: self.khr_win32_surface && other.khr_win32_surface, 328 khr_xcb_surface: self.khr_xcb_surface && other.khr_xcb_surface, 329 khr_xlib_surface: self.khr_xlib_surface && other.khr_xlib_surface, 330 ext_acquire_drm_display: self.ext_acquire_drm_display && other.ext_acquire_drm_display, 331 ext_acquire_xlib_display: self.ext_acquire_xlib_display 332 && other.ext_acquire_xlib_display, 333 ext_debug_report: self.ext_debug_report && other.ext_debug_report, 334 ext_debug_utils: self.ext_debug_utils && other.ext_debug_utils, 335 ext_direct_mode_display: self.ext_direct_mode_display && other.ext_direct_mode_display, 336 ext_directfb_surface: self.ext_directfb_surface && other.ext_directfb_surface, 337 ext_display_surface_counter: self.ext_display_surface_counter 338 && other.ext_display_surface_counter, 339 ext_headless_surface: self.ext_headless_surface && other.ext_headless_surface, 340 ext_metal_surface: self.ext_metal_surface && other.ext_metal_surface, 341 ext_surface_maintenance1: self.ext_surface_maintenance1 342 && other.ext_surface_maintenance1, 343 ext_swapchain_colorspace: self.ext_swapchain_colorspace 344 && other.ext_swapchain_colorspace, 345 ext_validation_features: self.ext_validation_features && other.ext_validation_features, 346 ext_validation_flags: self.ext_validation_flags && other.ext_validation_flags, 347 fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface 348 && other.fuchsia_imagepipe_surface, 349 ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface 350 && other.ggp_stream_descriptor_surface, 351 google_surfaceless_query: self.google_surfaceless_query 352 && other.google_surfaceless_query, 353 lunarg_direct_driver_loading: self.lunarg_direct_driver_loading 354 && other.lunarg_direct_driver_loading, 355 mvk_ios_surface: self.mvk_ios_surface && other.mvk_ios_surface, 356 mvk_macos_surface: self.mvk_macos_surface && other.mvk_macos_surface, 357 nn_vi_surface: self.nn_vi_surface && other.nn_vi_surface, 358 nv_external_memory_capabilities: self.nv_external_memory_capabilities 359 && other.nv_external_memory_capabilities, 360 qnx_screen_surface: self.qnx_screen_surface && other.qnx_screen_surface, 361 _ne: crate::NonExhaustive(()), 362 } 363 } 364 #[doc = r" Returns `self` without the members set in `other`."] 365 #[inline] difference(&self, other: &Self) -> Self366 pub const fn difference(&self, other: &Self) -> Self { 367 Self { 368 khr_android_surface: self.khr_android_surface && !other.khr_android_surface, 369 khr_device_group_creation: self.khr_device_group_creation 370 && !other.khr_device_group_creation, 371 khr_display: self.khr_display && !other.khr_display, 372 khr_external_fence_capabilities: self.khr_external_fence_capabilities 373 && !other.khr_external_fence_capabilities, 374 khr_external_memory_capabilities: self.khr_external_memory_capabilities 375 && !other.khr_external_memory_capabilities, 376 khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities 377 && !other.khr_external_semaphore_capabilities, 378 khr_get_display_properties2: self.khr_get_display_properties2 379 && !other.khr_get_display_properties2, 380 khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 381 && !other.khr_get_physical_device_properties2, 382 khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 383 && !other.khr_get_surface_capabilities2, 384 khr_portability_enumeration: self.khr_portability_enumeration 385 && !other.khr_portability_enumeration, 386 khr_surface: self.khr_surface && !other.khr_surface, 387 khr_surface_protected_capabilities: self.khr_surface_protected_capabilities 388 && !other.khr_surface_protected_capabilities, 389 khr_wayland_surface: self.khr_wayland_surface && !other.khr_wayland_surface, 390 khr_win32_surface: self.khr_win32_surface && !other.khr_win32_surface, 391 khr_xcb_surface: self.khr_xcb_surface && !other.khr_xcb_surface, 392 khr_xlib_surface: self.khr_xlib_surface && !other.khr_xlib_surface, 393 ext_acquire_drm_display: self.ext_acquire_drm_display && !other.ext_acquire_drm_display, 394 ext_acquire_xlib_display: self.ext_acquire_xlib_display 395 && !other.ext_acquire_xlib_display, 396 ext_debug_report: self.ext_debug_report && !other.ext_debug_report, 397 ext_debug_utils: self.ext_debug_utils && !other.ext_debug_utils, 398 ext_direct_mode_display: self.ext_direct_mode_display && !other.ext_direct_mode_display, 399 ext_directfb_surface: self.ext_directfb_surface && !other.ext_directfb_surface, 400 ext_display_surface_counter: self.ext_display_surface_counter 401 && !other.ext_display_surface_counter, 402 ext_headless_surface: self.ext_headless_surface && !other.ext_headless_surface, 403 ext_metal_surface: self.ext_metal_surface && !other.ext_metal_surface, 404 ext_surface_maintenance1: self.ext_surface_maintenance1 405 && !other.ext_surface_maintenance1, 406 ext_swapchain_colorspace: self.ext_swapchain_colorspace 407 && !other.ext_swapchain_colorspace, 408 ext_validation_features: self.ext_validation_features && !other.ext_validation_features, 409 ext_validation_flags: self.ext_validation_flags && !other.ext_validation_flags, 410 fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface 411 && !other.fuchsia_imagepipe_surface, 412 ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface 413 && !other.ggp_stream_descriptor_surface, 414 google_surfaceless_query: self.google_surfaceless_query 415 && !other.google_surfaceless_query, 416 lunarg_direct_driver_loading: self.lunarg_direct_driver_loading 417 && !other.lunarg_direct_driver_loading, 418 mvk_ios_surface: self.mvk_ios_surface && !other.mvk_ios_surface, 419 mvk_macos_surface: self.mvk_macos_surface && !other.mvk_macos_surface, 420 nn_vi_surface: self.nn_vi_surface && !other.nn_vi_surface, 421 nv_external_memory_capabilities: self.nv_external_memory_capabilities 422 && !other.nv_external_memory_capabilities, 423 qnx_screen_surface: self.qnx_screen_surface && !other.qnx_screen_surface, 424 _ne: crate::NonExhaustive(()), 425 } 426 } 427 #[doc = r" Returns the members set in `self` or `other`, but not both."] 428 #[inline] symmetric_difference(&self, other: &Self) -> Self429 pub const fn symmetric_difference(&self, other: &Self) -> Self { 430 Self { 431 khr_android_surface: self.khr_android_surface ^ other.khr_android_surface, 432 khr_device_group_creation: self.khr_device_group_creation 433 ^ other.khr_device_group_creation, 434 khr_display: self.khr_display ^ other.khr_display, 435 khr_external_fence_capabilities: self.khr_external_fence_capabilities 436 ^ other.khr_external_fence_capabilities, 437 khr_external_memory_capabilities: self.khr_external_memory_capabilities 438 ^ other.khr_external_memory_capabilities, 439 khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities 440 ^ other.khr_external_semaphore_capabilities, 441 khr_get_display_properties2: self.khr_get_display_properties2 442 ^ other.khr_get_display_properties2, 443 khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 444 ^ other.khr_get_physical_device_properties2, 445 khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 446 ^ other.khr_get_surface_capabilities2, 447 khr_portability_enumeration: self.khr_portability_enumeration 448 ^ other.khr_portability_enumeration, 449 khr_surface: self.khr_surface ^ other.khr_surface, 450 khr_surface_protected_capabilities: self.khr_surface_protected_capabilities 451 ^ other.khr_surface_protected_capabilities, 452 khr_wayland_surface: self.khr_wayland_surface ^ other.khr_wayland_surface, 453 khr_win32_surface: self.khr_win32_surface ^ other.khr_win32_surface, 454 khr_xcb_surface: self.khr_xcb_surface ^ other.khr_xcb_surface, 455 khr_xlib_surface: self.khr_xlib_surface ^ other.khr_xlib_surface, 456 ext_acquire_drm_display: self.ext_acquire_drm_display ^ other.ext_acquire_drm_display, 457 ext_acquire_xlib_display: self.ext_acquire_xlib_display 458 ^ other.ext_acquire_xlib_display, 459 ext_debug_report: self.ext_debug_report ^ other.ext_debug_report, 460 ext_debug_utils: self.ext_debug_utils ^ other.ext_debug_utils, 461 ext_direct_mode_display: self.ext_direct_mode_display ^ other.ext_direct_mode_display, 462 ext_directfb_surface: self.ext_directfb_surface ^ other.ext_directfb_surface, 463 ext_display_surface_counter: self.ext_display_surface_counter 464 ^ other.ext_display_surface_counter, 465 ext_headless_surface: self.ext_headless_surface ^ other.ext_headless_surface, 466 ext_metal_surface: self.ext_metal_surface ^ other.ext_metal_surface, 467 ext_surface_maintenance1: self.ext_surface_maintenance1 468 ^ other.ext_surface_maintenance1, 469 ext_swapchain_colorspace: self.ext_swapchain_colorspace 470 ^ other.ext_swapchain_colorspace, 471 ext_validation_features: self.ext_validation_features ^ other.ext_validation_features, 472 ext_validation_flags: self.ext_validation_flags ^ other.ext_validation_flags, 473 fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface 474 ^ other.fuchsia_imagepipe_surface, 475 ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface 476 ^ other.ggp_stream_descriptor_surface, 477 google_surfaceless_query: self.google_surfaceless_query 478 ^ other.google_surfaceless_query, 479 lunarg_direct_driver_loading: self.lunarg_direct_driver_loading 480 ^ other.lunarg_direct_driver_loading, 481 mvk_ios_surface: self.mvk_ios_surface ^ other.mvk_ios_surface, 482 mvk_macos_surface: self.mvk_macos_surface ^ other.mvk_macos_surface, 483 nn_vi_surface: self.nn_vi_surface ^ other.nn_vi_surface, 484 nv_external_memory_capabilities: self.nv_external_memory_capabilities 485 ^ other.nv_external_memory_capabilities, 486 qnx_screen_surface: self.qnx_screen_surface ^ other.qnx_screen_surface, 487 _ne: crate::NonExhaustive(()), 488 } 489 } 490 } 491 impl std::ops::BitAnd for InstanceExtensions { 492 type Output = InstanceExtensions; 493 #[inline] bitand(self, rhs: Self) -> Self::Output494 fn bitand(self, rhs: Self) -> Self::Output { 495 self.union(&rhs) 496 } 497 } 498 impl std::ops::BitAndAssign for InstanceExtensions { 499 #[inline] bitand_assign(&mut self, rhs: Self)500 fn bitand_assign(&mut self, rhs: Self) { 501 *self = self.union(&rhs); 502 } 503 } 504 impl std::ops::BitOr for InstanceExtensions { 505 type Output = InstanceExtensions; 506 #[inline] bitor(self, rhs: Self) -> Self::Output507 fn bitor(self, rhs: Self) -> Self::Output { 508 self.intersection(&rhs) 509 } 510 } 511 impl std::ops::BitOrAssign for InstanceExtensions { 512 #[inline] bitor_assign(&mut self, rhs: Self)513 fn bitor_assign(&mut self, rhs: Self) { 514 *self = self.intersection(&rhs); 515 } 516 } 517 impl std::ops::BitXor for InstanceExtensions { 518 type Output = InstanceExtensions; 519 #[inline] bitxor(self, rhs: Self) -> Self::Output520 fn bitxor(self, rhs: Self) -> Self::Output { 521 self.symmetric_difference(&rhs) 522 } 523 } 524 impl std::ops::BitXorAssign for InstanceExtensions { 525 #[inline] bitxor_assign(&mut self, rhs: Self)526 fn bitxor_assign(&mut self, rhs: Self) { 527 *self = self.symmetric_difference(&rhs); 528 } 529 } 530 impl std::ops::Sub for InstanceExtensions { 531 type Output = InstanceExtensions; 532 #[inline] sub(self, rhs: Self) -> Self::Output533 fn sub(self, rhs: Self) -> Self::Output { 534 self.difference(&rhs) 535 } 536 } 537 impl std::ops::SubAssign for InstanceExtensions { 538 #[inline] sub_assign(&mut self, rhs: Self)539 fn sub_assign(&mut self, rhs: Self) { 540 *self = self.difference(&rhs); 541 } 542 } 543 impl std::fmt::Debug for InstanceExtensions { 544 #[allow(unused_assignments)] fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error>545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { 546 write!(f, "[")?; 547 let mut first = true; 548 if self.khr_android_surface { 549 if !first { 550 write!(f, ", ")? 551 } else { 552 first = false; 553 } 554 f.write_str("VK_KHR_android_surface")?; 555 } 556 if self.khr_device_group_creation { 557 if !first { 558 write!(f, ", ")? 559 } else { 560 first = false; 561 } 562 f.write_str("VK_KHR_device_group_creation")?; 563 } 564 if self.khr_display { 565 if !first { 566 write!(f, ", ")? 567 } else { 568 first = false; 569 } 570 f.write_str("VK_KHR_display")?; 571 } 572 if self.khr_external_fence_capabilities { 573 if !first { 574 write!(f, ", ")? 575 } else { 576 first = false; 577 } 578 f.write_str("VK_KHR_external_fence_capabilities")?; 579 } 580 if self.khr_external_memory_capabilities { 581 if !first { 582 write!(f, ", ")? 583 } else { 584 first = false; 585 } 586 f.write_str("VK_KHR_external_memory_capabilities")?; 587 } 588 if self.khr_external_semaphore_capabilities { 589 if !first { 590 write!(f, ", ")? 591 } else { 592 first = false; 593 } 594 f.write_str("VK_KHR_external_semaphore_capabilities")?; 595 } 596 if self.khr_get_display_properties2 { 597 if !first { 598 write!(f, ", ")? 599 } else { 600 first = false; 601 } 602 f.write_str("VK_KHR_get_display_properties2")?; 603 } 604 if self.khr_get_physical_device_properties2 { 605 if !first { 606 write!(f, ", ")? 607 } else { 608 first = false; 609 } 610 f.write_str("VK_KHR_get_physical_device_properties2")?; 611 } 612 if self.khr_get_surface_capabilities2 { 613 if !first { 614 write!(f, ", ")? 615 } else { 616 first = false; 617 } 618 f.write_str("VK_KHR_get_surface_capabilities2")?; 619 } 620 if self.khr_portability_enumeration { 621 if !first { 622 write!(f, ", ")? 623 } else { 624 first = false; 625 } 626 f.write_str("VK_KHR_portability_enumeration")?; 627 } 628 if self.khr_surface { 629 if !first { 630 write!(f, ", ")? 631 } else { 632 first = false; 633 } 634 f.write_str("VK_KHR_surface")?; 635 } 636 if self.khr_surface_protected_capabilities { 637 if !first { 638 write!(f, ", ")? 639 } else { 640 first = false; 641 } 642 f.write_str("VK_KHR_surface_protected_capabilities")?; 643 } 644 if self.khr_wayland_surface { 645 if !first { 646 write!(f, ", ")? 647 } else { 648 first = false; 649 } 650 f.write_str("VK_KHR_wayland_surface")?; 651 } 652 if self.khr_win32_surface { 653 if !first { 654 write!(f, ", ")? 655 } else { 656 first = false; 657 } 658 f.write_str("VK_KHR_win32_surface")?; 659 } 660 if self.khr_xcb_surface { 661 if !first { 662 write!(f, ", ")? 663 } else { 664 first = false; 665 } 666 f.write_str("VK_KHR_xcb_surface")?; 667 } 668 if self.khr_xlib_surface { 669 if !first { 670 write!(f, ", ")? 671 } else { 672 first = false; 673 } 674 f.write_str("VK_KHR_xlib_surface")?; 675 } 676 if self.ext_acquire_drm_display { 677 if !first { 678 write!(f, ", ")? 679 } else { 680 first = false; 681 } 682 f.write_str("VK_EXT_acquire_drm_display")?; 683 } 684 if self.ext_acquire_xlib_display { 685 if !first { 686 write!(f, ", ")? 687 } else { 688 first = false; 689 } 690 f.write_str("VK_EXT_acquire_xlib_display")?; 691 } 692 if self.ext_debug_report { 693 if !first { 694 write!(f, ", ")? 695 } else { 696 first = false; 697 } 698 f.write_str("VK_EXT_debug_report")?; 699 } 700 if self.ext_debug_utils { 701 if !first { 702 write!(f, ", ")? 703 } else { 704 first = false; 705 } 706 f.write_str("VK_EXT_debug_utils")?; 707 } 708 if self.ext_direct_mode_display { 709 if !first { 710 write!(f, ", ")? 711 } else { 712 first = false; 713 } 714 f.write_str("VK_EXT_direct_mode_display")?; 715 } 716 if self.ext_directfb_surface { 717 if !first { 718 write!(f, ", ")? 719 } else { 720 first = false; 721 } 722 f.write_str("VK_EXT_directfb_surface")?; 723 } 724 if self.ext_display_surface_counter { 725 if !first { 726 write!(f, ", ")? 727 } else { 728 first = false; 729 } 730 f.write_str("VK_EXT_display_surface_counter")?; 731 } 732 if self.ext_headless_surface { 733 if !first { 734 write!(f, ", ")? 735 } else { 736 first = false; 737 } 738 f.write_str("VK_EXT_headless_surface")?; 739 } 740 if self.ext_metal_surface { 741 if !first { 742 write!(f, ", ")? 743 } else { 744 first = false; 745 } 746 f.write_str("VK_EXT_metal_surface")?; 747 } 748 if self.ext_surface_maintenance1 { 749 if !first { 750 write!(f, ", ")? 751 } else { 752 first = false; 753 } 754 f.write_str("VK_EXT_surface_maintenance1")?; 755 } 756 if self.ext_swapchain_colorspace { 757 if !first { 758 write!(f, ", ")? 759 } else { 760 first = false; 761 } 762 f.write_str("VK_EXT_swapchain_colorspace")?; 763 } 764 if self.ext_validation_features { 765 if !first { 766 write!(f, ", ")? 767 } else { 768 first = false; 769 } 770 f.write_str("VK_EXT_validation_features")?; 771 } 772 if self.ext_validation_flags { 773 if !first { 774 write!(f, ", ")? 775 } else { 776 first = false; 777 } 778 f.write_str("VK_EXT_validation_flags")?; 779 } 780 if self.fuchsia_imagepipe_surface { 781 if !first { 782 write!(f, ", ")? 783 } else { 784 first = false; 785 } 786 f.write_str("VK_FUCHSIA_imagepipe_surface")?; 787 } 788 if self.ggp_stream_descriptor_surface { 789 if !first { 790 write!(f, ", ")? 791 } else { 792 first = false; 793 } 794 f.write_str("VK_GGP_stream_descriptor_surface")?; 795 } 796 if self.google_surfaceless_query { 797 if !first { 798 write!(f, ", ")? 799 } else { 800 first = false; 801 } 802 f.write_str("VK_GOOGLE_surfaceless_query")?; 803 } 804 if self.lunarg_direct_driver_loading { 805 if !first { 806 write!(f, ", ")? 807 } else { 808 first = false; 809 } 810 f.write_str("VK_LUNARG_direct_driver_loading")?; 811 } 812 if self.mvk_ios_surface { 813 if !first { 814 write!(f, ", ")? 815 } else { 816 first = false; 817 } 818 f.write_str("VK_MVK_ios_surface")?; 819 } 820 if self.mvk_macos_surface { 821 if !first { 822 write!(f, ", ")? 823 } else { 824 first = false; 825 } 826 f.write_str("VK_MVK_macos_surface")?; 827 } 828 if self.nn_vi_surface { 829 if !first { 830 write!(f, ", ")? 831 } else { 832 first = false; 833 } 834 f.write_str("VK_NN_vi_surface")?; 835 } 836 if self.nv_external_memory_capabilities { 837 if !first { 838 write!(f, ", ")? 839 } else { 840 first = false; 841 } 842 f.write_str("VK_NV_external_memory_capabilities")?; 843 } 844 if self.qnx_screen_surface { 845 if !first { 846 write!(f, ", ")? 847 } else { 848 first = false; 849 } 850 f.write_str("VK_QNX_screen_surface")?; 851 } 852 write!(f, "]") 853 } 854 } 855 impl<'a> FromIterator<&'a str> for InstanceExtensions { from_iter<I>(iter: I) -> Self where I: IntoIterator<Item = &'a str>,856 fn from_iter<I>(iter: I) -> Self 857 where 858 I: IntoIterator<Item = &'a str>, 859 { 860 let mut extensions = Self::empty(); 861 for name in iter { 862 match name { 863 "VK_KHR_android_surface" => { 864 extensions.khr_android_surface = true; 865 } 866 "VK_KHR_device_group_creation" => { 867 extensions.khr_device_group_creation = true; 868 } 869 "VK_KHR_display" => { 870 extensions.khr_display = true; 871 } 872 "VK_KHR_external_fence_capabilities" => { 873 extensions.khr_external_fence_capabilities = true; 874 } 875 "VK_KHR_external_memory_capabilities" => { 876 extensions.khr_external_memory_capabilities = true; 877 } 878 "VK_KHR_external_semaphore_capabilities" => { 879 extensions.khr_external_semaphore_capabilities = true; 880 } 881 "VK_KHR_get_display_properties2" => { 882 extensions.khr_get_display_properties2 = true; 883 } 884 "VK_KHR_get_physical_device_properties2" => { 885 extensions.khr_get_physical_device_properties2 = true; 886 } 887 "VK_KHR_get_surface_capabilities2" => { 888 extensions.khr_get_surface_capabilities2 = true; 889 } 890 "VK_KHR_portability_enumeration" => { 891 extensions.khr_portability_enumeration = true; 892 } 893 "VK_KHR_surface" => { 894 extensions.khr_surface = true; 895 } 896 "VK_KHR_surface_protected_capabilities" => { 897 extensions.khr_surface_protected_capabilities = true; 898 } 899 "VK_KHR_wayland_surface" => { 900 extensions.khr_wayland_surface = true; 901 } 902 "VK_KHR_win32_surface" => { 903 extensions.khr_win32_surface = true; 904 } 905 "VK_KHR_xcb_surface" => { 906 extensions.khr_xcb_surface = true; 907 } 908 "VK_KHR_xlib_surface" => { 909 extensions.khr_xlib_surface = true; 910 } 911 "VK_EXT_acquire_drm_display" => { 912 extensions.ext_acquire_drm_display = true; 913 } 914 "VK_EXT_acquire_xlib_display" => { 915 extensions.ext_acquire_xlib_display = true; 916 } 917 "VK_EXT_debug_report" => { 918 extensions.ext_debug_report = true; 919 } 920 "VK_EXT_debug_utils" => { 921 extensions.ext_debug_utils = true; 922 } 923 "VK_EXT_direct_mode_display" => { 924 extensions.ext_direct_mode_display = true; 925 } 926 "VK_EXT_directfb_surface" => { 927 extensions.ext_directfb_surface = true; 928 } 929 "VK_EXT_display_surface_counter" => { 930 extensions.ext_display_surface_counter = true; 931 } 932 "VK_EXT_headless_surface" => { 933 extensions.ext_headless_surface = true; 934 } 935 "VK_EXT_metal_surface" => { 936 extensions.ext_metal_surface = true; 937 } 938 "VK_EXT_surface_maintenance1" => { 939 extensions.ext_surface_maintenance1 = true; 940 } 941 "VK_EXT_swapchain_colorspace" => { 942 extensions.ext_swapchain_colorspace = true; 943 } 944 "VK_EXT_validation_features" => { 945 extensions.ext_validation_features = true; 946 } 947 "VK_EXT_validation_flags" => { 948 extensions.ext_validation_flags = true; 949 } 950 "VK_FUCHSIA_imagepipe_surface" => { 951 extensions.fuchsia_imagepipe_surface = true; 952 } 953 "VK_GGP_stream_descriptor_surface" => { 954 extensions.ggp_stream_descriptor_surface = true; 955 } 956 "VK_GOOGLE_surfaceless_query" => { 957 extensions.google_surfaceless_query = true; 958 } 959 "VK_LUNARG_direct_driver_loading" => { 960 extensions.lunarg_direct_driver_loading = true; 961 } 962 "VK_MVK_ios_surface" => { 963 extensions.mvk_ios_surface = true; 964 } 965 "VK_MVK_macos_surface" => { 966 extensions.mvk_macos_surface = true; 967 } 968 "VK_NN_vi_surface" => { 969 extensions.nn_vi_surface = true; 970 } 971 "VK_NV_external_memory_capabilities" => { 972 extensions.nv_external_memory_capabilities = true; 973 } 974 "VK_QNX_screen_surface" => { 975 extensions.qnx_screen_surface = true; 976 } 977 _ => (), 978 } 979 } 980 extensions 981 } 982 } 983 impl<'a> From<&'a InstanceExtensions> for Vec<std::ffi::CString> { from(x: &'a InstanceExtensions) -> Self984 fn from(x: &'a InstanceExtensions) -> Self { 985 let mut data = Self::new(); 986 if x.khr_android_surface { 987 data.push(std::ffi::CString::new("VK_KHR_android_surface").unwrap()); 988 } 989 if x.khr_device_group_creation { 990 data.push(std::ffi::CString::new("VK_KHR_device_group_creation").unwrap()); 991 } 992 if x.khr_display { 993 data.push(std::ffi::CString::new("VK_KHR_display").unwrap()); 994 } 995 if x.khr_external_fence_capabilities { 996 data.push(std::ffi::CString::new("VK_KHR_external_fence_capabilities").unwrap()); 997 } 998 if x.khr_external_memory_capabilities { 999 data.push(std::ffi::CString::new("VK_KHR_external_memory_capabilities").unwrap()); 1000 } 1001 if x.khr_external_semaphore_capabilities { 1002 data.push(std::ffi::CString::new("VK_KHR_external_semaphore_capabilities").unwrap()); 1003 } 1004 if x.khr_get_display_properties2 { 1005 data.push(std::ffi::CString::new("VK_KHR_get_display_properties2").unwrap()); 1006 } 1007 if x.khr_get_physical_device_properties2 { 1008 data.push(std::ffi::CString::new("VK_KHR_get_physical_device_properties2").unwrap()); 1009 } 1010 if x.khr_get_surface_capabilities2 { 1011 data.push(std::ffi::CString::new("VK_KHR_get_surface_capabilities2").unwrap()); 1012 } 1013 if x.khr_portability_enumeration { 1014 data.push(std::ffi::CString::new("VK_KHR_portability_enumeration").unwrap()); 1015 } 1016 if x.khr_surface { 1017 data.push(std::ffi::CString::new("VK_KHR_surface").unwrap()); 1018 } 1019 if x.khr_surface_protected_capabilities { 1020 data.push(std::ffi::CString::new("VK_KHR_surface_protected_capabilities").unwrap()); 1021 } 1022 if x.khr_wayland_surface { 1023 data.push(std::ffi::CString::new("VK_KHR_wayland_surface").unwrap()); 1024 } 1025 if x.khr_win32_surface { 1026 data.push(std::ffi::CString::new("VK_KHR_win32_surface").unwrap()); 1027 } 1028 if x.khr_xcb_surface { 1029 data.push(std::ffi::CString::new("VK_KHR_xcb_surface").unwrap()); 1030 } 1031 if x.khr_xlib_surface { 1032 data.push(std::ffi::CString::new("VK_KHR_xlib_surface").unwrap()); 1033 } 1034 if x.ext_acquire_drm_display { 1035 data.push(std::ffi::CString::new("VK_EXT_acquire_drm_display").unwrap()); 1036 } 1037 if x.ext_acquire_xlib_display { 1038 data.push(std::ffi::CString::new("VK_EXT_acquire_xlib_display").unwrap()); 1039 } 1040 if x.ext_debug_report { 1041 data.push(std::ffi::CString::new("VK_EXT_debug_report").unwrap()); 1042 } 1043 if x.ext_debug_utils { 1044 data.push(std::ffi::CString::new("VK_EXT_debug_utils").unwrap()); 1045 } 1046 if x.ext_direct_mode_display { 1047 data.push(std::ffi::CString::new("VK_EXT_direct_mode_display").unwrap()); 1048 } 1049 if x.ext_directfb_surface { 1050 data.push(std::ffi::CString::new("VK_EXT_directfb_surface").unwrap()); 1051 } 1052 if x.ext_display_surface_counter { 1053 data.push(std::ffi::CString::new("VK_EXT_display_surface_counter").unwrap()); 1054 } 1055 if x.ext_headless_surface { 1056 data.push(std::ffi::CString::new("VK_EXT_headless_surface").unwrap()); 1057 } 1058 if x.ext_metal_surface { 1059 data.push(std::ffi::CString::new("VK_EXT_metal_surface").unwrap()); 1060 } 1061 if x.ext_surface_maintenance1 { 1062 data.push(std::ffi::CString::new("VK_EXT_surface_maintenance1").unwrap()); 1063 } 1064 if x.ext_swapchain_colorspace { 1065 data.push(std::ffi::CString::new("VK_EXT_swapchain_colorspace").unwrap()); 1066 } 1067 if x.ext_validation_features { 1068 data.push(std::ffi::CString::new("VK_EXT_validation_features").unwrap()); 1069 } 1070 if x.ext_validation_flags { 1071 data.push(std::ffi::CString::new("VK_EXT_validation_flags").unwrap()); 1072 } 1073 if x.fuchsia_imagepipe_surface { 1074 data.push(std::ffi::CString::new("VK_FUCHSIA_imagepipe_surface").unwrap()); 1075 } 1076 if x.ggp_stream_descriptor_surface { 1077 data.push(std::ffi::CString::new("VK_GGP_stream_descriptor_surface").unwrap()); 1078 } 1079 if x.google_surfaceless_query { 1080 data.push(std::ffi::CString::new("VK_GOOGLE_surfaceless_query").unwrap()); 1081 } 1082 if x.lunarg_direct_driver_loading { 1083 data.push(std::ffi::CString::new("VK_LUNARG_direct_driver_loading").unwrap()); 1084 } 1085 if x.mvk_ios_surface { 1086 data.push(std::ffi::CString::new("VK_MVK_ios_surface").unwrap()); 1087 } 1088 if x.mvk_macos_surface { 1089 data.push(std::ffi::CString::new("VK_MVK_macos_surface").unwrap()); 1090 } 1091 if x.nn_vi_surface { 1092 data.push(std::ffi::CString::new("VK_NN_vi_surface").unwrap()); 1093 } 1094 if x.nv_external_memory_capabilities { 1095 data.push(std::ffi::CString::new("VK_NV_external_memory_capabilities").unwrap()); 1096 } 1097 if x.qnx_screen_surface { 1098 data.push(std::ffi::CString::new("VK_QNX_screen_surface").unwrap()); 1099 } 1100 data 1101 } 1102 } 1103 impl IntoIterator for InstanceExtensions { 1104 type Item = (&'static str, bool); 1105 type IntoIter = std::array::IntoIter<Self::Item, 38usize>; 1106 #[inline] into_iter(self) -> Self::IntoIter1107 fn into_iter(self) -> Self::IntoIter { 1108 [ 1109 ("VK_KHR_android_surface", self.khr_android_surface), 1110 ( 1111 "VK_KHR_device_group_creation", 1112 self.khr_device_group_creation, 1113 ), 1114 ("VK_KHR_display", self.khr_display), 1115 ( 1116 "VK_KHR_external_fence_capabilities", 1117 self.khr_external_fence_capabilities, 1118 ), 1119 ( 1120 "VK_KHR_external_memory_capabilities", 1121 self.khr_external_memory_capabilities, 1122 ), 1123 ( 1124 "VK_KHR_external_semaphore_capabilities", 1125 self.khr_external_semaphore_capabilities, 1126 ), 1127 ( 1128 "VK_KHR_get_display_properties2", 1129 self.khr_get_display_properties2, 1130 ), 1131 ( 1132 "VK_KHR_get_physical_device_properties2", 1133 self.khr_get_physical_device_properties2, 1134 ), 1135 ( 1136 "VK_KHR_get_surface_capabilities2", 1137 self.khr_get_surface_capabilities2, 1138 ), 1139 ( 1140 "VK_KHR_portability_enumeration", 1141 self.khr_portability_enumeration, 1142 ), 1143 ("VK_KHR_surface", self.khr_surface), 1144 ( 1145 "VK_KHR_surface_protected_capabilities", 1146 self.khr_surface_protected_capabilities, 1147 ), 1148 ("VK_KHR_wayland_surface", self.khr_wayland_surface), 1149 ("VK_KHR_win32_surface", self.khr_win32_surface), 1150 ("VK_KHR_xcb_surface", self.khr_xcb_surface), 1151 ("VK_KHR_xlib_surface", self.khr_xlib_surface), 1152 ("VK_EXT_acquire_drm_display", self.ext_acquire_drm_display), 1153 ("VK_EXT_acquire_xlib_display", self.ext_acquire_xlib_display), 1154 ("VK_EXT_debug_report", self.ext_debug_report), 1155 ("VK_EXT_debug_utils", self.ext_debug_utils), 1156 ("VK_EXT_direct_mode_display", self.ext_direct_mode_display), 1157 ("VK_EXT_directfb_surface", self.ext_directfb_surface), 1158 ( 1159 "VK_EXT_display_surface_counter", 1160 self.ext_display_surface_counter, 1161 ), 1162 ("VK_EXT_headless_surface", self.ext_headless_surface), 1163 ("VK_EXT_metal_surface", self.ext_metal_surface), 1164 ("VK_EXT_surface_maintenance1", self.ext_surface_maintenance1), 1165 ("VK_EXT_swapchain_colorspace", self.ext_swapchain_colorspace), 1166 ("VK_EXT_validation_features", self.ext_validation_features), 1167 ("VK_EXT_validation_flags", self.ext_validation_flags), 1168 ( 1169 "VK_FUCHSIA_imagepipe_surface", 1170 self.fuchsia_imagepipe_surface, 1171 ), 1172 ( 1173 "VK_GGP_stream_descriptor_surface", 1174 self.ggp_stream_descriptor_surface, 1175 ), 1176 ("VK_GOOGLE_surfaceless_query", self.google_surfaceless_query), 1177 ( 1178 "VK_LUNARG_direct_driver_loading", 1179 self.lunarg_direct_driver_loading, 1180 ), 1181 ("VK_MVK_ios_surface", self.mvk_ios_surface), 1182 ("VK_MVK_macos_surface", self.mvk_macos_surface), 1183 ("VK_NN_vi_surface", self.nn_vi_surface), 1184 ( 1185 "VK_NV_external_memory_capabilities", 1186 self.nv_external_memory_capabilities, 1187 ), 1188 ("VK_QNX_screen_surface", self.qnx_screen_surface), 1189 ] 1190 .into_iter() 1191 } 1192 } 1193 impl InstanceExtensions { 1194 #[doc = r" Checks enabled extensions against the instance version and each other."] check_requirements( &self, supported: &InstanceExtensions, api_version: crate::Version, ) -> Result<(), crate::instance::ExtensionRestrictionError>1195 pub(super) fn check_requirements( 1196 &self, 1197 supported: &InstanceExtensions, 1198 api_version: crate::Version, 1199 ) -> Result<(), crate::instance::ExtensionRestrictionError> { 1200 let instance_extensions = self; 1201 if self.khr_android_surface { 1202 if !supported.khr_android_surface { 1203 return Err(crate::instance::ExtensionRestrictionError { 1204 extension: "khr_android_surface", 1205 restriction: crate::instance::ExtensionRestriction::NotSupported, 1206 }); 1207 } 1208 if !(instance_extensions.khr_surface) { 1209 return Err(crate::instance::ExtensionRestrictionError { 1210 extension: "khr_android_surface", 1211 restriction: crate::instance::ExtensionRestriction::Requires( 1212 crate::RequiresOneOf { 1213 api_version: None, 1214 device_extensions: &[], 1215 instance_extensions: &["khr_surface"], 1216 ..Default::default() 1217 }, 1218 ), 1219 }); 1220 } 1221 } 1222 if self.khr_device_group_creation { 1223 if !supported.khr_device_group_creation { 1224 return Err(crate::instance::ExtensionRestrictionError { 1225 extension: "khr_device_group_creation", 1226 restriction: crate::instance::ExtensionRestriction::NotSupported, 1227 }); 1228 } 1229 } 1230 if self.khr_display { 1231 if !supported.khr_display { 1232 return Err(crate::instance::ExtensionRestrictionError { 1233 extension: "khr_display", 1234 restriction: crate::instance::ExtensionRestriction::NotSupported, 1235 }); 1236 } 1237 if !(instance_extensions.khr_surface) { 1238 return Err(crate::instance::ExtensionRestrictionError { 1239 extension: "khr_display", 1240 restriction: crate::instance::ExtensionRestriction::Requires( 1241 crate::RequiresOneOf { 1242 api_version: None, 1243 device_extensions: &[], 1244 instance_extensions: &["khr_surface"], 1245 ..Default::default() 1246 }, 1247 ), 1248 }); 1249 } 1250 } 1251 if self.khr_external_fence_capabilities { 1252 if !supported.khr_external_fence_capabilities { 1253 return Err(crate::instance::ExtensionRestrictionError { 1254 extension: "khr_external_fence_capabilities", 1255 restriction: crate::instance::ExtensionRestriction::NotSupported, 1256 }); 1257 } 1258 if !(api_version >= crate::Version::V1_1 1259 || instance_extensions.khr_get_physical_device_properties2) 1260 { 1261 return Err(crate::instance::ExtensionRestrictionError { 1262 extension: "khr_external_fence_capabilities", 1263 restriction: crate::instance::ExtensionRestriction::Requires( 1264 crate::RequiresOneOf { 1265 api_version: Some(crate::Version::V1_1), 1266 device_extensions: &[], 1267 instance_extensions: &["khr_get_physical_device_properties2"], 1268 ..Default::default() 1269 }, 1270 ), 1271 }); 1272 } 1273 } 1274 if self.khr_external_memory_capabilities { 1275 if !supported.khr_external_memory_capabilities { 1276 return Err(crate::instance::ExtensionRestrictionError { 1277 extension: "khr_external_memory_capabilities", 1278 restriction: crate::instance::ExtensionRestriction::NotSupported, 1279 }); 1280 } 1281 if !(api_version >= crate::Version::V1_1 1282 || instance_extensions.khr_get_physical_device_properties2) 1283 { 1284 return Err(crate::instance::ExtensionRestrictionError { 1285 extension: "khr_external_memory_capabilities", 1286 restriction: crate::instance::ExtensionRestriction::Requires( 1287 crate::RequiresOneOf { 1288 api_version: Some(crate::Version::V1_1), 1289 device_extensions: &[], 1290 instance_extensions: &["khr_get_physical_device_properties2"], 1291 ..Default::default() 1292 }, 1293 ), 1294 }); 1295 } 1296 } 1297 if self.khr_external_semaphore_capabilities { 1298 if !supported.khr_external_semaphore_capabilities { 1299 return Err(crate::instance::ExtensionRestrictionError { 1300 extension: "khr_external_semaphore_capabilities", 1301 restriction: crate::instance::ExtensionRestriction::NotSupported, 1302 }); 1303 } 1304 if !(api_version >= crate::Version::V1_1 1305 || instance_extensions.khr_get_physical_device_properties2) 1306 { 1307 return Err(crate::instance::ExtensionRestrictionError { 1308 extension: "khr_external_semaphore_capabilities", 1309 restriction: crate::instance::ExtensionRestriction::Requires( 1310 crate::RequiresOneOf { 1311 api_version: Some(crate::Version::V1_1), 1312 device_extensions: &[], 1313 instance_extensions: &["khr_get_physical_device_properties2"], 1314 ..Default::default() 1315 }, 1316 ), 1317 }); 1318 } 1319 } 1320 if self.khr_get_display_properties2 { 1321 if !supported.khr_get_display_properties2 { 1322 return Err(crate::instance::ExtensionRestrictionError { 1323 extension: "khr_get_display_properties2", 1324 restriction: crate::instance::ExtensionRestriction::NotSupported, 1325 }); 1326 } 1327 if !(instance_extensions.khr_display) { 1328 return Err(crate::instance::ExtensionRestrictionError { 1329 extension: "khr_get_display_properties2", 1330 restriction: crate::instance::ExtensionRestriction::Requires( 1331 crate::RequiresOneOf { 1332 api_version: None, 1333 device_extensions: &[], 1334 instance_extensions: &["khr_display"], 1335 ..Default::default() 1336 }, 1337 ), 1338 }); 1339 } 1340 } 1341 if self.khr_get_physical_device_properties2 { 1342 if !supported.khr_get_physical_device_properties2 { 1343 return Err(crate::instance::ExtensionRestrictionError { 1344 extension: "khr_get_physical_device_properties2", 1345 restriction: crate::instance::ExtensionRestriction::NotSupported, 1346 }); 1347 } 1348 } 1349 if self.khr_get_surface_capabilities2 { 1350 if !supported.khr_get_surface_capabilities2 { 1351 return Err(crate::instance::ExtensionRestrictionError { 1352 extension: "khr_get_surface_capabilities2", 1353 restriction: crate::instance::ExtensionRestriction::NotSupported, 1354 }); 1355 } 1356 if !(instance_extensions.khr_surface) { 1357 return Err(crate::instance::ExtensionRestrictionError { 1358 extension: "khr_get_surface_capabilities2", 1359 restriction: crate::instance::ExtensionRestriction::Requires( 1360 crate::RequiresOneOf { 1361 api_version: None, 1362 device_extensions: &[], 1363 instance_extensions: &["khr_surface"], 1364 ..Default::default() 1365 }, 1366 ), 1367 }); 1368 } 1369 } 1370 if self.khr_portability_enumeration { 1371 if !supported.khr_portability_enumeration { 1372 return Err(crate::instance::ExtensionRestrictionError { 1373 extension: "khr_portability_enumeration", 1374 restriction: crate::instance::ExtensionRestriction::NotSupported, 1375 }); 1376 } 1377 } 1378 if self.khr_surface { 1379 if !supported.khr_surface { 1380 return Err(crate::instance::ExtensionRestrictionError { 1381 extension: "khr_surface", 1382 restriction: crate::instance::ExtensionRestriction::NotSupported, 1383 }); 1384 } 1385 } 1386 if self.khr_surface_protected_capabilities { 1387 if !supported.khr_surface_protected_capabilities { 1388 return Err(crate::instance::ExtensionRestrictionError { 1389 extension: "khr_surface_protected_capabilities", 1390 restriction: crate::instance::ExtensionRestriction::NotSupported, 1391 }); 1392 } 1393 if !(api_version >= crate::Version::V1_1) { 1394 return Err(crate::instance::ExtensionRestrictionError { 1395 extension: "khr_surface_protected_capabilities", 1396 restriction: crate::instance::ExtensionRestriction::Requires( 1397 crate::RequiresOneOf { 1398 api_version: Some(crate::Version::V1_1), 1399 device_extensions: &[], 1400 instance_extensions: &[], 1401 ..Default::default() 1402 }, 1403 ), 1404 }); 1405 } 1406 if !(instance_extensions.khr_get_surface_capabilities2) { 1407 return Err(crate::instance::ExtensionRestrictionError { 1408 extension: "khr_surface_protected_capabilities", 1409 restriction: crate::instance::ExtensionRestriction::Requires( 1410 crate::RequiresOneOf { 1411 api_version: None, 1412 device_extensions: &[], 1413 instance_extensions: &["khr_get_surface_capabilities2"], 1414 ..Default::default() 1415 }, 1416 ), 1417 }); 1418 } 1419 } 1420 if self.khr_wayland_surface { 1421 if !supported.khr_wayland_surface { 1422 return Err(crate::instance::ExtensionRestrictionError { 1423 extension: "khr_wayland_surface", 1424 restriction: crate::instance::ExtensionRestriction::NotSupported, 1425 }); 1426 } 1427 if !(instance_extensions.khr_surface) { 1428 return Err(crate::instance::ExtensionRestrictionError { 1429 extension: "khr_wayland_surface", 1430 restriction: crate::instance::ExtensionRestriction::Requires( 1431 crate::RequiresOneOf { 1432 api_version: None, 1433 device_extensions: &[], 1434 instance_extensions: &["khr_surface"], 1435 ..Default::default() 1436 }, 1437 ), 1438 }); 1439 } 1440 } 1441 if self.khr_win32_surface { 1442 if !supported.khr_win32_surface { 1443 return Err(crate::instance::ExtensionRestrictionError { 1444 extension: "khr_win32_surface", 1445 restriction: crate::instance::ExtensionRestriction::NotSupported, 1446 }); 1447 } 1448 if !(instance_extensions.khr_surface) { 1449 return Err(crate::instance::ExtensionRestrictionError { 1450 extension: "khr_win32_surface", 1451 restriction: crate::instance::ExtensionRestriction::Requires( 1452 crate::RequiresOneOf { 1453 api_version: None, 1454 device_extensions: &[], 1455 instance_extensions: &["khr_surface"], 1456 ..Default::default() 1457 }, 1458 ), 1459 }); 1460 } 1461 } 1462 if self.khr_xcb_surface { 1463 if !supported.khr_xcb_surface { 1464 return Err(crate::instance::ExtensionRestrictionError { 1465 extension: "khr_xcb_surface", 1466 restriction: crate::instance::ExtensionRestriction::NotSupported, 1467 }); 1468 } 1469 if !(instance_extensions.khr_surface) { 1470 return Err(crate::instance::ExtensionRestrictionError { 1471 extension: "khr_xcb_surface", 1472 restriction: crate::instance::ExtensionRestriction::Requires( 1473 crate::RequiresOneOf { 1474 api_version: None, 1475 device_extensions: &[], 1476 instance_extensions: &["khr_surface"], 1477 ..Default::default() 1478 }, 1479 ), 1480 }); 1481 } 1482 } 1483 if self.khr_xlib_surface { 1484 if !supported.khr_xlib_surface { 1485 return Err(crate::instance::ExtensionRestrictionError { 1486 extension: "khr_xlib_surface", 1487 restriction: crate::instance::ExtensionRestriction::NotSupported, 1488 }); 1489 } 1490 if !(instance_extensions.khr_surface) { 1491 return Err(crate::instance::ExtensionRestrictionError { 1492 extension: "khr_xlib_surface", 1493 restriction: crate::instance::ExtensionRestriction::Requires( 1494 crate::RequiresOneOf { 1495 api_version: None, 1496 device_extensions: &[], 1497 instance_extensions: &["khr_surface"], 1498 ..Default::default() 1499 }, 1500 ), 1501 }); 1502 } 1503 } 1504 if self.ext_acquire_drm_display { 1505 if !supported.ext_acquire_drm_display { 1506 return Err(crate::instance::ExtensionRestrictionError { 1507 extension: "ext_acquire_drm_display", 1508 restriction: crate::instance::ExtensionRestriction::NotSupported, 1509 }); 1510 } 1511 if !(instance_extensions.ext_direct_mode_display) { 1512 return Err(crate::instance::ExtensionRestrictionError { 1513 extension: "ext_acquire_drm_display", 1514 restriction: crate::instance::ExtensionRestriction::Requires( 1515 crate::RequiresOneOf { 1516 api_version: None, 1517 device_extensions: &[], 1518 instance_extensions: &["ext_direct_mode_display"], 1519 ..Default::default() 1520 }, 1521 ), 1522 }); 1523 } 1524 } 1525 if self.ext_acquire_xlib_display { 1526 if !supported.ext_acquire_xlib_display { 1527 return Err(crate::instance::ExtensionRestrictionError { 1528 extension: "ext_acquire_xlib_display", 1529 restriction: crate::instance::ExtensionRestriction::NotSupported, 1530 }); 1531 } 1532 if !(instance_extensions.ext_direct_mode_display) { 1533 return Err(crate::instance::ExtensionRestrictionError { 1534 extension: "ext_acquire_xlib_display", 1535 restriction: crate::instance::ExtensionRestriction::Requires( 1536 crate::RequiresOneOf { 1537 api_version: None, 1538 device_extensions: &[], 1539 instance_extensions: &["ext_direct_mode_display"], 1540 ..Default::default() 1541 }, 1542 ), 1543 }); 1544 } 1545 } 1546 if self.ext_debug_report { 1547 if !supported.ext_debug_report { 1548 return Err(crate::instance::ExtensionRestrictionError { 1549 extension: "ext_debug_report", 1550 restriction: crate::instance::ExtensionRestriction::NotSupported, 1551 }); 1552 } 1553 } 1554 if self.ext_debug_utils { 1555 if !supported.ext_debug_utils { 1556 return Err(crate::instance::ExtensionRestrictionError { 1557 extension: "ext_debug_utils", 1558 restriction: crate::instance::ExtensionRestriction::NotSupported, 1559 }); 1560 } 1561 } 1562 if self.ext_direct_mode_display { 1563 if !supported.ext_direct_mode_display { 1564 return Err(crate::instance::ExtensionRestrictionError { 1565 extension: "ext_direct_mode_display", 1566 restriction: crate::instance::ExtensionRestriction::NotSupported, 1567 }); 1568 } 1569 if !(instance_extensions.khr_display) { 1570 return Err(crate::instance::ExtensionRestrictionError { 1571 extension: "ext_direct_mode_display", 1572 restriction: crate::instance::ExtensionRestriction::Requires( 1573 crate::RequiresOneOf { 1574 api_version: None, 1575 device_extensions: &[], 1576 instance_extensions: &["khr_display"], 1577 ..Default::default() 1578 }, 1579 ), 1580 }); 1581 } 1582 } 1583 if self.ext_directfb_surface { 1584 if !supported.ext_directfb_surface { 1585 return Err(crate::instance::ExtensionRestrictionError { 1586 extension: "ext_directfb_surface", 1587 restriction: crate::instance::ExtensionRestriction::NotSupported, 1588 }); 1589 } 1590 if !(instance_extensions.khr_surface) { 1591 return Err(crate::instance::ExtensionRestrictionError { 1592 extension: "ext_directfb_surface", 1593 restriction: crate::instance::ExtensionRestriction::Requires( 1594 crate::RequiresOneOf { 1595 api_version: None, 1596 device_extensions: &[], 1597 instance_extensions: &["khr_surface"], 1598 ..Default::default() 1599 }, 1600 ), 1601 }); 1602 } 1603 } 1604 if self.ext_display_surface_counter { 1605 if !supported.ext_display_surface_counter { 1606 return Err(crate::instance::ExtensionRestrictionError { 1607 extension: "ext_display_surface_counter", 1608 restriction: crate::instance::ExtensionRestriction::NotSupported, 1609 }); 1610 } 1611 if !(instance_extensions.khr_display) { 1612 return Err(crate::instance::ExtensionRestrictionError { 1613 extension: "ext_display_surface_counter", 1614 restriction: crate::instance::ExtensionRestriction::Requires( 1615 crate::RequiresOneOf { 1616 api_version: None, 1617 device_extensions: &[], 1618 instance_extensions: &["khr_display"], 1619 ..Default::default() 1620 }, 1621 ), 1622 }); 1623 } 1624 } 1625 if self.ext_headless_surface { 1626 if !supported.ext_headless_surface { 1627 return Err(crate::instance::ExtensionRestrictionError { 1628 extension: "ext_headless_surface", 1629 restriction: crate::instance::ExtensionRestriction::NotSupported, 1630 }); 1631 } 1632 if !(instance_extensions.khr_surface) { 1633 return Err(crate::instance::ExtensionRestrictionError { 1634 extension: "ext_headless_surface", 1635 restriction: crate::instance::ExtensionRestriction::Requires( 1636 crate::RequiresOneOf { 1637 api_version: None, 1638 device_extensions: &[], 1639 instance_extensions: &["khr_surface"], 1640 ..Default::default() 1641 }, 1642 ), 1643 }); 1644 } 1645 } 1646 if self.ext_metal_surface { 1647 if !supported.ext_metal_surface { 1648 return Err(crate::instance::ExtensionRestrictionError { 1649 extension: "ext_metal_surface", 1650 restriction: crate::instance::ExtensionRestriction::NotSupported, 1651 }); 1652 } 1653 if !(instance_extensions.khr_surface) { 1654 return Err(crate::instance::ExtensionRestrictionError { 1655 extension: "ext_metal_surface", 1656 restriction: crate::instance::ExtensionRestriction::Requires( 1657 crate::RequiresOneOf { 1658 api_version: None, 1659 device_extensions: &[], 1660 instance_extensions: &["khr_surface"], 1661 ..Default::default() 1662 }, 1663 ), 1664 }); 1665 } 1666 } 1667 if self.ext_surface_maintenance1 { 1668 if !supported.ext_surface_maintenance1 { 1669 return Err(crate::instance::ExtensionRestrictionError { 1670 extension: "ext_surface_maintenance1", 1671 restriction: crate::instance::ExtensionRestriction::NotSupported, 1672 }); 1673 } 1674 if !(instance_extensions.khr_surface) { 1675 return Err(crate::instance::ExtensionRestrictionError { 1676 extension: "ext_surface_maintenance1", 1677 restriction: crate::instance::ExtensionRestriction::Requires( 1678 crate::RequiresOneOf { 1679 api_version: None, 1680 device_extensions: &[], 1681 instance_extensions: &["khr_surface"], 1682 ..Default::default() 1683 }, 1684 ), 1685 }); 1686 } 1687 if !(instance_extensions.khr_get_surface_capabilities2) { 1688 return Err(crate::instance::ExtensionRestrictionError { 1689 extension: "ext_surface_maintenance1", 1690 restriction: crate::instance::ExtensionRestriction::Requires( 1691 crate::RequiresOneOf { 1692 api_version: None, 1693 device_extensions: &[], 1694 instance_extensions: &["khr_get_surface_capabilities2"], 1695 ..Default::default() 1696 }, 1697 ), 1698 }); 1699 } 1700 } 1701 if self.ext_swapchain_colorspace { 1702 if !supported.ext_swapchain_colorspace { 1703 return Err(crate::instance::ExtensionRestrictionError { 1704 extension: "ext_swapchain_colorspace", 1705 restriction: crate::instance::ExtensionRestriction::NotSupported, 1706 }); 1707 } 1708 if !(instance_extensions.khr_surface) { 1709 return Err(crate::instance::ExtensionRestrictionError { 1710 extension: "ext_swapchain_colorspace", 1711 restriction: crate::instance::ExtensionRestriction::Requires( 1712 crate::RequiresOneOf { 1713 api_version: None, 1714 device_extensions: &[], 1715 instance_extensions: &["khr_surface"], 1716 ..Default::default() 1717 }, 1718 ), 1719 }); 1720 } 1721 } 1722 if self.ext_validation_features { 1723 if !supported.ext_validation_features { 1724 return Err(crate::instance::ExtensionRestrictionError { 1725 extension: "ext_validation_features", 1726 restriction: crate::instance::ExtensionRestriction::NotSupported, 1727 }); 1728 } 1729 } 1730 if self.ext_validation_flags { 1731 if !supported.ext_validation_flags { 1732 return Err(crate::instance::ExtensionRestrictionError { 1733 extension: "ext_validation_flags", 1734 restriction: crate::instance::ExtensionRestriction::NotSupported, 1735 }); 1736 } 1737 } 1738 if self.fuchsia_imagepipe_surface { 1739 if !supported.fuchsia_imagepipe_surface { 1740 return Err(crate::instance::ExtensionRestrictionError { 1741 extension: "fuchsia_imagepipe_surface", 1742 restriction: crate::instance::ExtensionRestriction::NotSupported, 1743 }); 1744 } 1745 if !(instance_extensions.khr_surface) { 1746 return Err(crate::instance::ExtensionRestrictionError { 1747 extension: "fuchsia_imagepipe_surface", 1748 restriction: crate::instance::ExtensionRestriction::Requires( 1749 crate::RequiresOneOf { 1750 api_version: None, 1751 device_extensions: &[], 1752 instance_extensions: &["khr_surface"], 1753 ..Default::default() 1754 }, 1755 ), 1756 }); 1757 } 1758 } 1759 if self.ggp_stream_descriptor_surface { 1760 if !supported.ggp_stream_descriptor_surface { 1761 return Err(crate::instance::ExtensionRestrictionError { 1762 extension: "ggp_stream_descriptor_surface", 1763 restriction: crate::instance::ExtensionRestriction::NotSupported, 1764 }); 1765 } 1766 if !(instance_extensions.khr_surface) { 1767 return Err(crate::instance::ExtensionRestrictionError { 1768 extension: "ggp_stream_descriptor_surface", 1769 restriction: crate::instance::ExtensionRestriction::Requires( 1770 crate::RequiresOneOf { 1771 api_version: None, 1772 device_extensions: &[], 1773 instance_extensions: &["khr_surface"], 1774 ..Default::default() 1775 }, 1776 ), 1777 }); 1778 } 1779 } 1780 if self.google_surfaceless_query { 1781 if !supported.google_surfaceless_query { 1782 return Err(crate::instance::ExtensionRestrictionError { 1783 extension: "google_surfaceless_query", 1784 restriction: crate::instance::ExtensionRestriction::NotSupported, 1785 }); 1786 } 1787 if !(instance_extensions.khr_surface) { 1788 return Err(crate::instance::ExtensionRestrictionError { 1789 extension: "google_surfaceless_query", 1790 restriction: crate::instance::ExtensionRestriction::Requires( 1791 crate::RequiresOneOf { 1792 api_version: None, 1793 device_extensions: &[], 1794 instance_extensions: &["khr_surface"], 1795 ..Default::default() 1796 }, 1797 ), 1798 }); 1799 } 1800 } 1801 if self.lunarg_direct_driver_loading { 1802 if !supported.lunarg_direct_driver_loading { 1803 return Err(crate::instance::ExtensionRestrictionError { 1804 extension: "lunarg_direct_driver_loading", 1805 restriction: crate::instance::ExtensionRestriction::NotSupported, 1806 }); 1807 } 1808 } 1809 if self.mvk_ios_surface { 1810 if !supported.mvk_ios_surface { 1811 return Err(crate::instance::ExtensionRestrictionError { 1812 extension: "mvk_ios_surface", 1813 restriction: crate::instance::ExtensionRestriction::NotSupported, 1814 }); 1815 } 1816 if !(instance_extensions.khr_surface) { 1817 return Err(crate::instance::ExtensionRestrictionError { 1818 extension: "mvk_ios_surface", 1819 restriction: crate::instance::ExtensionRestriction::Requires( 1820 crate::RequiresOneOf { 1821 api_version: None, 1822 device_extensions: &[], 1823 instance_extensions: &["khr_surface"], 1824 ..Default::default() 1825 }, 1826 ), 1827 }); 1828 } 1829 } 1830 if self.mvk_macos_surface { 1831 if !supported.mvk_macos_surface { 1832 return Err(crate::instance::ExtensionRestrictionError { 1833 extension: "mvk_macos_surface", 1834 restriction: crate::instance::ExtensionRestriction::NotSupported, 1835 }); 1836 } 1837 if !(instance_extensions.khr_surface) { 1838 return Err(crate::instance::ExtensionRestrictionError { 1839 extension: "mvk_macos_surface", 1840 restriction: crate::instance::ExtensionRestriction::Requires( 1841 crate::RequiresOneOf { 1842 api_version: None, 1843 device_extensions: &[], 1844 instance_extensions: &["khr_surface"], 1845 ..Default::default() 1846 }, 1847 ), 1848 }); 1849 } 1850 } 1851 if self.nn_vi_surface { 1852 if !supported.nn_vi_surface { 1853 return Err(crate::instance::ExtensionRestrictionError { 1854 extension: "nn_vi_surface", 1855 restriction: crate::instance::ExtensionRestriction::NotSupported, 1856 }); 1857 } 1858 if !(instance_extensions.khr_surface) { 1859 return Err(crate::instance::ExtensionRestrictionError { 1860 extension: "nn_vi_surface", 1861 restriction: crate::instance::ExtensionRestriction::Requires( 1862 crate::RequiresOneOf { 1863 api_version: None, 1864 device_extensions: &[], 1865 instance_extensions: &["khr_surface"], 1866 ..Default::default() 1867 }, 1868 ), 1869 }); 1870 } 1871 } 1872 if self.nv_external_memory_capabilities { 1873 if !supported.nv_external_memory_capabilities { 1874 return Err(crate::instance::ExtensionRestrictionError { 1875 extension: "nv_external_memory_capabilities", 1876 restriction: crate::instance::ExtensionRestriction::NotSupported, 1877 }); 1878 } 1879 } 1880 if self.qnx_screen_surface { 1881 if !supported.qnx_screen_surface { 1882 return Err(crate::instance::ExtensionRestrictionError { 1883 extension: "qnx_screen_surface", 1884 restriction: crate::instance::ExtensionRestriction::NotSupported, 1885 }); 1886 } 1887 if !(instance_extensions.khr_surface) { 1888 return Err(crate::instance::ExtensionRestrictionError { 1889 extension: "qnx_screen_surface", 1890 restriction: crate::instance::ExtensionRestriction::Requires( 1891 crate::RequiresOneOf { 1892 api_version: None, 1893 device_extensions: &[], 1894 instance_extensions: &["khr_surface"], 1895 ..Default::default() 1896 }, 1897 ), 1898 }); 1899 } 1900 } 1901 Ok(()) 1902 } 1903 } 1904