Add toggle to warn the dst-alpha issue on Intel GPUs
Bug: dawn:1579
Change-Id: Ifdf09aefcdd62be82bd874a6e185b18ab96cb29a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp
index 7371ee1..2eef777 100644
--- a/src/dawn/native/Toggles.cpp
+++ b/src/dawn/native/Toggles.cpp
@@ -343,7 +343,12 @@
{"no_workaround_indirect_base_vertex_not_applied",
"MacOS Intel < Gen9 has a bug where indirect base vertex is not applied for "
"drawIndexedIndirect. Draws are done as if it is always zero.",
- "https://crbug.com/dawn/966"}}
+ "https://crbug.com/dawn/966"}},
+ {Toggle::NoWorkaroundDstAlphaBlendDoesNotWork,
+ {"no_workaround_dst_alpha_blend_does_not_work",
+ "Using D3D12_BLEND_DEST_ALPHA as blend factor doesn't work correctly on the D3D12 backend "
+ "using Intel Gen9 or Gen9.5 GPUs.",
+ "https://crbug.com/dawn/1579"}},
// Comment to separate the }} so it is clearer what to copy-paste to add a toggle.
}};
} // anonymous namespace
diff --git a/src/dawn/native/Toggles.h b/src/dawn/native/Toggles.h
index ec080cf..dc928da 100644
--- a/src/dawn/native/Toggles.h
+++ b/src/dawn/native/Toggles.h
@@ -87,6 +87,7 @@
// Unresolved issues.
NoWorkaroundSampleMaskBecomesZeroForAllButLastColorTarget,
NoWorkaroundIndirectBaseVertexNotApplied,
+ NoWorkaroundDstAlphaBlendDoesNotWork,
EnumCount,
InvalidEnum = EnumCount,
diff --git a/src/dawn/native/d3d12/DeviceD3D12.cpp b/src/dawn/native/d3d12/DeviceD3D12.cpp
index 646c58e..0be01d0 100644
--- a/src/dawn/native/d3d12/DeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/DeviceD3D12.cpp
@@ -734,6 +734,12 @@
gpu_info::IsIntelGen11(vendorId, deviceId)) {
SetToggle(Toggle::D3D12Allocate2DTexturewithCopyDstAsCommittedResource, true);
}
+
+ // Currently this toggle is only needed on Intel Gen9 and Gen9.5 GPUs.
+ // See http://crbug.com/dawn/1579 for more information.
+ if (gpu_info::IsIntelGen9(vendorId, deviceId)) {
+ SetToggle(Toggle::NoWorkaroundDstAlphaBlendDoesNotWork, true);
+ }
}
MaybeError Device::WaitForIdleForDestruction() {