[Compat] Fix forceFallbackAdapter priority over compatibilityMode
Part 1 fix in dawn repo.
Dawn should select fallback adapter when both forceFallbackAdapter
and compatibilityMode are set to true.
Bug: 42241025
Change-Id: I88aa0b0674fce31ebf0de35b098d265922702093
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/210314
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
diff --git a/src/dawn/native/Instance.cpp b/src/dawn/native/Instance.cpp
index b8424c8..61ababb 100644
--- a/src/dawn/native/Instance.cpp
+++ b/src/dawn/native/Instance.cpp
@@ -370,8 +370,9 @@
UnpackedPtr<RequestAdapterOptions> unpacked = Unpack(options);
auto* togglesDesc = unpacked.Get<DawnTogglesDescriptor>();
- FeatureLevel featureLevel =
- options->compatibilityMode ? FeatureLevel::Compatibility : FeatureLevel::Core;
+ FeatureLevel featureLevel = (options->compatibilityMode && !options->forceFallbackAdapter)
+ ? FeatureLevel::Compatibility
+ : FeatureLevel::Core;
std::vector<Ref<AdapterBase>> adapters;
for (const auto& physicalDevice : EnumeratePhysicalDevices(unpacked)) {
DAWN_ASSERT(physicalDevice->SupportsFeatureLevel(featureLevel));