From 7849b74e097c8bb04a7b93abfc7be64245fce893 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Wed, 20 Sep 2023 15:46:22 +0200 Subject: [PATCH 1/2] List Dx12 adapters before vulkan ones --- wgpu-core/src/instance.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index 0aee56ac6e..71cb009317 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -826,15 +826,6 @@ impl Global { .transpose()?; let mut device_types = Vec::new(); - #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] - let (id_vulkan, adapters_vk) = gather( - hal::api::Vulkan, - self.instance.vulkan.as_ref(), - &inputs, - compatible_surface, - desc.force_fallback_adapter, - &mut device_types, - ); #[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))] let (id_metal, adapters_metal) = gather( hal::api::Metal, @@ -853,6 +844,15 @@ impl Global { desc.force_fallback_adapter, &mut device_types, ); + #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] + let (id_vulkan, adapters_vk) = gather( + hal::api::Vulkan, + self.instance.vulkan.as_ref(), + &inputs, + compatible_surface, + desc.force_fallback_adapter, + &mut device_types, + ); #[cfg(all(feature = "dx11", windows))] let (id_dx11, adapters_dx11) = gather( hal::api::Dx11, From 53b917c11a190b52155598e5edaa8fb047cd1423 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Wed, 20 Sep 2023 15:54:20 +0200 Subject: [PATCH 2/2] Add a changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d60e0cd84f..ef4ca43361 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -137,6 +137,7 @@ By @wumpf in [#4147](https://github.com/gfx-rs/wgpu/pull/4147) - DX12 doesn't support `Features::POLYGON_MODE_POINT``. By @teoxoy in [#4032](https://github.com/gfx-rs/wgpu/pull/4032). - Set `Features::VERTEX_WRITABLE_STORAGE` based on the right feature level. By @teoxoy in [#4033](https://github.com/gfx-rs/wgpu/pull/4033). +- Expose DX12 adapters before vulkan ones when enumerating adapters by @nical in [#4156](https://github.com/gfx-rs/wgpu/pull/4156) #### Metal