d3d11/12: Set UseTintIR toggle from WebGPUUseTintIR
Use the platform feature to set the default value of the UseTintIR
toggle in the Metal backend, in preparation for the Finch trial.
Bug: 377296327
Change-Id: If00e47967ad7a2bf83125c8e768431f0b3aeb8f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/214297
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
index d576730..784e8ba 100644
--- a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
+++ b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
@@ -39,6 +39,7 @@
#include "dawn/native/d3d11/DeviceD3D11.h"
#include "dawn/native/d3d11/PlatformFunctionsD3D11.h"
#include "dawn/native/d3d11/UtilsD3D11.h"
+#include "dawn/platform/DawnPlatform.h"
namespace dawn::native::d3d11 {
@@ -299,6 +300,10 @@
if (gpu_info::IsIntelGen11OrOlder(vendorId, deviceId)) {
deviceToggles->Default(Toggle::ClearColorWithDraw, true);
}
+
+ // Use the Tint IR backend by default if the corresponding platform feature is enabled.
+ deviceToggles->Default(Toggle::UseTintIR,
+ platform->IsFeatureEnabled(platform::Features::kWebGPUUseTintIR));
}
ResultOrError<Ref<DeviceBase>> PhysicalDevice::CreateDeviceImpl(
diff --git a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
index 27e88cf..cdaf7e5 100644
--- a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
@@ -802,6 +802,10 @@
deviceToggles->Default(Toggle::D3D12ForceStencilComponentReplicateSwizzle, true);
deviceToggles->Default(Toggle::D3D12ExpandShaderResourceStateTransitionsToCopySource, true);
}
+
+ // Use the Tint IR backend by default if the corresponding platform feature is enabled.
+ deviceToggles->Default(Toggle::UseTintIR,
+ platform->IsFeatureEnabled(platform::Features::kWebGPUUseTintIR));
}
ResultOrError<Ref<DeviceBase>> PhysicalDevice::CreateDeviceImpl(