[transform] Rename generated variables.
This Cl prefixes the generated variable names from the vertex pulling
transform to prefix a '_' as you can not have an identifier in WGSL with
a leading '_'
Change-Id: Ic9ad873ac5f3ac25f96013f96e6d9a4c17964f22
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28942
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/src/transform/vertex_pulling_transform.cc b/src/transform/vertex_pulling_transform.cc
index be060a9..76b2522 100644
--- a/src/transform/vertex_pulling_transform.cc
+++ b/src/transform/vertex_pulling_transform.cc
@@ -40,11 +40,11 @@
namespace {
-static const char kVertexBufferNamePrefix[] = "tint_pulling_vertex_buffer_";
-static const char kStructBufferName[] = "data";
-static const char kPullingPosVarName[] = "tint_pulling_pos";
-static const char kDefaultVertexIndexName[] = "tint_pulling_vertex_index";
-static const char kDefaultInstanceIndexName[] = "tint_pulling_instance_index";
+static const char kVertexBufferNamePrefix[] = "_tint_pulling_vertex_buffer_";
+static const char kStructBufferName[] = "_tint_vertex_data";
+static const char kPullingPosVarName[] = "_tint_pulling_pos";
+static const char kDefaultVertexIndexName[] = "_tint_pulling_vertex_index";
+static const char kDefaultInstanceIndexName[] = "_tint_pulling_instance_index";
} // namespace
diff --git a/src/transform/vertex_pulling_transform_test.cc b/src/transform/vertex_pulling_transform_test.cc
index 59599ed..a30065d 100644
--- a/src/transform/vertex_pulling_transform_test.cc
+++ b/src/transform/vertex_pulling_transform_test.cc
@@ -145,7 +145,7 @@
Decorations{
BuiltinDecoration{vertex_idx}
}
- tint_pulling_vertex_index
+ _tint_pulling_vertex_index
in
__i32
}
@@ -154,7 +154,7 @@
BindingDecoration{0}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -165,16 +165,16 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{4}
}
@@ -187,11 +187,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -226,7 +226,7 @@
Decorations{
BuiltinDecoration{instance_idx}
}
- tint_pulling_instance_index
+ _tint_pulling_instance_index
in
__i32
}
@@ -235,7 +235,7 @@
BindingDecoration{0}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -246,16 +246,16 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_instance_index}
+ Identifier{_tint_pulling_instance_index}
multiply
ScalarConstructor{4}
}
@@ -268,11 +268,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -307,7 +307,7 @@
Decorations{
BuiltinDecoration{vertex_idx}
}
- tint_pulling_vertex_index
+ _tint_pulling_vertex_index
in
__i32
}
@@ -316,7 +316,7 @@
BindingDecoration{0}
SetDecoration{5}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -327,16 +327,16 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{4}
}
@@ -349,11 +349,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -440,7 +440,7 @@
BindingDecoration{0}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -449,7 +449,7 @@
BindingDecoration{1}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_1
+ _tint_pulling_vertex_buffer_1
storage_buffer
__struct_
}
@@ -460,13 +460,13 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
Identifier{custom_vertex_index}
@@ -482,11 +482,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -494,7 +494,7 @@
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
Identifier{custom_instance_index}
@@ -510,11 +510,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_1}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_1}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -559,7 +559,7 @@
Decorations{
BuiltinDecoration{vertex_idx}
}
- tint_pulling_vertex_index
+ _tint_pulling_vertex_index
in
__i32
}
@@ -568,7 +568,7 @@
BindingDecoration{0}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -579,16 +579,16 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{16}
}
@@ -601,11 +601,11 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
divide
ScalarConstructor{4}
}
@@ -613,10 +613,10 @@
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{16}
}
@@ -631,12 +631,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{0}
}
@@ -648,12 +648,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{4}
}
@@ -665,12 +665,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{8}
}
@@ -682,12 +682,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{12}
}
@@ -745,7 +745,7 @@
Decorations{
BuiltinDecoration{vertex_idx}
}
- tint_pulling_vertex_index
+ _tint_pulling_vertex_index
in
__i32
}
@@ -754,7 +754,7 @@
BindingDecoration{0}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_0
+ _tint_pulling_vertex_buffer_0
storage_buffer
__struct_
}
@@ -763,7 +763,7 @@
BindingDecoration{1}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_1
+ _tint_pulling_vertex_buffer_1
storage_buffer
__struct_
}
@@ -772,7 +772,7 @@
BindingDecoration{2}
SetDecoration{4}
}
- tint_pulling_vertex_buffer_2
+ _tint_pulling_vertex_buffer_2
storage_buffer
__struct_
}
@@ -783,16 +783,16 @@
Block{
VariableDeclStatement{
Variable{
- tint_pulling_pos
+ _tint_pulling_pos
function
__i32
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{8}
}
@@ -807,12 +807,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{0}
}
@@ -824,12 +824,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_0}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_0}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{4}
}
@@ -841,10 +841,10 @@
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{12}
}
@@ -859,12 +859,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_1}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_1}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{0}
}
@@ -876,12 +876,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_1}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_1}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{4}
}
@@ -893,12 +893,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_1}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_1}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{8}
}
@@ -910,10 +910,10 @@
}
}
Assignment{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
Binary{
Binary{
- Identifier{tint_pulling_vertex_index}
+ Identifier{_tint_pulling_vertex_index}
multiply
ScalarConstructor{16}
}
@@ -928,12 +928,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_2}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_2}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{0}
}
@@ -945,12 +945,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_2}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_2}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{4}
}
@@ -962,12 +962,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_2}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_2}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{8}
}
@@ -979,12 +979,12 @@
Bitcast<__f32>{
ArrayAccessor{
MemberAccessor{
- Identifier{tint_pulling_vertex_buffer_2}
- Identifier{data}
+ Identifier{_tint_pulling_vertex_buffer_2}
+ Identifier{_tint_vertex_data}
}
Binary{
Binary{
- Identifier{tint_pulling_pos}
+ Identifier{_tint_pulling_pos}
add
ScalarConstructor{12}
}