| // This file is auto-generated by vulkano autogen from vk.xml header version 1.3.238. |
| // It should not be edited manually. Changes should be made by editing autogen. |
| |
| #[doc = r" List of extensions that are enabled or available."] |
| #[derive(Copy, Clone, PartialEq, Eq)] |
| pub struct InstanceExtensions { |
| #[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)"] |
| pub khr_android_surface: bool, |
| #[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"] |
| pub khr_device_group_creation: bool, |
| #[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)"] |
| pub khr_display: bool, |
| #[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)"] |
| pub khr_external_fence_capabilities: bool, |
| #[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)"] |
| pub khr_external_memory_capabilities: bool, |
| #[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)"] |
| pub khr_external_semaphore_capabilities: bool, |
| #[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)"] |
| pub khr_get_display_properties2: bool, |
| #[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"] |
| pub khr_get_physical_device_properties2: bool, |
| #[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)"] |
| pub khr_get_surface_capabilities2: bool, |
| #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_portability_enumeration.html)"] |
| pub khr_portability_enumeration: bool, |
| #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html)"] |
| pub khr_surface: bool, |
| #[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)"] |
| pub khr_surface_protected_capabilities: bool, |
| #[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)"] |
| pub khr_wayland_surface: bool, |
| #[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)"] |
| pub khr_win32_surface: bool, |
| #[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)"] |
| pub khr_xcb_surface: bool, |
| #[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)"] |
| pub khr_xlib_surface: bool, |
| #[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)"] |
| pub ext_acquire_drm_display: bool, |
| #[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)"] |
| pub ext_acquire_xlib_display: bool, |
| #[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)"] |
| pub ext_debug_report: bool, |
| #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_utils.html)"] |
| pub ext_debug_utils: bool, |
| #[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)"] |
| pub ext_direct_mode_display: bool, |
| #[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)"] |
| pub ext_directfb_surface: bool, |
| #[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)"] |
| pub ext_display_surface_counter: bool, |
| #[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)"] |
| pub ext_headless_surface: bool, |
| #[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)"] |
| pub ext_metal_surface: bool, |
| #[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)"] |
| pub ext_surface_maintenance1: bool, |
| #[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)"] |
| pub ext_swapchain_colorspace: bool, |
| #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_validation_features.html)"] |
| pub ext_validation_features: bool, |
| #[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)"] |
| pub ext_validation_flags: bool, |
| #[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)"] |
| pub fuchsia_imagepipe_surface: bool, |
| #[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)"] |
| pub ggp_stream_descriptor_surface: bool, |
| #[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)"] |
| pub google_surfaceless_query: bool, |
| #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_LUNARG_direct_driver_loading.html)"] |
| pub lunarg_direct_driver_loading: bool, |
| #[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)"] |
| pub mvk_ios_surface: bool, |
| #[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)"] |
| pub mvk_macos_surface: bool, |
| #[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)"] |
| pub nn_vi_surface: bool, |
| #[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)"] |
| pub nv_external_memory_capabilities: bool, |
| #[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)"] |
| pub qnx_screen_surface: bool, |
| pub _ne: crate::NonExhaustive, |
| } |
| impl Default for InstanceExtensions { |
| #[inline] |
| fn default() -> Self { |
| Self::empty() |
| } |
| } |
| impl InstanceExtensions { |
| #[doc = r" Returns an `Extensions` object with none of the members set."] |
| #[inline] |
| pub const fn empty() -> Self { |
| Self { |
| khr_android_surface: false, |
| khr_device_group_creation: false, |
| khr_display: false, |
| khr_external_fence_capabilities: false, |
| khr_external_memory_capabilities: false, |
| khr_external_semaphore_capabilities: false, |
| khr_get_display_properties2: false, |
| khr_get_physical_device_properties2: false, |
| khr_get_surface_capabilities2: false, |
| khr_portability_enumeration: false, |
| khr_surface: false, |
| khr_surface_protected_capabilities: false, |
| khr_wayland_surface: false, |
| khr_win32_surface: false, |
| khr_xcb_surface: false, |
| khr_xlib_surface: false, |
| ext_acquire_drm_display: false, |
| ext_acquire_xlib_display: false, |
| ext_debug_report: false, |
| ext_debug_utils: false, |
| ext_direct_mode_display: false, |
| ext_directfb_surface: false, |
| ext_display_surface_counter: false, |
| ext_headless_surface: false, |
| ext_metal_surface: false, |
| ext_surface_maintenance1: false, |
| ext_swapchain_colorspace: false, |
| ext_validation_features: false, |
| ext_validation_flags: false, |
| fuchsia_imagepipe_surface: false, |
| ggp_stream_descriptor_surface: false, |
| google_surfaceless_query: false, |
| lunarg_direct_driver_loading: false, |
| mvk_ios_surface: false, |
| mvk_macos_surface: false, |
| nn_vi_surface: false, |
| nv_external_memory_capabilities: false, |
| qnx_screen_surface: false, |
| _ne: crate::NonExhaustive(()), |
| } |
| } |
| #[doc = r" Returns an `Extensions` object with none of the members set."] |
| #[deprecated(since = "0.31.0", note = "Use `empty` instead.")] |
| #[inline] |
| pub const fn none() -> Self { |
| Self::empty() |
| } |
| #[doc = r" Returns whether any members are set in both `self` and `other`."] |
| #[inline] |
| pub const fn intersects(&self, other: &Self) -> bool { |
| (self.khr_android_surface && other.khr_android_surface) |
| || (self.khr_device_group_creation && other.khr_device_group_creation) |
| || (self.khr_display && other.khr_display) |
| || (self.khr_external_fence_capabilities && other.khr_external_fence_capabilities) |
| || (self.khr_external_memory_capabilities && other.khr_external_memory_capabilities) |
| || (self.khr_external_semaphore_capabilities |
| && other.khr_external_semaphore_capabilities) |
| || (self.khr_get_display_properties2 && other.khr_get_display_properties2) |
| || (self.khr_get_physical_device_properties2 |
| && other.khr_get_physical_device_properties2) |
| || (self.khr_get_surface_capabilities2 && other.khr_get_surface_capabilities2) |
| || (self.khr_portability_enumeration && other.khr_portability_enumeration) |
| || (self.khr_surface && other.khr_surface) |
| || (self.khr_surface_protected_capabilities && other.khr_surface_protected_capabilities) |
| || (self.khr_wayland_surface && other.khr_wayland_surface) |
| || (self.khr_win32_surface && other.khr_win32_surface) |
| || (self.khr_xcb_surface && other.khr_xcb_surface) |
| || (self.khr_xlib_surface && other.khr_xlib_surface) |
| || (self.ext_acquire_drm_display && other.ext_acquire_drm_display) |
| || (self.ext_acquire_xlib_display && other.ext_acquire_xlib_display) |
| || (self.ext_debug_report && other.ext_debug_report) |
| || (self.ext_debug_utils && other.ext_debug_utils) |
| || (self.ext_direct_mode_display && other.ext_direct_mode_display) |
| || (self.ext_directfb_surface && other.ext_directfb_surface) |
| || (self.ext_display_surface_counter && other.ext_display_surface_counter) |
| || (self.ext_headless_surface && other.ext_headless_surface) |
| || (self.ext_metal_surface && other.ext_metal_surface) |
| || (self.ext_surface_maintenance1 && other.ext_surface_maintenance1) |
| || (self.ext_swapchain_colorspace && other.ext_swapchain_colorspace) |
| || (self.ext_validation_features && other.ext_validation_features) |
| || (self.ext_validation_flags && other.ext_validation_flags) |
| || (self.fuchsia_imagepipe_surface && other.fuchsia_imagepipe_surface) |
| || (self.ggp_stream_descriptor_surface && other.ggp_stream_descriptor_surface) |
| || (self.google_surfaceless_query && other.google_surfaceless_query) |
| || (self.lunarg_direct_driver_loading && other.lunarg_direct_driver_loading) |
| || (self.mvk_ios_surface && other.mvk_ios_surface) |
| || (self.mvk_macos_surface && other.mvk_macos_surface) |
| || (self.nn_vi_surface && other.nn_vi_surface) |
| || (self.nv_external_memory_capabilities && other.nv_external_memory_capabilities) |
| || (self.qnx_screen_surface && other.qnx_screen_surface) |
| } |
| #[doc = r" Returns whether all members in `other` are set in `self`."] |
| #[inline] |
| pub const fn contains(&self, other: &Self) -> bool { |
| (self.khr_android_surface || !other.khr_android_surface) |
| && (self.khr_device_group_creation || !other.khr_device_group_creation) |
| && (self.khr_display || !other.khr_display) |
| && (self.khr_external_fence_capabilities || !other.khr_external_fence_capabilities) |
| && (self.khr_external_memory_capabilities || !other.khr_external_memory_capabilities) |
| && (self.khr_external_semaphore_capabilities |
| || !other.khr_external_semaphore_capabilities) |
| && (self.khr_get_display_properties2 || !other.khr_get_display_properties2) |
| && (self.khr_get_physical_device_properties2 |
| || !other.khr_get_physical_device_properties2) |
| && (self.khr_get_surface_capabilities2 || !other.khr_get_surface_capabilities2) |
| && (self.khr_portability_enumeration || !other.khr_portability_enumeration) |
| && (self.khr_surface || !other.khr_surface) |
| && (self.khr_surface_protected_capabilities |
| || !other.khr_surface_protected_capabilities) |
| && (self.khr_wayland_surface || !other.khr_wayland_surface) |
| && (self.khr_win32_surface || !other.khr_win32_surface) |
| && (self.khr_xcb_surface || !other.khr_xcb_surface) |
| && (self.khr_xlib_surface || !other.khr_xlib_surface) |
| && (self.ext_acquire_drm_display || !other.ext_acquire_drm_display) |
| && (self.ext_acquire_xlib_display || !other.ext_acquire_xlib_display) |
| && (self.ext_debug_report || !other.ext_debug_report) |
| && (self.ext_debug_utils || !other.ext_debug_utils) |
| && (self.ext_direct_mode_display || !other.ext_direct_mode_display) |
| && (self.ext_directfb_surface || !other.ext_directfb_surface) |
| && (self.ext_display_surface_counter || !other.ext_display_surface_counter) |
| && (self.ext_headless_surface || !other.ext_headless_surface) |
| && (self.ext_metal_surface || !other.ext_metal_surface) |
| && (self.ext_surface_maintenance1 || !other.ext_surface_maintenance1) |
| && (self.ext_swapchain_colorspace || !other.ext_swapchain_colorspace) |
| && (self.ext_validation_features || !other.ext_validation_features) |
| && (self.ext_validation_flags || !other.ext_validation_flags) |
| && (self.fuchsia_imagepipe_surface || !other.fuchsia_imagepipe_surface) |
| && (self.ggp_stream_descriptor_surface || !other.ggp_stream_descriptor_surface) |
| && (self.google_surfaceless_query || !other.google_surfaceless_query) |
| && (self.lunarg_direct_driver_loading || !other.lunarg_direct_driver_loading) |
| && (self.mvk_ios_surface || !other.mvk_ios_surface) |
| && (self.mvk_macos_surface || !other.mvk_macos_surface) |
| && (self.nn_vi_surface || !other.nn_vi_surface) |
| && (self.nv_external_memory_capabilities || !other.nv_external_memory_capabilities) |
| && (self.qnx_screen_surface || !other.qnx_screen_surface) |
| } |
| #[doc = r" Returns whether all members in `other` are set in `self`."] |
| #[deprecated(since = "0.31.0", note = "Use `contains` instead.")] |
| #[inline] |
| pub const fn is_superset_of(&self, other: &Self) -> bool { |
| self.contains(other) |
| } |
| #[doc = r" Returns the union of `self` and `other`."] |
| #[inline] |
| pub const fn union(&self, other: &Self) -> Self { |
| Self { |
| khr_android_surface: self.khr_android_surface || other.khr_android_surface, |
| khr_device_group_creation: self.khr_device_group_creation |
| || other.khr_device_group_creation, |
| khr_display: self.khr_display || other.khr_display, |
| khr_external_fence_capabilities: self.khr_external_fence_capabilities |
| || other.khr_external_fence_capabilities, |
| khr_external_memory_capabilities: self.khr_external_memory_capabilities |
| || other.khr_external_memory_capabilities, |
| khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities |
| || other.khr_external_semaphore_capabilities, |
| khr_get_display_properties2: self.khr_get_display_properties2 |
| || other.khr_get_display_properties2, |
| khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 |
| || other.khr_get_physical_device_properties2, |
| khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 |
| || other.khr_get_surface_capabilities2, |
| khr_portability_enumeration: self.khr_portability_enumeration |
| || other.khr_portability_enumeration, |
| khr_surface: self.khr_surface || other.khr_surface, |
| khr_surface_protected_capabilities: self.khr_surface_protected_capabilities |
| || other.khr_surface_protected_capabilities, |
| khr_wayland_surface: self.khr_wayland_surface || other.khr_wayland_surface, |
| khr_win32_surface: self.khr_win32_surface || other.khr_win32_surface, |
| khr_xcb_surface: self.khr_xcb_surface || other.khr_xcb_surface, |
| khr_xlib_surface: self.khr_xlib_surface || other.khr_xlib_surface, |
| ext_acquire_drm_display: self.ext_acquire_drm_display || other.ext_acquire_drm_display, |
| ext_acquire_xlib_display: self.ext_acquire_xlib_display |
| || other.ext_acquire_xlib_display, |
| ext_debug_report: self.ext_debug_report || other.ext_debug_report, |
| ext_debug_utils: self.ext_debug_utils || other.ext_debug_utils, |
| ext_direct_mode_display: self.ext_direct_mode_display || other.ext_direct_mode_display, |
| ext_directfb_surface: self.ext_directfb_surface || other.ext_directfb_surface, |
| ext_display_surface_counter: self.ext_display_surface_counter |
| || other.ext_display_surface_counter, |
| ext_headless_surface: self.ext_headless_surface || other.ext_headless_surface, |
| ext_metal_surface: self.ext_metal_surface || other.ext_metal_surface, |
| ext_surface_maintenance1: self.ext_surface_maintenance1 |
| || other.ext_surface_maintenance1, |
| ext_swapchain_colorspace: self.ext_swapchain_colorspace |
| || other.ext_swapchain_colorspace, |
| ext_validation_features: self.ext_validation_features || other.ext_validation_features, |
| ext_validation_flags: self.ext_validation_flags || other.ext_validation_flags, |
| fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface |
| || other.fuchsia_imagepipe_surface, |
| ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface |
| || other.ggp_stream_descriptor_surface, |
| google_surfaceless_query: self.google_surfaceless_query |
| || other.google_surfaceless_query, |
| lunarg_direct_driver_loading: self.lunarg_direct_driver_loading |
| || other.lunarg_direct_driver_loading, |
| mvk_ios_surface: self.mvk_ios_surface || other.mvk_ios_surface, |
| mvk_macos_surface: self.mvk_macos_surface || other.mvk_macos_surface, |
| nn_vi_surface: self.nn_vi_surface || other.nn_vi_surface, |
| nv_external_memory_capabilities: self.nv_external_memory_capabilities |
| || other.nv_external_memory_capabilities, |
| qnx_screen_surface: self.qnx_screen_surface || other.qnx_screen_surface, |
| _ne: crate::NonExhaustive(()), |
| } |
| } |
| #[doc = r" Returns the intersection of `self` and `other`."] |
| #[inline] |
| pub const fn intersection(&self, other: &Self) -> Self { |
| Self { |
| khr_android_surface: self.khr_android_surface && other.khr_android_surface, |
| khr_device_group_creation: self.khr_device_group_creation |
| && other.khr_device_group_creation, |
| khr_display: self.khr_display && other.khr_display, |
| khr_external_fence_capabilities: self.khr_external_fence_capabilities |
| && other.khr_external_fence_capabilities, |
| khr_external_memory_capabilities: self.khr_external_memory_capabilities |
| && other.khr_external_memory_capabilities, |
| khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities |
| && other.khr_external_semaphore_capabilities, |
| khr_get_display_properties2: self.khr_get_display_properties2 |
| && other.khr_get_display_properties2, |
| khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 |
| && other.khr_get_physical_device_properties2, |
| khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 |
| && other.khr_get_surface_capabilities2, |
| khr_portability_enumeration: self.khr_portability_enumeration |
| && other.khr_portability_enumeration, |
| khr_surface: self.khr_surface && other.khr_surface, |
| khr_surface_protected_capabilities: self.khr_surface_protected_capabilities |
| && other.khr_surface_protected_capabilities, |
| khr_wayland_surface: self.khr_wayland_surface && other.khr_wayland_surface, |
| khr_win32_surface: self.khr_win32_surface && other.khr_win32_surface, |
| khr_xcb_surface: self.khr_xcb_surface && other.khr_xcb_surface, |
| khr_xlib_surface: self.khr_xlib_surface && other.khr_xlib_surface, |
| ext_acquire_drm_display: self.ext_acquire_drm_display && other.ext_acquire_drm_display, |
| ext_acquire_xlib_display: self.ext_acquire_xlib_display |
| && other.ext_acquire_xlib_display, |
| ext_debug_report: self.ext_debug_report && other.ext_debug_report, |
| ext_debug_utils: self.ext_debug_utils && other.ext_debug_utils, |
| ext_direct_mode_display: self.ext_direct_mode_display && other.ext_direct_mode_display, |
| ext_directfb_surface: self.ext_directfb_surface && other.ext_directfb_surface, |
| ext_display_surface_counter: self.ext_display_surface_counter |
| && other.ext_display_surface_counter, |
| ext_headless_surface: self.ext_headless_surface && other.ext_headless_surface, |
| ext_metal_surface: self.ext_metal_surface && other.ext_metal_surface, |
| ext_surface_maintenance1: self.ext_surface_maintenance1 |
| && other.ext_surface_maintenance1, |
| ext_swapchain_colorspace: self.ext_swapchain_colorspace |
| && other.ext_swapchain_colorspace, |
| ext_validation_features: self.ext_validation_features && other.ext_validation_features, |
| ext_validation_flags: self.ext_validation_flags && other.ext_validation_flags, |
| fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface |
| && other.fuchsia_imagepipe_surface, |
| ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface |
| && other.ggp_stream_descriptor_surface, |
| google_surfaceless_query: self.google_surfaceless_query |
| && other.google_surfaceless_query, |
| lunarg_direct_driver_loading: self.lunarg_direct_driver_loading |
| && other.lunarg_direct_driver_loading, |
| mvk_ios_surface: self.mvk_ios_surface && other.mvk_ios_surface, |
| mvk_macos_surface: self.mvk_macos_surface && other.mvk_macos_surface, |
| nn_vi_surface: self.nn_vi_surface && other.nn_vi_surface, |
| nv_external_memory_capabilities: self.nv_external_memory_capabilities |
| && other.nv_external_memory_capabilities, |
| qnx_screen_surface: self.qnx_screen_surface && other.qnx_screen_surface, |
| _ne: crate::NonExhaustive(()), |
| } |
| } |
| #[doc = r" Returns `self` without the members set in `other`."] |
| #[inline] |
| pub const fn difference(&self, other: &Self) -> Self { |
| Self { |
| khr_android_surface: self.khr_android_surface && !other.khr_android_surface, |
| khr_device_group_creation: self.khr_device_group_creation |
| && !other.khr_device_group_creation, |
| khr_display: self.khr_display && !other.khr_display, |
| khr_external_fence_capabilities: self.khr_external_fence_capabilities |
| && !other.khr_external_fence_capabilities, |
| khr_external_memory_capabilities: self.khr_external_memory_capabilities |
| && !other.khr_external_memory_capabilities, |
| khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities |
| && !other.khr_external_semaphore_capabilities, |
| khr_get_display_properties2: self.khr_get_display_properties2 |
| && !other.khr_get_display_properties2, |
| khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 |
| && !other.khr_get_physical_device_properties2, |
| khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 |
| && !other.khr_get_surface_capabilities2, |
| khr_portability_enumeration: self.khr_portability_enumeration |
| && !other.khr_portability_enumeration, |
| khr_surface: self.khr_surface && !other.khr_surface, |
| khr_surface_protected_capabilities: self.khr_surface_protected_capabilities |
| && !other.khr_surface_protected_capabilities, |
| khr_wayland_surface: self.khr_wayland_surface && !other.khr_wayland_surface, |
| khr_win32_surface: self.khr_win32_surface && !other.khr_win32_surface, |
| khr_xcb_surface: self.khr_xcb_surface && !other.khr_xcb_surface, |
| khr_xlib_surface: self.khr_xlib_surface && !other.khr_xlib_surface, |
| ext_acquire_drm_display: self.ext_acquire_drm_display && !other.ext_acquire_drm_display, |
| ext_acquire_xlib_display: self.ext_acquire_xlib_display |
| && !other.ext_acquire_xlib_display, |
| ext_debug_report: self.ext_debug_report && !other.ext_debug_report, |
| ext_debug_utils: self.ext_debug_utils && !other.ext_debug_utils, |
| ext_direct_mode_display: self.ext_direct_mode_display && !other.ext_direct_mode_display, |
| ext_directfb_surface: self.ext_directfb_surface && !other.ext_directfb_surface, |
| ext_display_surface_counter: self.ext_display_surface_counter |
| && !other.ext_display_surface_counter, |
| ext_headless_surface: self.ext_headless_surface && !other.ext_headless_surface, |
| ext_metal_surface: self.ext_metal_surface && !other.ext_metal_surface, |
| ext_surface_maintenance1: self.ext_surface_maintenance1 |
| && !other.ext_surface_maintenance1, |
| ext_swapchain_colorspace: self.ext_swapchain_colorspace |
| && !other.ext_swapchain_colorspace, |
| ext_validation_features: self.ext_validation_features && !other.ext_validation_features, |
| ext_validation_flags: self.ext_validation_flags && !other.ext_validation_flags, |
| fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface |
| && !other.fuchsia_imagepipe_surface, |
| ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface |
| && !other.ggp_stream_descriptor_surface, |
| google_surfaceless_query: self.google_surfaceless_query |
| && !other.google_surfaceless_query, |
| lunarg_direct_driver_loading: self.lunarg_direct_driver_loading |
| && !other.lunarg_direct_driver_loading, |
| mvk_ios_surface: self.mvk_ios_surface && !other.mvk_ios_surface, |
| mvk_macos_surface: self.mvk_macos_surface && !other.mvk_macos_surface, |
| nn_vi_surface: self.nn_vi_surface && !other.nn_vi_surface, |
| nv_external_memory_capabilities: self.nv_external_memory_capabilities |
| && !other.nv_external_memory_capabilities, |
| qnx_screen_surface: self.qnx_screen_surface && !other.qnx_screen_surface, |
| _ne: crate::NonExhaustive(()), |
| } |
| } |
| #[doc = r" Returns the members set in `self` or `other`, but not both."] |
| #[inline] |
| pub const fn symmetric_difference(&self, other: &Self) -> Self { |
| Self { |
| khr_android_surface: self.khr_android_surface ^ other.khr_android_surface, |
| khr_device_group_creation: self.khr_device_group_creation |
| ^ other.khr_device_group_creation, |
| khr_display: self.khr_display ^ other.khr_display, |
| khr_external_fence_capabilities: self.khr_external_fence_capabilities |
| ^ other.khr_external_fence_capabilities, |
| khr_external_memory_capabilities: self.khr_external_memory_capabilities |
| ^ other.khr_external_memory_capabilities, |
| khr_external_semaphore_capabilities: self.khr_external_semaphore_capabilities |
| ^ other.khr_external_semaphore_capabilities, |
| khr_get_display_properties2: self.khr_get_display_properties2 |
| ^ other.khr_get_display_properties2, |
| khr_get_physical_device_properties2: self.khr_get_physical_device_properties2 |
| ^ other.khr_get_physical_device_properties2, |
| khr_get_surface_capabilities2: self.khr_get_surface_capabilities2 |
| ^ other.khr_get_surface_capabilities2, |
| khr_portability_enumeration: self.khr_portability_enumeration |
| ^ other.khr_portability_enumeration, |
| khr_surface: self.khr_surface ^ other.khr_surface, |
| khr_surface_protected_capabilities: self.khr_surface_protected_capabilities |
| ^ other.khr_surface_protected_capabilities, |
| khr_wayland_surface: self.khr_wayland_surface ^ other.khr_wayland_surface, |
| khr_win32_surface: self.khr_win32_surface ^ other.khr_win32_surface, |
| khr_xcb_surface: self.khr_xcb_surface ^ other.khr_xcb_surface, |
| khr_xlib_surface: self.khr_xlib_surface ^ other.khr_xlib_surface, |
| ext_acquire_drm_display: self.ext_acquire_drm_display ^ other.ext_acquire_drm_display, |
| ext_acquire_xlib_display: self.ext_acquire_xlib_display |
| ^ other.ext_acquire_xlib_display, |
| ext_debug_report: self.ext_debug_report ^ other.ext_debug_report, |
| ext_debug_utils: self.ext_debug_utils ^ other.ext_debug_utils, |
| ext_direct_mode_display: self.ext_direct_mode_display ^ other.ext_direct_mode_display, |
| ext_directfb_surface: self.ext_directfb_surface ^ other.ext_directfb_surface, |
| ext_display_surface_counter: self.ext_display_surface_counter |
| ^ other.ext_display_surface_counter, |
| ext_headless_surface: self.ext_headless_surface ^ other.ext_headless_surface, |
| ext_metal_surface: self.ext_metal_surface ^ other.ext_metal_surface, |
| ext_surface_maintenance1: self.ext_surface_maintenance1 |
| ^ other.ext_surface_maintenance1, |
| ext_swapchain_colorspace: self.ext_swapchain_colorspace |
| ^ other.ext_swapchain_colorspace, |
| ext_validation_features: self.ext_validation_features ^ other.ext_validation_features, |
| ext_validation_flags: self.ext_validation_flags ^ other.ext_validation_flags, |
| fuchsia_imagepipe_surface: self.fuchsia_imagepipe_surface |
| ^ other.fuchsia_imagepipe_surface, |
| ggp_stream_descriptor_surface: self.ggp_stream_descriptor_surface |
| ^ other.ggp_stream_descriptor_surface, |
| google_surfaceless_query: self.google_surfaceless_query |
| ^ other.google_surfaceless_query, |
| lunarg_direct_driver_loading: self.lunarg_direct_driver_loading |
| ^ other.lunarg_direct_driver_loading, |
| mvk_ios_surface: self.mvk_ios_surface ^ other.mvk_ios_surface, |
| mvk_macos_surface: self.mvk_macos_surface ^ other.mvk_macos_surface, |
| nn_vi_surface: self.nn_vi_surface ^ other.nn_vi_surface, |
| nv_external_memory_capabilities: self.nv_external_memory_capabilities |
| ^ other.nv_external_memory_capabilities, |
| qnx_screen_surface: self.qnx_screen_surface ^ other.qnx_screen_surface, |
| _ne: crate::NonExhaustive(()), |
| } |
| } |
| } |
| impl std::ops::BitAnd for InstanceExtensions { |
| type Output = InstanceExtensions; |
| #[inline] |
| fn bitand(self, rhs: Self) -> Self::Output { |
| self.union(&rhs) |
| } |
| } |
| impl std::ops::BitAndAssign for InstanceExtensions { |
| #[inline] |
| fn bitand_assign(&mut self, rhs: Self) { |
| *self = self.union(&rhs); |
| } |
| } |
| impl std::ops::BitOr for InstanceExtensions { |
| type Output = InstanceExtensions; |
| #[inline] |
| fn bitor(self, rhs: Self) -> Self::Output { |
| self.intersection(&rhs) |
| } |
| } |
| impl std::ops::BitOrAssign for InstanceExtensions { |
| #[inline] |
| fn bitor_assign(&mut self, rhs: Self) { |
| *self = self.intersection(&rhs); |
| } |
| } |
| impl std::ops::BitXor for InstanceExtensions { |
| type Output = InstanceExtensions; |
| #[inline] |
| fn bitxor(self, rhs: Self) -> Self::Output { |
| self.symmetric_difference(&rhs) |
| } |
| } |
| impl std::ops::BitXorAssign for InstanceExtensions { |
| #[inline] |
| fn bitxor_assign(&mut self, rhs: Self) { |
| *self = self.symmetric_difference(&rhs); |
| } |
| } |
| impl std::ops::Sub for InstanceExtensions { |
| type Output = InstanceExtensions; |
| #[inline] |
| fn sub(self, rhs: Self) -> Self::Output { |
| self.difference(&rhs) |
| } |
| } |
| impl std::ops::SubAssign for InstanceExtensions { |
| #[inline] |
| fn sub_assign(&mut self, rhs: Self) { |
| *self = self.difference(&rhs); |
| } |
| } |
| impl std::fmt::Debug for InstanceExtensions { |
| #[allow(unused_assignments)] |
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { |
| write!(f, "[")?; |
| let mut first = true; |
| if self.khr_android_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_android_surface")?; |
| } |
| if self.khr_device_group_creation { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_device_group_creation")?; |
| } |
| if self.khr_display { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_display")?; |
| } |
| if self.khr_external_fence_capabilities { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_external_fence_capabilities")?; |
| } |
| if self.khr_external_memory_capabilities { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_external_memory_capabilities")?; |
| } |
| if self.khr_external_semaphore_capabilities { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_external_semaphore_capabilities")?; |
| } |
| if self.khr_get_display_properties2 { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_get_display_properties2")?; |
| } |
| if self.khr_get_physical_device_properties2 { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_get_physical_device_properties2")?; |
| } |
| if self.khr_get_surface_capabilities2 { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_get_surface_capabilities2")?; |
| } |
| if self.khr_portability_enumeration { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_portability_enumeration")?; |
| } |
| if self.khr_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_surface")?; |
| } |
| if self.khr_surface_protected_capabilities { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_surface_protected_capabilities")?; |
| } |
| if self.khr_wayland_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_wayland_surface")?; |
| } |
| if self.khr_win32_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_win32_surface")?; |
| } |
| if self.khr_xcb_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_xcb_surface")?; |
| } |
| if self.khr_xlib_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_KHR_xlib_surface")?; |
| } |
| if self.ext_acquire_drm_display { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_acquire_drm_display")?; |
| } |
| if self.ext_acquire_xlib_display { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_acquire_xlib_display")?; |
| } |
| if self.ext_debug_report { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_debug_report")?; |
| } |
| if self.ext_debug_utils { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_debug_utils")?; |
| } |
| if self.ext_direct_mode_display { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_direct_mode_display")?; |
| } |
| if self.ext_directfb_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_directfb_surface")?; |
| } |
| if self.ext_display_surface_counter { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_display_surface_counter")?; |
| } |
| if self.ext_headless_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_headless_surface")?; |
| } |
| if self.ext_metal_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_metal_surface")?; |
| } |
| if self.ext_surface_maintenance1 { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_surface_maintenance1")?; |
| } |
| if self.ext_swapchain_colorspace { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_swapchain_colorspace")?; |
| } |
| if self.ext_validation_features { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_validation_features")?; |
| } |
| if self.ext_validation_flags { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_EXT_validation_flags")?; |
| } |
| if self.fuchsia_imagepipe_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_FUCHSIA_imagepipe_surface")?; |
| } |
| if self.ggp_stream_descriptor_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_GGP_stream_descriptor_surface")?; |
| } |
| if self.google_surfaceless_query { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_GOOGLE_surfaceless_query")?; |
| } |
| if self.lunarg_direct_driver_loading { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_LUNARG_direct_driver_loading")?; |
| } |
| if self.mvk_ios_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_MVK_ios_surface")?; |
| } |
| if self.mvk_macos_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_MVK_macos_surface")?; |
| } |
| if self.nn_vi_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_NN_vi_surface")?; |
| } |
| if self.nv_external_memory_capabilities { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_NV_external_memory_capabilities")?; |
| } |
| if self.qnx_screen_surface { |
| if !first { |
| write!(f, ", ")? |
| } else { |
| first = false; |
| } |
| f.write_str("VK_QNX_screen_surface")?; |
| } |
| write!(f, "]") |
| } |
| } |
| impl<'a> FromIterator<&'a str> for InstanceExtensions { |
| fn from_iter<I>(iter: I) -> Self |
| where |
| I: IntoIterator<Item = &'a str>, |
| { |
| let mut extensions = Self::empty(); |
| for name in iter { |
| match name { |
| "VK_KHR_android_surface" => { |
| extensions.khr_android_surface = true; |
| } |
| "VK_KHR_device_group_creation" => { |
| extensions.khr_device_group_creation = true; |
| } |
| "VK_KHR_display" => { |
| extensions.khr_display = true; |
| } |
| "VK_KHR_external_fence_capabilities" => { |
| extensions.khr_external_fence_capabilities = true; |
| } |
| "VK_KHR_external_memory_capabilities" => { |
| extensions.khr_external_memory_capabilities = true; |
| } |
| "VK_KHR_external_semaphore_capabilities" => { |
| extensions.khr_external_semaphore_capabilities = true; |
| } |
| "VK_KHR_get_display_properties2" => { |
| extensions.khr_get_display_properties2 = true; |
| } |
| "VK_KHR_get_physical_device_properties2" => { |
| extensions.khr_get_physical_device_properties2 = true; |
| } |
| "VK_KHR_get_surface_capabilities2" => { |
| extensions.khr_get_surface_capabilities2 = true; |
| } |
| "VK_KHR_portability_enumeration" => { |
| extensions.khr_portability_enumeration = true; |
| } |
| "VK_KHR_surface" => { |
| extensions.khr_surface = true; |
| } |
| "VK_KHR_surface_protected_capabilities" => { |
| extensions.khr_surface_protected_capabilities = true; |
| } |
| "VK_KHR_wayland_surface" => { |
| extensions.khr_wayland_surface = true; |
| } |
| "VK_KHR_win32_surface" => { |
| extensions.khr_win32_surface = true; |
| } |
| "VK_KHR_xcb_surface" => { |
| extensions.khr_xcb_surface = true; |
| } |
| "VK_KHR_xlib_surface" => { |
| extensions.khr_xlib_surface = true; |
| } |
| "VK_EXT_acquire_drm_display" => { |
| extensions.ext_acquire_drm_display = true; |
| } |
| "VK_EXT_acquire_xlib_display" => { |
| extensions.ext_acquire_xlib_display = true; |
| } |
| "VK_EXT_debug_report" => { |
| extensions.ext_debug_report = true; |
| } |
| "VK_EXT_debug_utils" => { |
| extensions.ext_debug_utils = true; |
| } |
| "VK_EXT_direct_mode_display" => { |
| extensions.ext_direct_mode_display = true; |
| } |
| "VK_EXT_directfb_surface" => { |
| extensions.ext_directfb_surface = true; |
| } |
| "VK_EXT_display_surface_counter" => { |
| extensions.ext_display_surface_counter = true; |
| } |
| "VK_EXT_headless_surface" => { |
| extensions.ext_headless_surface = true; |
| } |
| "VK_EXT_metal_surface" => { |
| extensions.ext_metal_surface = true; |
| } |
| "VK_EXT_surface_maintenance1" => { |
| extensions.ext_surface_maintenance1 = true; |
| } |
| "VK_EXT_swapchain_colorspace" => { |
| extensions.ext_swapchain_colorspace = true; |
| } |
| "VK_EXT_validation_features" => { |
| extensions.ext_validation_features = true; |
| } |
| "VK_EXT_validation_flags" => { |
| extensions.ext_validation_flags = true; |
| } |
| "VK_FUCHSIA_imagepipe_surface" => { |
| extensions.fuchsia_imagepipe_surface = true; |
| } |
| "VK_GGP_stream_descriptor_surface" => { |
| extensions.ggp_stream_descriptor_surface = true; |
| } |
| "VK_GOOGLE_surfaceless_query" => { |
| extensions.google_surfaceless_query = true; |
| } |
| "VK_LUNARG_direct_driver_loading" => { |
| extensions.lunarg_direct_driver_loading = true; |
| } |
| "VK_MVK_ios_surface" => { |
| extensions.mvk_ios_surface = true; |
| } |
| "VK_MVK_macos_surface" => { |
| extensions.mvk_macos_surface = true; |
| } |
| "VK_NN_vi_surface" => { |
| extensions.nn_vi_surface = true; |
| } |
| "VK_NV_external_memory_capabilities" => { |
| extensions.nv_external_memory_capabilities = true; |
| } |
| "VK_QNX_screen_surface" => { |
| extensions.qnx_screen_surface = true; |
| } |
| _ => (), |
| } |
| } |
| extensions |
| } |
| } |
| impl<'a> From<&'a InstanceExtensions> for Vec<std::ffi::CString> { |
| fn from(x: &'a InstanceExtensions) -> Self { |
| let mut data = Self::new(); |
| if x.khr_android_surface { |
| data.push(std::ffi::CString::new("VK_KHR_android_surface").unwrap()); |
| } |
| if x.khr_device_group_creation { |
| data.push(std::ffi::CString::new("VK_KHR_device_group_creation").unwrap()); |
| } |
| if x.khr_display { |
| data.push(std::ffi::CString::new("VK_KHR_display").unwrap()); |
| } |
| if x.khr_external_fence_capabilities { |
| data.push(std::ffi::CString::new("VK_KHR_external_fence_capabilities").unwrap()); |
| } |
| if x.khr_external_memory_capabilities { |
| data.push(std::ffi::CString::new("VK_KHR_external_memory_capabilities").unwrap()); |
| } |
| if x.khr_external_semaphore_capabilities { |
| data.push(std::ffi::CString::new("VK_KHR_external_semaphore_capabilities").unwrap()); |
| } |
| if x.khr_get_display_properties2 { |
| data.push(std::ffi::CString::new("VK_KHR_get_display_properties2").unwrap()); |
| } |
| if x.khr_get_physical_device_properties2 { |
| data.push(std::ffi::CString::new("VK_KHR_get_physical_device_properties2").unwrap()); |
| } |
| if x.khr_get_surface_capabilities2 { |
| data.push(std::ffi::CString::new("VK_KHR_get_surface_capabilities2").unwrap()); |
| } |
| if x.khr_portability_enumeration { |
| data.push(std::ffi::CString::new("VK_KHR_portability_enumeration").unwrap()); |
| } |
| if x.khr_surface { |
| data.push(std::ffi::CString::new("VK_KHR_surface").unwrap()); |
| } |
| if x.khr_surface_protected_capabilities { |
| data.push(std::ffi::CString::new("VK_KHR_surface_protected_capabilities").unwrap()); |
| } |
| if x.khr_wayland_surface { |
| data.push(std::ffi::CString::new("VK_KHR_wayland_surface").unwrap()); |
| } |
| if x.khr_win32_surface { |
| data.push(std::ffi::CString::new("VK_KHR_win32_surface").unwrap()); |
| } |
| if x.khr_xcb_surface { |
| data.push(std::ffi::CString::new("VK_KHR_xcb_surface").unwrap()); |
| } |
| if x.khr_xlib_surface { |
| data.push(std::ffi::CString::new("VK_KHR_xlib_surface").unwrap()); |
| } |
| if x.ext_acquire_drm_display { |
| data.push(std::ffi::CString::new("VK_EXT_acquire_drm_display").unwrap()); |
| } |
| if x.ext_acquire_xlib_display { |
| data.push(std::ffi::CString::new("VK_EXT_acquire_xlib_display").unwrap()); |
| } |
| if x.ext_debug_report { |
| data.push(std::ffi::CString::new("VK_EXT_debug_report").unwrap()); |
| } |
| if x.ext_debug_utils { |
| data.push(std::ffi::CString::new("VK_EXT_debug_utils").unwrap()); |
| } |
| if x.ext_direct_mode_display { |
| data.push(std::ffi::CString::new("VK_EXT_direct_mode_display").unwrap()); |
| } |
| if x.ext_directfb_surface { |
| data.push(std::ffi::CString::new("VK_EXT_directfb_surface").unwrap()); |
| } |
| if x.ext_display_surface_counter { |
| data.push(std::ffi::CString::new("VK_EXT_display_surface_counter").unwrap()); |
| } |
| if x.ext_headless_surface { |
| data.push(std::ffi::CString::new("VK_EXT_headless_surface").unwrap()); |
| } |
| if x.ext_metal_surface { |
| data.push(std::ffi::CString::new("VK_EXT_metal_surface").unwrap()); |
| } |
| if x.ext_surface_maintenance1 { |
| data.push(std::ffi::CString::new("VK_EXT_surface_maintenance1").unwrap()); |
| } |
| if x.ext_swapchain_colorspace { |
| data.push(std::ffi::CString::new("VK_EXT_swapchain_colorspace").unwrap()); |
| } |
| if x.ext_validation_features { |
| data.push(std::ffi::CString::new("VK_EXT_validation_features").unwrap()); |
| } |
| if x.ext_validation_flags { |
| data.push(std::ffi::CString::new("VK_EXT_validation_flags").unwrap()); |
| } |
| if x.fuchsia_imagepipe_surface { |
| data.push(std::ffi::CString::new("VK_FUCHSIA_imagepipe_surface").unwrap()); |
| } |
| if x.ggp_stream_descriptor_surface { |
| data.push(std::ffi::CString::new("VK_GGP_stream_descriptor_surface").unwrap()); |
| } |
| if x.google_surfaceless_query { |
| data.push(std::ffi::CString::new("VK_GOOGLE_surfaceless_query").unwrap()); |
| } |
| if x.lunarg_direct_driver_loading { |
| data.push(std::ffi::CString::new("VK_LUNARG_direct_driver_loading").unwrap()); |
| } |
| if x.mvk_ios_surface { |
| data.push(std::ffi::CString::new("VK_MVK_ios_surface").unwrap()); |
| } |
| if x.mvk_macos_surface { |
| data.push(std::ffi::CString::new("VK_MVK_macos_surface").unwrap()); |
| } |
| if x.nn_vi_surface { |
| data.push(std::ffi::CString::new("VK_NN_vi_surface").unwrap()); |
| } |
| if x.nv_external_memory_capabilities { |
| data.push(std::ffi::CString::new("VK_NV_external_memory_capabilities").unwrap()); |
| } |
| if x.qnx_screen_surface { |
| data.push(std::ffi::CString::new("VK_QNX_screen_surface").unwrap()); |
| } |
| data |
| } |
| } |
| impl IntoIterator for InstanceExtensions { |
| type Item = (&'static str, bool); |
| type IntoIter = std::array::IntoIter<Self::Item, 38usize>; |
| #[inline] |
| fn into_iter(self) -> Self::IntoIter { |
| [ |
| ("VK_KHR_android_surface", self.khr_android_surface), |
| ( |
| "VK_KHR_device_group_creation", |
| self.khr_device_group_creation, |
| ), |
| ("VK_KHR_display", self.khr_display), |
| ( |
| "VK_KHR_external_fence_capabilities", |
| self.khr_external_fence_capabilities, |
| ), |
| ( |
| "VK_KHR_external_memory_capabilities", |
| self.khr_external_memory_capabilities, |
| ), |
| ( |
| "VK_KHR_external_semaphore_capabilities", |
| self.khr_external_semaphore_capabilities, |
| ), |
| ( |
| "VK_KHR_get_display_properties2", |
| self.khr_get_display_properties2, |
| ), |
| ( |
| "VK_KHR_get_physical_device_properties2", |
| self.khr_get_physical_device_properties2, |
| ), |
| ( |
| "VK_KHR_get_surface_capabilities2", |
| self.khr_get_surface_capabilities2, |
| ), |
| ( |
| "VK_KHR_portability_enumeration", |
| self.khr_portability_enumeration, |
| ), |
| ("VK_KHR_surface", self.khr_surface), |
| ( |
| "VK_KHR_surface_protected_capabilities", |
| self.khr_surface_protected_capabilities, |
| ), |
| ("VK_KHR_wayland_surface", self.khr_wayland_surface), |
| ("VK_KHR_win32_surface", self.khr_win32_surface), |
| ("VK_KHR_xcb_surface", self.khr_xcb_surface), |
| ("VK_KHR_xlib_surface", self.khr_xlib_surface), |
| ("VK_EXT_acquire_drm_display", self.ext_acquire_drm_display), |
| ("VK_EXT_acquire_xlib_display", self.ext_acquire_xlib_display), |
| ("VK_EXT_debug_report", self.ext_debug_report), |
| ("VK_EXT_debug_utils", self.ext_debug_utils), |
| ("VK_EXT_direct_mode_display", self.ext_direct_mode_display), |
| ("VK_EXT_directfb_surface", self.ext_directfb_surface), |
| ( |
| "VK_EXT_display_surface_counter", |
| self.ext_display_surface_counter, |
| ), |
| ("VK_EXT_headless_surface", self.ext_headless_surface), |
| ("VK_EXT_metal_surface", self.ext_metal_surface), |
| ("VK_EXT_surface_maintenance1", self.ext_surface_maintenance1), |
| ("VK_EXT_swapchain_colorspace", self.ext_swapchain_colorspace), |
| ("VK_EXT_validation_features", self.ext_validation_features), |
| ("VK_EXT_validation_flags", self.ext_validation_flags), |
| ( |
| "VK_FUCHSIA_imagepipe_surface", |
| self.fuchsia_imagepipe_surface, |
| ), |
| ( |
| "VK_GGP_stream_descriptor_surface", |
| self.ggp_stream_descriptor_surface, |
| ), |
| ("VK_GOOGLE_surfaceless_query", self.google_surfaceless_query), |
| ( |
| "VK_LUNARG_direct_driver_loading", |
| self.lunarg_direct_driver_loading, |
| ), |
| ("VK_MVK_ios_surface", self.mvk_ios_surface), |
| ("VK_MVK_macos_surface", self.mvk_macos_surface), |
| ("VK_NN_vi_surface", self.nn_vi_surface), |
| ( |
| "VK_NV_external_memory_capabilities", |
| self.nv_external_memory_capabilities, |
| ), |
| ("VK_QNX_screen_surface", self.qnx_screen_surface), |
| ] |
| .into_iter() |
| } |
| } |
| impl InstanceExtensions { |
| #[doc = r" Checks enabled extensions against the instance version and each other."] |
| pub(super) fn check_requirements( |
| &self, |
| supported: &InstanceExtensions, |
| api_version: crate::Version, |
| ) -> Result<(), crate::instance::ExtensionRestrictionError> { |
| let instance_extensions = self; |
| if self.khr_android_surface { |
| if !supported.khr_android_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_android_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_android_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_device_group_creation { |
| if !supported.khr_device_group_creation { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_device_group_creation", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.khr_display { |
| if !supported.khr_display { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_display", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_display", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_external_fence_capabilities { |
| if !supported.khr_external_fence_capabilities { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_fence_capabilities", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(api_version >= crate::Version::V1_1 |
| || instance_extensions.khr_get_physical_device_properties2) |
| { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_fence_capabilities", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: Some(crate::Version::V1_1), |
| device_extensions: &[], |
| instance_extensions: &["khr_get_physical_device_properties2"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_external_memory_capabilities { |
| if !supported.khr_external_memory_capabilities { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_memory_capabilities", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(api_version >= crate::Version::V1_1 |
| || instance_extensions.khr_get_physical_device_properties2) |
| { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_memory_capabilities", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: Some(crate::Version::V1_1), |
| device_extensions: &[], |
| instance_extensions: &["khr_get_physical_device_properties2"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_external_semaphore_capabilities { |
| if !supported.khr_external_semaphore_capabilities { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_semaphore_capabilities", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(api_version >= crate::Version::V1_1 |
| || instance_extensions.khr_get_physical_device_properties2) |
| { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_external_semaphore_capabilities", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: Some(crate::Version::V1_1), |
| device_extensions: &[], |
| instance_extensions: &["khr_get_physical_device_properties2"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_get_display_properties2 { |
| if !supported.khr_get_display_properties2 { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_get_display_properties2", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_display) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_get_display_properties2", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_display"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_get_physical_device_properties2 { |
| if !supported.khr_get_physical_device_properties2 { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_get_physical_device_properties2", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.khr_get_surface_capabilities2 { |
| if !supported.khr_get_surface_capabilities2 { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_get_surface_capabilities2", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_get_surface_capabilities2", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_portability_enumeration { |
| if !supported.khr_portability_enumeration { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_portability_enumeration", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.khr_surface { |
| if !supported.khr_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.khr_surface_protected_capabilities { |
| if !supported.khr_surface_protected_capabilities { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_surface_protected_capabilities", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(api_version >= crate::Version::V1_1) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_surface_protected_capabilities", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: Some(crate::Version::V1_1), |
| device_extensions: &[], |
| instance_extensions: &[], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| if !(instance_extensions.khr_get_surface_capabilities2) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_surface_protected_capabilities", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_get_surface_capabilities2"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_wayland_surface { |
| if !supported.khr_wayland_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_wayland_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_wayland_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_win32_surface { |
| if !supported.khr_win32_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_win32_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_win32_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_xcb_surface { |
| if !supported.khr_xcb_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_xcb_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_xcb_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.khr_xlib_surface { |
| if !supported.khr_xlib_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_xlib_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "khr_xlib_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_acquire_drm_display { |
| if !supported.ext_acquire_drm_display { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_acquire_drm_display", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.ext_direct_mode_display) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_acquire_drm_display", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["ext_direct_mode_display"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_acquire_xlib_display { |
| if !supported.ext_acquire_xlib_display { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_acquire_xlib_display", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.ext_direct_mode_display) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_acquire_xlib_display", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["ext_direct_mode_display"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_debug_report { |
| if !supported.ext_debug_report { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_debug_report", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.ext_debug_utils { |
| if !supported.ext_debug_utils { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_debug_utils", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.ext_direct_mode_display { |
| if !supported.ext_direct_mode_display { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_direct_mode_display", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_display) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_direct_mode_display", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_display"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_directfb_surface { |
| if !supported.ext_directfb_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_directfb_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_directfb_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_display_surface_counter { |
| if !supported.ext_display_surface_counter { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_display_surface_counter", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_display) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_display_surface_counter", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_display"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_headless_surface { |
| if !supported.ext_headless_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_headless_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_headless_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_metal_surface { |
| if !supported.ext_metal_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_metal_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_metal_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_surface_maintenance1 { |
| if !supported.ext_surface_maintenance1 { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_surface_maintenance1", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_surface_maintenance1", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| if !(instance_extensions.khr_get_surface_capabilities2) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_surface_maintenance1", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_get_surface_capabilities2"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_swapchain_colorspace { |
| if !supported.ext_swapchain_colorspace { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_swapchain_colorspace", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_swapchain_colorspace", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ext_validation_features { |
| if !supported.ext_validation_features { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_validation_features", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.ext_validation_flags { |
| if !supported.ext_validation_flags { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ext_validation_flags", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.fuchsia_imagepipe_surface { |
| if !supported.fuchsia_imagepipe_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "fuchsia_imagepipe_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "fuchsia_imagepipe_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.ggp_stream_descriptor_surface { |
| if !supported.ggp_stream_descriptor_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ggp_stream_descriptor_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "ggp_stream_descriptor_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.google_surfaceless_query { |
| if !supported.google_surfaceless_query { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "google_surfaceless_query", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "google_surfaceless_query", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.lunarg_direct_driver_loading { |
| if !supported.lunarg_direct_driver_loading { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "lunarg_direct_driver_loading", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.mvk_ios_surface { |
| if !supported.mvk_ios_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "mvk_ios_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "mvk_ios_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.mvk_macos_surface { |
| if !supported.mvk_macos_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "mvk_macos_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "mvk_macos_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.nn_vi_surface { |
| if !supported.nn_vi_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "nn_vi_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "nn_vi_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| if self.nv_external_memory_capabilities { |
| if !supported.nv_external_memory_capabilities { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "nv_external_memory_capabilities", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| } |
| if self.qnx_screen_surface { |
| if !supported.qnx_screen_surface { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "qnx_screen_surface", |
| restriction: crate::instance::ExtensionRestriction::NotSupported, |
| }); |
| } |
| if !(instance_extensions.khr_surface) { |
| return Err(crate::instance::ExtensionRestrictionError { |
| extension: "qnx_screen_surface", |
| restriction: crate::instance::ExtensionRestriction::Requires( |
| crate::RequiresOneOf { |
| api_version: None, |
| device_extensions: &[], |
| instance_extensions: &["khr_surface"], |
| ..Default::default() |
| }, |
| ), |
| }); |
| } |
| } |
| Ok(()) |
| } |
| } |