Bug 1917512 - Do not request hardware adapter when RequestAdapterOptions::force_fallback_adapter = true r=webgpu-reviewers,teoxoy

On Windows, gecko request hardware adapter even when RequestAdapterOptions::force_fallback_adapter = true. The change avoids to do it.

Differential Revision: https://phabricator.services.mozilla.com/D221696
This commit is contained in:
sotaro 2024-09-15 09:39:43 +00:00
Родитель ca093a8a78
Коммит f7e9dffee2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -184,7 +184,7 @@ pub unsafe extern "C" fn wgpu_server_instance_request_adapter(
// If wgpu uses a different adapter than WebRender, textures created by
// webgpu::ExternalTexture do not work with wgpu.
#[cfg(target_os = "windows")]
if adapter_luid.is_some() {
if adapter_luid.is_some() && !desc.force_fallback_adapter {
if let Some(instance) = global.global.instance_as_hal::<wgc::api::Dx12>() {
for adapter in instance.enumerate_adapters(None) {
let raw_adapter = adapter.adapter.raw_adapter();