diff --git a/src/dawn_native/metal/DeviceMTL.mm b/src/dawn_native/metal/DeviceMTL.mm index ea7e09c514..0c392321ff 100644 --- a/src/dawn_native/metal/DeviceMTL.mm +++ b/src/dawn_native/metal/DeviceMTL.mm @@ -127,10 +127,6 @@ namespace dawn_native { namespace metal { MaybeError Device::Initialize() { InitTogglesFromDriver(); - if (!IsRobustnessEnabled()) { - ForceSetToggle(Toggle::MetalEnableVertexPulling, false); - } - mCommandQueue.Acquire([*mMtlDevice newCommandQueue]); if (GetAdapter()->GetSupportedExtensions().IsEnabled(Extension::TimestampQuery)) { @@ -189,6 +185,12 @@ namespace dawn_native { namespace metal { SetToggle(Toggle::DisableBaseInstance, !haveBaseVertexBaseInstance); } + // Vertex buffer robustness is implemented by using programmable vertex pulling. Enable + // that code path if it isn't explicitly disabled. + if (IsToggleEnabled(Toggle::UseTintGenerator) && IsRobustnessEnabled()) { + SetToggle(Toggle::MetalEnableVertexPulling, true); + } + // TODO(crbug.com/dawn/846): tighten this workaround when the driver bug is fixed. SetToggle(Toggle::AlwaysResolveIntoZeroLevelAndLayer, true); diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp index 44b8c07bf5..147d5122cb 100644 --- a/src/tests/end2end/DrawIndexedIndirectTests.cpp +++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp @@ -125,6 +125,10 @@ TEST_P(DrawIndexedIndirectTest, BaseVertex) { DAWN_TEST_UNSUPPORTED_IF(IsOpenGL()); DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES()); + // TODO(crbug.com/dawn/966): Fails on Metal Intel, likely because [[builtin(vertex_index)]] + // doesn't take into account BaseVertex, which breaks programmable vertex pulling. + DAWN_SUPPRESS_TEST_IF(IsMetal() && IsIntel()); + RGBA8 filled(0, 255, 0, 255); RGBA8 notFilled(0, 0, 0, 0); @@ -150,6 +154,10 @@ TEST_P(DrawIndexedIndirectTest, IndirectOffset) { // TODO(crbug.com/dawn/789): Test is failing after a roll on SwANGLE on Windows only. DAWN_SUPPRESS_TEST_IF(IsANGLE() && IsWindows()); + // TODO(crbug.com/dawn/966): Fails on Metal Intel, likely because [[builtin(vertex_index)]] + // doesn't take into account BaseVertex, which breaks programmable vertex pulling. + DAWN_SUPPRESS_TEST_IF(IsMetal() && IsIntel()); + RGBA8 filled(0, 255, 0, 255); RGBA8 notFilled(0, 0, 0, 0);