Remove `renamer` from the transform list.
This CL removes the `renamer` option from transforms and depends on the
`rename-all` flag to handle renaming all symbols. By default, only
required symbols will be renamed.
Change-Id: I3d7009a3f9965aa813302d821e9d12432718a35f
Bug: 378726537
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/217194
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index 6bf696d..bc5b40c 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -151,7 +151,6 @@
bool emit_single_entry_point = false;
bool rename_all = false;
-
bool enable_robustness = true;
bool dump_ir = false;
@@ -363,9 +362,6 @@
"disable-demote-to-helper", "Disable demote to helper for discard", Default{false});
TINT_DEFER(opts->disable_demote_to_helper = *disable_demote_to_helper.value);
- auto& rename_all = options.Add<BoolOption>("rename-all", "Renames all symbols", Default{false});
- TINT_DEFER(opts->rename_all = *rename_all.value);
-
auto& dump_inspector_bindings = options.Add<BoolOption>(
"dump-inspector-bindings", "Dump reflection data about bindings to stdout",
Alias{"emit-inspector-bindings"}, Default{false});
@@ -385,7 +381,6 @@
options.Add<StringOption>("transform", R"(Runs transforms, name list is comma separated
Available transforms:
first_index_offset
- renamer
substitute_override
)",
ShortName{"t"});
@@ -397,6 +392,9 @@
}
});
+ auto& rename_all = options.Add<BoolOption>("rename-all", "Renames all symbols", Default{false});
+ TINT_DEFER(opts->rename_all = *rename_all.value);
+
auto& disable_robustness =
options.Add<BoolOption>("disable-robustness", "Disable the robustness transform");
TINT_DEFER({
@@ -656,37 +654,44 @@
// Renaming must always come first
switch (options.format) {
case Format::kMsl: {
-#if TINT_BUILD_MSL_WRITER
- transform_inputs.Add<tint::ast::transform::Renamer::Config>(
- options.rename_all ? tint::ast::transform::Renamer::Target::kAll
- : tint::ast::transform::Renamer::Target::kMslKeywords,
- /* preserve_unicode */ false);
+ if (!options.rename_all) {
+ transform_inputs.Add<tint::ast::transform::Renamer::Config>(
+ tint::ast::transform::Renamer::Target::kMslKeywords,
+ /* preserve_unicode */ false);
+ }
transform_manager.Add<tint::ast::transform::Renamer>();
-#endif // TINT_BUILD_MSL_WRITER
break;
}
-#if TINT_BUILD_GLSL_WRITER
case Format::kGlsl: {
- transform_inputs.Add<tint::ast::transform::Renamer::Config>(
- options.rename_all ? tint::ast::transform::Renamer::Target::kAll
- : tint::ast::transform::Renamer::Target::kGlslKeywords,
- /* preserve_unicode */ false);
+ if (!options.rename_all) {
+ transform_inputs.Add<tint::ast::transform::Renamer::Config>(
+ tint::ast::transform::Renamer::Target::kGlslKeywords,
+ /* preserve_unicode */ false);
+ }
transform_manager.Add<tint::ast::transform::Renamer>();
break;
}
-#endif // TINT_BUILD_GLSL_WRITER
case Format::kHlsl:
case Format::kHlslFxc: {
-#if TINT_BUILD_HLSL_WRITER
- transform_inputs.Add<tint::ast::transform::Renamer::Config>(
- options.rename_all ? tint::ast::transform::Renamer::Target::kAll
- : tint::ast::transform::Renamer::Target::kHlslKeywords,
- /* preserve_unicode */ false);
+ if (!options.rename_all) {
+ transform_inputs.Add<tint::ast::transform::Renamer::Config>(
+ tint::ast::transform::Renamer::Target::kHlslKeywords,
+ /* preserve_unicode */ false);
+ }
transform_manager.Add<tint::ast::transform::Renamer>();
-#endif // TINT_BUILD_HLSL_WRITER
break;
}
- default:
+ case Format::kSpirv:
+ case Format::kSpvAsm:
+ case Format::kWgsl:
+ case Format::kIr: {
+ if (options.rename_all) {
+ transform_manager.Add<tint::ast::transform::Renamer>();
+ }
+ break;
+ }
+ case Format::kNone:
+ case Format::kUnknown:
break;
}
@@ -699,8 +704,6 @@
if (name == "first_index_offset") {
transform_inputs.Add<tint::ast::transform::FirstIndexOffset::BindingPoint>(0, 0);
transform_manager.Add<tint::ast::transform::FirstIndexOffset>();
- } else if (name == "renamer") {
- transform_manager.Add<tint::ast::transform::Renamer>();
} else if (name == "substitute_override") {
auto override_names = inspector.GetNamedOverrideIds();
diff --git a/test/tint/bug/chromium/1236161.wgsl b/test/tint/bug/chromium/1236161.wgsl
index 1a4f3c9..d76f856 100644
--- a/test/tint/bug/chromium/1236161.wgsl
+++ b/test/tint/bug/chromium/1236161.wgsl
@@ -1,3 +1,3 @@
-// flags: --transform renamer
+// flags: --rename-all
fn i(){let s=modf(1.).whole;}
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.dxc.hlsl b/test/tint/bug/chromium/1236161.wgsl.expected.dxc.hlsl
index a16082e..4deb4ad 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.dxc.hlsl
@@ -3,6 +3,6 @@
return;
}
-void i() {
- float s = 1.0f;
+void tint_symbol() {
+ float tint_symbol_1 = 1.0f;
}
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.fxc.hlsl b/test/tint/bug/chromium/1236161.wgsl.expected.fxc.hlsl
index a16082e..4deb4ad 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.fxc.hlsl
@@ -3,6 +3,6 @@
return;
}
-void i() {
- float s = 1.0f;
+void tint_symbol() {
+ float tint_symbol_1 = 1.0f;
}
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.glsl b/test/tint/bug/chromium/1236161.wgsl.expected.glsl
index 1e5f9f9..48824a9 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.glsl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
-void i() {
- float s = 1.0f;
+void tint_symbol() {
+ float tint_symbol_1 = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/chromium/1236161.wgsl.expected.ir.dxc.hlsl
index 52df45b..8ad5e7b 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.ir.dxc.hlsl
@@ -1,6 +1,6 @@
-void i() {
- float s = 1.0f;
+void tint_symbol() {
+ float tint_symbol_1 = 1.0f;
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/chromium/1236161.wgsl.expected.ir.fxc.hlsl
index 52df45b..8ad5e7b 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.ir.fxc.hlsl
@@ -1,6 +1,6 @@
-void i() {
- float s = 1.0f;
+void tint_symbol() {
+ float tint_symbol_1 = 1.0f;
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.ir.msl b/test/tint/bug/chromium/1236161.wgsl.expected.ir.msl
index b3332ec..b3362e8 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.ir.msl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.ir.msl
@@ -1,6 +1,6 @@
#include <metal_stdlib>
using namespace metal;
-void i() {
- float const s = 1.0f;
+void tint_symbol() {
+ float const tint_symbol_1 = 1.0f;
}
diff --git a/test/tint/bug/chromium/1236161.wgsl.expected.msl b/test/tint/bug/chromium/1236161.wgsl.expected.msl
index 6acecbd..92c7d00 100644
--- a/test/tint/bug/chromium/1236161.wgsl.expected.msl
+++ b/test/tint/bug/chromium/1236161.wgsl.expected.msl
@@ -1,7 +1,7 @@
#include <metal_stdlib>
using namespace metal;
-void i() {
- float const s = 1.0f;
+void tint_symbol() {
+ float const tint_symbol_1 = 1.0f;
}
diff --git a/test/tint/bug/tint/1725.wgsl b/test/tint/bug/tint/1725.wgsl
index 1e0a2b4..438d1ce 100644
--- a/test/tint/bug/tint/1725.wgsl
+++ b/test/tint/bug/tint/1725.wgsl
@@ -1,4 +1,5 @@
-// flags: --transform renamer --rename-all
+// flags: --rename-all
+
@group(0) @binding(0) var<storage> data : array<u32>;
@compute @workgroup_size(1)
diff --git a/test/tint/bug/tint/2175.wgsl b/test/tint/bug/tint/2175.wgsl
index e52aca4..bc76c1e 100644
--- a/test/tint/bug/tint/2175.wgsl
+++ b/test/tint/bug/tint/2175.wgsl
@@ -1,5 +1,5 @@
-// flags: --transform renamer --rename-all
-
+// flags: --rename-all
+//
const v = vec4();
const x = v.x * 2u;
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl b/test/tint/shadowing/short_names/renamer/function.wgsl
index b7aaaa4..01881b5 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl
@@ -1,4 +1,4 @@
-// flags: --transform renamer
+// flags: --rename-all
// Evilness 😈. Don't go getting any ideas!
fn vec4f() -> i32 { return 0; }
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
index 3e15c85..cd2f17a 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
@@ -1,34 +1,34 @@
-int vec4f() {
+int tint_symbol() {
return 0;
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-struct tint_symbol_6 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_13 {
+ uint tint_symbol_6 : SV_VertexID;
};
-struct tint_symbol_7 {
+struct tint_symbol_14 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
- float4 tint_symbol = (0.0f).xxxx;
- float4 tint_symbol_1 = (1.0f).xxxx;
- int tint_symbol_2 = vec4f();
- float tint_symbol_3 = vec2f(tint_symbol_2);
- bool tint_symbol_4 = vec2i(tint_symbol_3);
- return (tint_symbol_4 ? tint_symbol_1 : tint_symbol);
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ float4 tint_symbol_7 = (0.0f).xxxx;
+ float4 tint_symbol_8 = (1.0f).xxxx;
+ int tint_symbol_9 = tint_symbol();
+ float tint_symbol_10 = tint_symbol_1(tint_symbol_9);
+ bool tint_symbol_11 = tint_symbol_3(tint_symbol_10);
+ return (tint_symbol_11 ? tint_symbol_8 : tint_symbol_7);
}
-tint_symbol_7 main(tint_symbol_6 tint_symbol_5) {
- float4 inner_result = main_inner(tint_symbol_5.VertexIndex);
- tint_symbol_7 wrapper_result = (tint_symbol_7)0;
+tint_symbol_14 tint_symbol_5(tint_symbol_13 tint_symbol_12) {
+ float4 inner_result = tint_symbol_5_inner(tint_symbol_12.tint_symbol_6);
+ tint_symbol_14 wrapper_result = (tint_symbol_14)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
index 3e15c85..cd2f17a 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
@@ -1,34 +1,34 @@
-int vec4f() {
+int tint_symbol() {
return 0;
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-struct tint_symbol_6 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_13 {
+ uint tint_symbol_6 : SV_VertexID;
};
-struct tint_symbol_7 {
+struct tint_symbol_14 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
- float4 tint_symbol = (0.0f).xxxx;
- float4 tint_symbol_1 = (1.0f).xxxx;
- int tint_symbol_2 = vec4f();
- float tint_symbol_3 = vec2f(tint_symbol_2);
- bool tint_symbol_4 = vec2i(tint_symbol_3);
- return (tint_symbol_4 ? tint_symbol_1 : tint_symbol);
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ float4 tint_symbol_7 = (0.0f).xxxx;
+ float4 tint_symbol_8 = (1.0f).xxxx;
+ int tint_symbol_9 = tint_symbol();
+ float tint_symbol_10 = tint_symbol_1(tint_symbol_9);
+ bool tint_symbol_11 = tint_symbol_3(tint_symbol_10);
+ return (tint_symbol_11 ? tint_symbol_8 : tint_symbol_7);
}
-tint_symbol_7 main(tint_symbol_6 tint_symbol_5) {
- float4 inner_result = main_inner(tint_symbol_5.VertexIndex);
- tint_symbol_7 wrapper_result = (tint_symbol_7)0;
+tint_symbol_14 tint_symbol_5(tint_symbol_13 tint_symbol_12) {
+ float4 inner_result = tint_symbol_5_inner(tint_symbol_12.tint_symbol_6);
+ tint_symbol_14 wrapper_result = (tint_symbol_14)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.glsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.glsl
index c445dcc..6895c01 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.glsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.glsl
@@ -1,19 +1,19 @@
#version 310 es
-int vec4f() {
+int tint_symbol() {
return 0;
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-vec4 tint_symbol_inner(uint VertexIndex) {
- return mix(vec4(0.0f), vec4(1.0f), bvec4(vec2i(vec2f(vec4f()))));
+vec4 tint_symbol_5_inner(uint tint_symbol_6) {
+ return mix(vec4(0.0f), vec4(1.0f), bvec4(tint_symbol_3(tint_symbol_1(tint_symbol()))));
}
void main() {
- gl_Position = tint_symbol_inner(uint(gl_VertexID));
+ gl_Position = tint_symbol_5_inner(uint(gl_VertexID));
gl_Position[1u] = -(gl_Position.y);
gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
gl_PointSize = 1.0f;
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.dxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.dxc.hlsl
index f11fa3e..010fdd9 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.dxc.hlsl
@@ -1,30 +1,30 @@
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_5_outputs {
+ float4 tint_symbol_7 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_5_inputs {
+ uint tint_symbol_6 : SV_VertexID;
};
-int vec4f() {
+int tint_symbol() {
return int(0);
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-float4 main_inner(uint VertexIndex) {
- return ((vec2i(vec2f(vec4f()))) ? ((1.0f).xxxx) : ((0.0f).xxxx));
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ return ((tint_symbol_3(tint_symbol_1(tint_symbol()))) ? ((1.0f).xxxx) : ((0.0f).xxxx));
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_5_outputs tint_symbol_5(tint_symbol_5_inputs inputs) {
+ tint_symbol_5_outputs v = {tint_symbol_5_inner(inputs.tint_symbol_6)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.fxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.fxc.hlsl
index f11fa3e..010fdd9 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.fxc.hlsl
@@ -1,30 +1,30 @@
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_5_outputs {
+ float4 tint_symbol_7 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_5_inputs {
+ uint tint_symbol_6 : SV_VertexID;
};
-int vec4f() {
+int tint_symbol() {
return int(0);
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-float4 main_inner(uint VertexIndex) {
- return ((vec2i(vec2f(vec4f()))) ? ((1.0f).xxxx) : ((0.0f).xxxx));
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ return ((tint_symbol_3(tint_symbol_1(tint_symbol()))) ? ((1.0f).xxxx) : ((0.0f).xxxx));
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_5_outputs tint_symbol_5(tint_symbol_5_inputs inputs) {
+ tint_symbol_5_outputs v = {tint_symbol_5_inner(inputs.tint_symbol_6)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.msl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.msl
index 1c5e161..01d3e46 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.msl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.ir.msl
@@ -1,28 +1,28 @@
#include <metal_stdlib>
using namespace metal;
-struct tint_symbol_outputs {
- float4 tint_symbol_1 [[position]];
+struct tint_symbol_5_outputs {
+ float4 tint_symbol_7 [[position]];
};
-int vec4f() {
+int tint_symbol() {
return 0;
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-float4 tint_symbol_inner(uint VertexIndex) {
- return select(float4(0.0f), float4(1.0f), vec2i(vec2f(vec4f())));
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ return select(float4(0.0f), float4(1.0f), tint_symbol_3(tint_symbol_1(tint_symbol())));
}
-vertex tint_symbol_outputs tint_symbol(uint VertexIndex [[vertex_id]]) {
- tint_symbol_outputs tint_wrapper_result = {};
- tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(VertexIndex);
+vertex tint_symbol_5_outputs tint_symbol_5(uint tint_symbol_6 [[vertex_id]]) {
+ tint_symbol_5_outputs tint_wrapper_result = {};
+ tint_wrapper_result.tint_symbol_7 = tint_symbol_5_inner(tint_symbol_6);
return tint_wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
index 00ff172..4605c67 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
@@ -1,34 +1,34 @@
#include <metal_stdlib>
using namespace metal;
-int vec4f() {
+int tint_symbol() {
return 0;
}
-float vec2f(int i) {
- return float(i);
+float tint_symbol_1(int tint_symbol_2) {
+ return float(tint_symbol_2);
}
-bool vec2i(float f) {
- return bool(f);
+bool tint_symbol_3(float tint_symbol_4) {
+ return bool(tint_symbol_4);
}
-struct tint_symbol_6 {
+struct tint_symbol_12 {
float4 value [[position]];
};
-float4 tint_symbol_inner(uint VertexIndex) {
- float4 const tint_symbol_1 = float4(0.0f);
- float4 const tint_symbol_2 = float4(1.0f);
- int const tint_symbol_3 = vec4f();
- float const tint_symbol_4 = vec2f(tint_symbol_3);
- bool const tint_symbol_5 = vec2i(tint_symbol_4);
- return select(tint_symbol_1, tint_symbol_2, tint_symbol_5);
+float4 tint_symbol_5_inner(uint tint_symbol_6) {
+ float4 const tint_symbol_7 = float4(0.0f);
+ float4 const tint_symbol_8 = float4(1.0f);
+ int const tint_symbol_9 = tint_symbol();
+ float const tint_symbol_10 = tint_symbol_1(tint_symbol_9);
+ bool const tint_symbol_11 = tint_symbol_3(tint_symbol_10);
+ return select(tint_symbol_7, tint_symbol_8, tint_symbol_11);
}
-vertex tint_symbol_6 tint_symbol(uint VertexIndex [[vertex_id]]) {
- float4 const inner_result = tint_symbol_inner(VertexIndex);
- tint_symbol_6 wrapper_result = {};
+vertex tint_symbol_12 tint_symbol_5(uint tint_symbol_6 [[vertex_id]]) {
+ float4 const inner_result = tint_symbol_5_inner(tint_symbol_6);
+ tint_symbol_12 wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl
index 4d7cfbf..1147609 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl
@@ -1,4 +1,4 @@
-// flags: --transform renamer
+// flags: --rename-all
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4f {
return vec4f(vec2f(vec2i()), 0.0, 1.0);
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.dxc.hlsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.dxc.hlsl
index 491d290..9862a82 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.dxc.hlsl
@@ -1,17 +1,17 @@
-struct tint_symbol_1 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_3 {
+ uint tint_symbol_1 : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_4 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
+ float4 inner_result = tint_symbol_inner(tint_symbol_2.tint_symbol_1);
+ tint_symbol_4 wrapper_result = (tint_symbol_4)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.fxc.hlsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.fxc.hlsl
index 491d290..9862a82 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.fxc.hlsl
@@ -1,17 +1,17 @@
-struct tint_symbol_1 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_3 {
+ uint tint_symbol_1 : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_4 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
+ float4 inner_result = tint_symbol_inner(tint_symbol_2.tint_symbol_1);
+ tint_symbol_4 wrapper_result = (tint_symbol_4)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.glsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.glsl
index df0da01..0050d9b 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.glsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.glsl
@@ -1,6 +1,6 @@
#version 310 es
-vec4 tint_symbol_inner(uint VertexIndex) {
+vec4 tint_symbol_inner(uint tint_symbol_1) {
return vec4(0.0f, 0.0f, 0.0f, 1.0f);
}
void main() {
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.dxc.hlsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.dxc.hlsl
index 690f09c..42fb821 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.dxc.hlsl
@@ -1,18 +1,18 @@
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_outputs {
+ float4 tint_symbol_2 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_inputs {
+ uint tint_symbol_1 : SV_VertexID;
};
-float4 main_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_outputs tint_symbol(tint_symbol_inputs inputs) {
+ tint_symbol_outputs v = {tint_symbol_inner(inputs.tint_symbol_1)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.fxc.hlsl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.fxc.hlsl
index 690f09c..42fb821 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.fxc.hlsl
@@ -1,18 +1,18 @@
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_outputs {
+ float4 tint_symbol_2 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_inputs {
+ uint tint_symbol_1 : SV_VertexID;
};
-float4 main_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_outputs tint_symbol(tint_symbol_inputs inputs) {
+ tint_symbol_outputs v = {tint_symbol_inner(inputs.tint_symbol_1)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.msl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.msl
index d36d581..b75a19f 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.msl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.ir.msl
@@ -2,15 +2,15 @@
using namespace metal;
struct tint_symbol_outputs {
- float4 tint_symbol_1 [[position]];
+ float4 tint_symbol_2 [[position]];
};
-float4 tint_symbol_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-vertex tint_symbol_outputs tint_symbol(uint VertexIndex [[vertex_id]]) {
+vertex tint_symbol_outputs tint_symbol(uint tint_symbol_1 [[vertex_id]]) {
tint_symbol_outputs tint_wrapper_result = {};
- tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(VertexIndex);
+ tint_wrapper_result.tint_symbol_2 = tint_symbol_inner(tint_symbol_1);
return tint_wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.msl b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.msl
index db26a6c..72ef59b 100644
--- a/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.msl
+++ b/test/tint/shadowing/short_names/renamer/renamer.wgsl.expected.msl
@@ -1,17 +1,17 @@
#include <metal_stdlib>
using namespace metal;
-struct tint_symbol_1 {
+struct tint_symbol_2 {
float4 value [[position]];
};
-float4 tint_symbol_inner(uint VertexIndex) {
+float4 tint_symbol_inner(uint tint_symbol_1) {
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
-vertex tint_symbol_1 tint_symbol(uint VertexIndex [[vertex_id]]) {
- float4 const inner_result = tint_symbol_inner(VertexIndex);
- tint_symbol_1 wrapper_result = {};
+vertex tint_symbol_2 tint_symbol(uint tint_symbol_1 [[vertex_id]]) {
+ float4 const inner_result = tint_symbol_inner(tint_symbol_1);
+ tint_symbol_2 wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl b/test/tint/shadowing/short_names/renamer/type.wgsl
index cdb2da2..f621d9e 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl
@@ -1,4 +1,4 @@
-// flags: --transform renamer
+// flags: --rename-all
// Evilness 😈. Don't go getting any ideas!
struct vec4f { i : i32, }
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.dxc.hlsl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.dxc.hlsl
index fca2096..39d59e4 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.dxc.hlsl
@@ -1,23 +1,23 @@
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct tint_symbol_1 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_10 {
+ uint tint_symbol_5 : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_11 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
- vec4f s = {1};
- float f = float(s.i);
- bool b = bool(f);
- return (b ? (1.0f).xxxx : (0.0f).xxxx);
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol tint_symbol_6 = {1};
+ float tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool tint_symbol_8 = bool(tint_symbol_7);
+ return (tint_symbol_8 ? (1.0f).xxxx : (0.0f).xxxx);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_11 tint_symbol_4(tint_symbol_10 tint_symbol_9) {
+ float4 inner_result = tint_symbol_4_inner(tint_symbol_9.tint_symbol_5);
+ tint_symbol_11 wrapper_result = (tint_symbol_11)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.fxc.hlsl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.fxc.hlsl
index fca2096..39d59e4 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.fxc.hlsl
@@ -1,23 +1,23 @@
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct tint_symbol_1 {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_10 {
+ uint tint_symbol_5 : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_11 {
float4 value : SV_Position;
};
-float4 main_inner(uint VertexIndex) {
- vec4f s = {1};
- float f = float(s.i);
- bool b = bool(f);
- return (b ? (1.0f).xxxx : (0.0f).xxxx);
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol tint_symbol_6 = {1};
+ float tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool tint_symbol_8 = bool(tint_symbol_7);
+ return (tint_symbol_8 ? (1.0f).xxxx : (0.0f).xxxx);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_11 tint_symbol_4(tint_symbol_10 tint_symbol_9) {
+ float4 inner_result = tint_symbol_4_inner(tint_symbol_9.tint_symbol_5);
+ tint_symbol_11 wrapper_result = (tint_symbol_11)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.glsl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.glsl
index e519ac8..5997e66 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.glsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.glsl
@@ -1,18 +1,18 @@
#version 310 es
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-vec4 tint_symbol_inner(uint VertexIndex) {
- vec4f s = vec4f(1);
- float f = float(s.i);
- bool b = bool(f);
- return mix(vec4(0.0f), vec4(1.0f), bvec4(b));
+vec4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol tint_symbol_6 = tint_symbol(1);
+ float tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool tint_symbol_8 = bool(tint_symbol_7);
+ return mix(vec4(0.0f), vec4(1.0f), bvec4(tint_symbol_8));
}
void main() {
- gl_Position = tint_symbol_inner(uint(gl_VertexID));
+ gl_Position = tint_symbol_4_inner(uint(gl_VertexID));
gl_Position[1u] = -(gl_Position.y);
gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
gl_PointSize = 1.0f;
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.dxc.hlsl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.dxc.hlsl
index 8faa34e..bccde41 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.dxc.hlsl
@@ -1,25 +1,25 @@
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_4_outputs {
+ float4 tint_symbol_2 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_4_inputs {
+ uint tint_symbol_5 : SV_VertexID;
};
-float4 main_inner(uint VertexIndex) {
- vec4f s = {int(1)};
- float f = float(s.i);
- bool b = bool(f);
- return ((b) ? ((1.0f).xxxx) : ((0.0f).xxxx));
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol tint_symbol_6 = {int(1)};
+ float tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool tint_symbol_8 = bool(tint_symbol_7);
+ return ((tint_symbol_8) ? ((1.0f).xxxx) : ((0.0f).xxxx));
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_4_outputs tint_symbol_4(tint_symbol_4_inputs inputs) {
+ tint_symbol_4_outputs v = {tint_symbol_4_inner(inputs.tint_symbol_5)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.fxc.hlsl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.fxc.hlsl
index 8faa34e..bccde41 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.fxc.hlsl
@@ -1,25 +1,25 @@
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct main_outputs {
- float4 tint_symbol : SV_Position;
+struct tint_symbol_4_outputs {
+ float4 tint_symbol_2 : SV_Position;
};
-struct main_inputs {
- uint VertexIndex : SV_VertexID;
+struct tint_symbol_4_inputs {
+ uint tint_symbol_5 : SV_VertexID;
};
-float4 main_inner(uint VertexIndex) {
- vec4f s = {int(1)};
- float f = float(s.i);
- bool b = bool(f);
- return ((b) ? ((1.0f).xxxx) : ((0.0f).xxxx));
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol tint_symbol_6 = {int(1)};
+ float tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool tint_symbol_8 = bool(tint_symbol_7);
+ return ((tint_symbol_8) ? ((1.0f).xxxx) : ((0.0f).xxxx));
}
-main_outputs main(main_inputs inputs) {
- main_outputs v = {main_inner(inputs.VertexIndex)};
+tint_symbol_4_outputs tint_symbol_4(tint_symbol_4_inputs inputs) {
+ tint_symbol_4_outputs v = {tint_symbol_4_inner(inputs.tint_symbol_5)};
return v;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.msl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.msl
index 4903442..70fcef6 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.msl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.ir.msl
@@ -1,23 +1,23 @@
#include <metal_stdlib>
using namespace metal;
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct tint_symbol_outputs {
- float4 tint_symbol_1 [[position]];
+struct tint_symbol_4_outputs {
+ float4 tint_symbol_2 [[position]];
};
-float4 tint_symbol_inner(uint VertexIndex) {
- vec4f const s = vec4f{.i=1};
- float const f = float(s.i);
- bool const b = bool(f);
- return select(float4(0.0f), float4(1.0f), b);
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol const tint_symbol_6 = tint_symbol{.tint_symbol_1=1};
+ float const tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool const tint_symbol_8 = bool(tint_symbol_7);
+ return select(float4(0.0f), float4(1.0f), tint_symbol_8);
}
-vertex tint_symbol_outputs tint_symbol(uint VertexIndex [[vertex_id]]) {
- tint_symbol_outputs tint_wrapper_result = {};
- tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(VertexIndex);
+vertex tint_symbol_4_outputs tint_symbol_4(uint tint_symbol_5 [[vertex_id]]) {
+ tint_symbol_4_outputs tint_wrapper_result = {};
+ tint_wrapper_result.tint_symbol_2 = tint_symbol_4_inner(tint_symbol_5);
return tint_wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.msl b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.msl
index b247dfa..4607dea 100644
--- a/test/tint/shadowing/short_names/renamer/type.wgsl.expected.msl
+++ b/test/tint/shadowing/short_names/renamer/type.wgsl.expected.msl
@@ -1,24 +1,24 @@
#include <metal_stdlib>
using namespace metal;
-struct vec4f {
- int i;
+struct tint_symbol {
+ int tint_symbol_1;
};
-struct tint_symbol_1 {
+struct tint_symbol_9 {
float4 value [[position]];
};
-float4 tint_symbol_inner(uint VertexIndex) {
- vec4f const s = vec4f{.i=1};
- float const f = float(s.i);
- bool const b = bool(f);
- return select(float4(0.0f), float4(1.0f), b);
+float4 tint_symbol_4_inner(uint tint_symbol_5) {
+ tint_symbol const tint_symbol_6 = tint_symbol{.tint_symbol_1=1};
+ float const tint_symbol_7 = float(tint_symbol_6.tint_symbol_1);
+ bool const tint_symbol_8 = bool(tint_symbol_7);
+ return select(float4(0.0f), float4(1.0f), tint_symbol_8);
}
-vertex tint_symbol_1 tint_symbol(uint VertexIndex [[vertex_id]]) {
- float4 const inner_result = tint_symbol_inner(VertexIndex);
- tint_symbol_1 wrapper_result = {};
+vertex tint_symbol_9 tint_symbol_4(uint tint_symbol_5 [[vertex_id]]) {
+ float4 const inner_result = tint_symbol_4_inner(tint_symbol_5);
+ tint_symbol_9 wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}