Run SubstituteOverride transform before Robustness

Fixed: dawn:1673
Change-Id: I57f3daf16c417713a850894d1c6fcbc31ef03da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120822
Commit-Queue: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Shrek Shao 2023-02-21 23:12:33 +00:00 committed by Dawn LUCI CQ
parent 239b4298b3
commit 053fca884a
3 changed files with 14 additions and 15 deletions

View File

@ -322,12 +322,6 @@ ResultOrError<std::string> TranslateToHLSL(
r.firstIndexOffsetShaderRegister, r.firstIndexOffsetRegisterSpace); r.firstIndexOffsetShaderRegister, r.firstIndexOffsetRegisterSpace);
} }
if (r.isRobustnessEnabled) {
transformManager.Add<tint::transform::Robustness>();
}
transformManager.Add<tint::transform::BindingRemapper>();
if (r.substituteOverrideConfig) { if (r.substituteOverrideConfig) {
// This needs to run after SingleEntryPoint transform which removes unused overrides for // This needs to run after SingleEntryPoint transform which removes unused overrides for
// current entry point. // current entry point.
@ -336,6 +330,12 @@ ResultOrError<std::string> TranslateToHLSL(
std::move(r.substituteOverrideConfig).value()); std::move(r.substituteOverrideConfig).value());
} }
if (r.isRobustnessEnabled) {
transformManager.Add<tint::transform::Robustness>();
}
transformManager.Add<tint::transform::BindingRemapper>();
// D3D12 registers like `t3` and `c3` have the same bindingOffset number in // D3D12 registers like `t3` and `c3` have the same bindingOffset number in
// the remapping but should not be considered a collision because they have // the remapping but should not be considered a collision because they have
// different types. // different types.

View File

@ -285,6 +285,14 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
transformManager.Add<tint::transform::Renamer>(); transformManager.Add<tint::transform::Renamer>();
} }
if (r.substituteOverrideConfig) {
// This needs to run after SingleEntryPoint transform which removes unused overrides
// for current entry point.
transformManager.Add<tint::transform::SubstituteOverride>();
transformInputs.Add<tint::transform::SubstituteOverride::Config>(
std::move(r.substituteOverrideConfig).value());
}
if (r.isRobustnessEnabled) { if (r.isRobustnessEnabled) {
transformManager.append(std::make_unique<tint::transform::Robustness>()); transformManager.append(std::make_unique<tint::transform::Robustness>());
} }
@ -300,13 +308,6 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
transformInputs.Add<tint::transform::MultiplanarExternalTexture::NewBindingPoints>( transformInputs.Add<tint::transform::MultiplanarExternalTexture::NewBindingPoints>(
r.newBindingsMap); r.newBindingsMap);
} }
if (r.substituteOverrideConfig) {
// This needs to run after SingleEntryPoint transform which removes unused overrides
// for current entry point.
transformManager.Add<tint::transform::SubstituteOverride>();
transformInputs.Add<tint::transform::SubstituteOverride::Config>(
std::move(r.substituteOverrideConfig).value());
}
if (r.clampFragDepth) { if (r.clampFragDepth) {
transformManager.Add<tint::transform::ClampFragDepth>(); transformManager.Add<tint::transform::ClampFragDepth>();

View File

@ -268,8 +268,6 @@ crbug.com/dawn/0000 [ win ] webgpu:shader,execution,memory_model,* [ Failure ]
# shader validation failures # shader validation failures
################################################################################ ################################################################################
crbug.com/tint/0000 webgpu:shader,validation,parse,blankspace:null_characters:contains_null=true;placement="comment" [ Failure ] crbug.com/tint/0000 webgpu:shader,validation,parse,blankspace:null_characters:contains_null=true;placement="comment" [ Failure ]
crbug.com/tint/1771 [ ubuntu ] webgpu:api,validation,compute_pipeline:overrides,workgroup_size,limits,* [ Failure ]
crbug.com/tint/1771 [ win10 ] webgpu:api,validation,compute_pipeline:overrides,workgroup_size,limits,* [ Failure ]
############################################################################ ############################################################################
# Flaky on Intel Mac # Flaky on Intel Mac