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 <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2021-07-13 15:34:46 +00:00 committed by Dawn LUCI CQ
parent 4773e8d0f9
commit 0a58972309
2 changed files with 4 additions and 18 deletions

View File

@ -258,10 +258,7 @@ namespace dawn_native { namespace d3d12 {
layout->GetFirstIndexOffsetRegisterSpace());
}
transformManager.Add<tint::transform::BindingRemapper>();
if (!GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) {
transformManager.Add<tint::transform::Renamer>();
}
transformManager.Add<tint::transform::Renamer>();
// 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;

View File

@ -123,10 +123,7 @@ namespace dawn_native { namespace metal {
transformManager.Add<tint::transform::BoundArrayAccessors>();
}
transformManager.Add<tint::transform::BindingRemapper>();
if (!GetDevice()->IsToggleEnabled(Toggle::DumpTranslatedShaders)) {
transformManager.Add<tint::transform::Renamer>();
}
transformManager.Add<tint::transform::Renamer>();
transformInputs.Add<BindingRemapper::Remappings>(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;