From 04ad2a4c1457c70d9623c8202f5599e588ee7b06 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Fri, 16 Dec 2022 18:10:06 +0000 Subject: [PATCH] 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 Commit-Queue: Austin Eng Kokoro: Kokoro --- src/dawn/native/Toggles.cpp | 7 ++++++- src/dawn/native/Toggles.h | 1 + src/dawn/native/metal/DeviceMTL.mm | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp index 8f22684f55..1095dec051 100644 --- a/src/dawn/native/Toggles.cpp +++ b/src/dawn/native/Toggles.cpp @@ -337,7 +337,12 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{ "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 4774a6f625..ec080cf967 100644 --- a/src/dawn/native/Toggles.h +++ b/src/dawn/native/Toggles.h @@ -86,6 +86,7 @@ enum class Toggle { // Unresolved issues. NoWorkaroundSampleMaskBecomesZeroForAllButLastColorTarget, + NoWorkaroundIndirectBaseVertexNotApplied, EnumCount, InvalidEnum = EnumCount, diff --git a/src/dawn/native/metal/DeviceMTL.mm b/src/dawn/native/metal/DeviceMTL.mm index 12dfda21c9..a8db843c3f 100644 --- a/src/dawn/native/metal/DeviceMTL.mm +++ b/src/dawn/native/metal/DeviceMTL.mm @@ -264,6 +264,10 @@ void Device::InitTogglesFromDriver() { 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 }