Enum VulkanSwapchainKind
pub enum VulkanSwapchainKind {
Native,
DxgiFromHwnd,
DxgiFromVisual,
}Expand description
Selects which kind of swapchain to use on Vulkan.
The DXGI kinds fall back to Self::Native for the whole instance, with a warning, if the
platform is not Windows, or if the DXGI factory, d3d12.dll, or the D3D12 device factory is
not available.
With a DXGI kind, presentation is not available on an adapter that has no LUID, no timeline
semaphores, no VK_KHR_external_memory_win32 or VK_KHR_external_semaphore_win32, or
cannot import D3D12 fences. A surface only reports the formats that the adapter can import
as D3D12 resources, and is not supported if there are none. Surface configuration fails if
no DXGI adapter has the LUID of the Vulkan device, or if the D3D12 device on it does not
support Shader Model 6.0. A missing LUID or missing Shader Model 6.0 support indicates old
hardware or an old driver.
Variants§
Native
Use a native vulkan swapchain via VK_KHR_swapchain.
DxgiFromHwnd
Use a DXGI swapchain presenting directly to a HWND.
This mode may give better frame pacing, lower latency, and more predictable performance than the native swapchain on Windows.
When using RenderDoc, this mode will cause RenderDoc to only capture the work on the D3D12 interop device,
not the work on the Vulkan device. However Device::start_graphics_debugger_capture will still function
correctly and result in a vulkan capture.
Nsight and RGP profiling continue to work.
To have a transparent window with DXGI, use Self::DxgiFromVisual instead.
DxgiFromVisual
Use a DXGI swapchain presenting to a DirectComposition visual created from the HWND.
This mode may give better frame pacing, lower latency, and more predictable performance than the native swapchain on Windows.
Nsight and RGP profiling continue to work.
This mode supports transparent windows, but does not have support from RenderDoc and may have memory overhead
compared to Self::DxgiFromHwnd.
Implementations§
§impl VulkanSwapchainKind
impl VulkanSwapchainKind
pub const fn default() -> VulkanSwapchainKind
pub const fn default() -> VulkanSwapchainKind
This function is identical to Default::default() except that it is a const fn.
§impl VulkanSwapchainKind
impl VulkanSwapchainKind
pub fn from_env() -> Option<VulkanSwapchainKind>
pub fn from_env() -> Option<VulkanSwapchainKind>
Choose which swapchain kind to use from the environment variable WGPU_VULKAN_SWAPCHAIN_KIND.
Valid values, case insensitive:
nativedxgi-hwnddxgi-visual
pub fn with_env(self) -> VulkanSwapchainKind
pub fn with_env(self) -> VulkanSwapchainKind
Takes the given swapchain kind, modifies it based on the WGPU_VULKAN_SWAPCHAIN_KIND environment variable, and returns the result.
See from_env for more information.
Trait Implementations§
§impl Clone for VulkanSwapchainKind
impl Clone for VulkanSwapchainKind
§fn clone(&self) -> VulkanSwapchainKind
fn clone(&self) -> VulkanSwapchainKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for VulkanSwapchainKind
impl Debug for VulkanSwapchainKind
§impl Default for VulkanSwapchainKind
impl Default for VulkanSwapchainKind
§fn default() -> VulkanSwapchainKind
fn default() -> VulkanSwapchainKind
§impl PartialEq for VulkanSwapchainKind
impl PartialEq for VulkanSwapchainKind
§fn eq(&self, other: &VulkanSwapchainKind) -> bool
fn eq(&self, other: &VulkanSwapchainKind) -> bool
self and other values to be equal, and is used by ==.impl Copy for VulkanSwapchainKind
impl Eq for VulkanSwapchainKind
impl StructuralPartialEq for VulkanSwapchainKind
Auto Trait Implementations§
impl Freeze for VulkanSwapchainKind
impl RefUnwindSafe for VulkanSwapchainKind
impl Send for VulkanSwapchainKind
impl Sync for VulkanSwapchainKind
impl Unpin for VulkanSwapchainKind
impl UnsafeUnpin for VulkanSwapchainKind
impl UnwindSafe for VulkanSwapchainKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more