From 92d237fd93123ab3ffbbe8095fb23e78003107dc Mon Sep 17 00:00:00 2001 From: Valaphee The Meerkat <32491319+valaphee@users.noreply.github.com> Date: Mon, 23 Oct 2023 20:49:17 +0200 Subject: [PATCH] Fix missing feature checks for dx11 and dx12 (#4287) --- wgpu-core/src/instance.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index facf31c5d..1fa0677e6 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -615,9 +615,11 @@ impl Global { presentation: None, #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] vulkan: None, + #[cfg(all(feature = "dx12", windows))] dx12: self.instance.dx12.as_ref().map(|inst| HalSurface { raw: unsafe { inst.create_surface_from_visual(visual as _) }, }), + #[cfg(all(feature = "dx11", windows))] dx11: None, #[cfg(feature = "gles")] gl: None, @@ -643,9 +645,11 @@ impl Global { presentation: None, #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] vulkan: None, + #[cfg(all(feature = "dx12", windows))] dx12: self.instance.dx12.as_ref().map(|inst| HalSurface { raw: unsafe { inst.create_surface_from_surface_handle(surface_handle) }, }), + #[cfg(all(feature = "dx11", windows))] dx11: None, #[cfg(feature = "gles")] gl: None, @@ -671,9 +675,11 @@ impl Global { presentation: None, #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] vulkan: None, + #[cfg(all(feature = "dx12", windows))] dx12: self.instance.dx12.as_ref().map(|inst| HalSurface { raw: unsafe { inst.create_surface_from_swap_chain_panel(swap_chain_panel as _) }, }), + #[cfg(all(feature = "dx11", windows))] dx11: None, #[cfg(feature = "gles")] gl: None,