[gl] Move symbol renaming into the backend
Instead of running the AST renamer transform in Dawn's OpenGL backend,
we just modify the names when emitting them in the printer.
This is a little cleaner than using a transform, as transforms cannot
rename structures and struct members without requiring
const_cast. This also keeps the list of GLSL keywords local to the
printer, and means we can retain the meaningful names throughout the
`raise` process.
Bug: 380043958
Fixed: 42241122
Change-Id: If388c9456d413899f8546eb24cff7819e7caf146
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/218619
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
index 622be8e..1513139 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -349,16 +349,16 @@
return res;
}
VertexOutput vertex_main_inner() {
- VertexOutput tint_symbol = VertexOutput(vec4(0.0f), vec4(0.0f));
- tint_symbol.pos = vec4(0.0f);
- tint_symbol.prevent_dce = textureLoad_1bfdfb();
- return tint_symbol;
+ VertexOutput v_17 = VertexOutput(vec4(0.0f), vec4(0.0f));
+ v_17.pos = vec4(0.0f);
+ v_17.prevent_dce = textureLoad_1bfdfb();
+ return v_17;
}
void main() {
- VertexOutput v_17 = vertex_main_inner();
- gl_Position = v_17.pos;
+ VertexOutput v_18 = vertex_main_inner();
+ gl_Position = v_18.pos;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- tint_interstage_location0 = v_17.prevent_dce;
+ tint_interstage_location0 = v_18.prevent_dce;
gl_PointSize = 1.0f;
}