Metal: make (robustness AND tint) => vertex pulling

Tint's vertex pulling transform supports the whole GPUVertexState so
we can enable it by default when robustness is necessary.

Adds a suppression for failing tests on Metal Intel.

Bug: dawn:805
Bug: dawn:966
Change-Id: Id7b2c6df2291671164647f65fc50c61e27de90b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56382
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2021-06-30 09:57:04 +00:00 committed by Dawn LUCI CQ
parent d3ebb17e73
commit 0ecfece609
2 changed files with 14 additions and 4 deletions

View File

@ -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);

View File

@ -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);