Add informational toggle that indirect baseVertex is broken on Mac Intel
Bug: dawn:966
Change-Id: I5f8183911eb04d4809c30cb7c1efdeca414f3329
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114662
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp
index 8f22684..1095dec 100644
--- a/src/dawn/native/Toggles.cpp
+++ b/src/dawn/native/Toggles.cpp
@@ -337,7 +337,12 @@
"MacOS 12.0+ Intel has a bug where the sample mask is only applied for the last color "
"target. If there are multiple color targets, all but the last one will use a sample mask "
"of zero.",
- "https://crbug.com/dawn/1462"}}
+ "https://crbug.com/dawn/1462"}},
+ {Toggle::NoWorkaroundIndirectBaseVertexNotApplied,
+ {"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"}}
// 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 4774a6f..ec080cf 100644
--- a/src/dawn/native/Toggles.h
+++ b/src/dawn/native/Toggles.h
@@ -86,6 +86,7 @@
// Unresolved issues.
NoWorkaroundSampleMaskBecomesZeroForAllButLastColorTarget,
+ NoWorkaroundIndirectBaseVertexNotApplied,
EnumCount,
InvalidEnum = EnumCount,
diff --git a/src/dawn/native/metal/DeviceMTL.mm b/src/dawn/native/metal/DeviceMTL.mm
index 12dfda2..a8db843 100644
--- a/src/dawn/native/metal/DeviceMTL.mm
+++ b/src/dawn/native/metal/DeviceMTL.mm
@@ -264,6 +264,10 @@
isOperatingSystemAtLeastVersion:NSOperatingSystemVersion{12, 0, 0}]) {
ForceSetToggle(Toggle::NoWorkaroundSampleMaskBecomesZeroForAllButLastColorTarget, true);
}
+ if (gpu_info::IsIntelGen7(vendorId, deviceId) ||
+ gpu_info::IsIntelGen8(vendorId, deviceId)) {
+ ForceSetToggle(Toggle::NoWorkaroundIndirectBaseVertexNotApplied, true);
+ }
}
#endif
}