Commit 502d7d88 authored by Jiawei Shao's avatar Jiawei Shao Committed by Commit Bot

WebGPU: Only choose the first D3D12 adapter on Windows

This patch forces the WebGPU command buffer only choose the first D3D12
adapter as the available WebGPU adapter on Windows.

On Windows the shared image between different GPUs has not been
supported yet, so we must ensure WebGPU is always using the same GPU as
the one used by the reset of Chromium. As ANGLE is using the first
D3D11 adapter, currently in WebGPU command buffer we should also choose
the first D3D12 adapter as the only one that can be chosen as a WebGPU
adapter.

BUG=chromium:996713

Change-Id: I92fe94c32773dd9392c25b52021df85f6bd4e3fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1909648Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Cr-Commit-Position: refs/heads/master@{#716443}
parent ba61e33b
......@@ -471,13 +471,16 @@ void WebGPUDecoderImpl::DiscoverAdapters() {
// decide to handle multiple adapters, code on the Chromium side will need to
// change to do appropriate cross adapter copying to make this happen, either
// manually or by using DirectComposition.
if (adapter.GetBackendType() == dawn_native::BackendType::D3D12) {
if (adapter.GetBackendType() == dawn_native::BackendType::D3D12) {
#else
if (adapter.GetBackendType() != dawn_native::BackendType::Null &&
adapter.GetBackendType() != dawn_native::BackendType::OpenGL) {
#endif
dawn_adapters_.push_back(adapter);
}
#if defined(OS_WIN)
break;
#endif
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment