From 0a58972309ef4f999d885d1493be31ed2cefad4a Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 13 Jul 2021 15:34:46 +0000 Subject: [PATCH] Always run the Tint renamer, even with dump_translated_shaders Not running the renamer can produce code that fails to compile on the backend, resulting in device lost errors. Change-Id: I4a841a281142bb8eda1402e1ebd6a5d23b77bfe0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57745 Reviewed-by: Ben Clayton Commit-Queue: Austin Eng --- src/dawn_native/d3d12/ShaderModuleD3D12.cpp | 11 ++--------- src/dawn_native/metal/ShaderModuleMTL.mm | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index 0ea9acbca3..d8b742ac73 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -258,10 +258,7 @@ namespace dawn_native { namespace d3d12 { layout->GetFirstIndexOffsetRegisterSpace()); } transformManager.Add(); - - if (!GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) { - transformManager.Add(); - } + transformManager.Add(); // D3D12 registers like `t3` and `c3` have the same bindingOffset number in the // remapping but should not be considered a collision because they have different types. @@ -292,11 +289,7 @@ namespace dawn_native { namespace d3d12 { } *remappedEntryPointName = it->second; } else { - if (GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) { - *remappedEntryPointName = entryPointName; - } else { - return DAWN_VALIDATION_ERROR("Transform output missing renamer data."); - } + return DAWN_VALIDATION_ERROR("Transform output missing renamer data."); } tint::writer::hlsl::Options options; diff --git a/src/dawn_native/metal/ShaderModuleMTL.mm b/src/dawn_native/metal/ShaderModuleMTL.mm index bbbe86ccff..d8afff53d2 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.mm +++ b/src/dawn_native/metal/ShaderModuleMTL.mm @@ -123,10 +123,7 @@ namespace dawn_native { namespace metal { transformManager.Add(); } transformManager.Add(); - - if (!GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) { - transformManager.Add(); - } + transformManager.Add(); transformInputs.Add(std::move(bindingPoints), std::move(accessControls), @@ -144,11 +141,7 @@ namespace dawn_native { namespace metal { } *remappedEntryPointName = it->second; } else { - if (GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) { - *remappedEntryPointName = entryPointName; - } else { - return DAWN_VALIDATION_ERROR("Transform output missing renamer data."); - } + return DAWN_VALIDATION_ERROR("Transform output missing renamer data."); } tint::writer::msl::Options options;