Tint/GLSL: rename identifiers containing double-underscores.
This is prohibited by the GLSL ES spec:
"In addition, all identifiers containing two consecutive underscores (__) are reserved for use by underlying
software layers. Defining such a name in a shader does not itself result in an error, but may result in
unintended behaviors that stem from having multiple definitions of the same name."
(https://registry.khronos.org/OpenGL/specs/es/3.1/GLSL_ES_Specification_3.10.withchanges.pdf, section 3.7).
However, while glslang validation will not give an error on this, NVidia
ES drivers will. So I've added a Dawn end2end test instead of a WGSL test.
Bug: tint:1944
Change-Id: I4b965af00039ca7a232bc11be884483f8e02ccf6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/134140
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/tests/end2end/ShaderTests.cpp b/src/dawn/tests/end2end/ShaderTests.cpp
index fc94c48..683e361 100644
--- a/src/dawn/tests/end2end/ShaderTests.cpp
+++ b/src/dawn/tests/end2end/ShaderTests.cpp
@@ -1462,6 +1462,48 @@
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8(255, 255, 255, 255), renderPass.color, 0, 0);
}
+// Test that identifiers containing double underscores are renamed in the GLSL backend.
+TEST_P(ShaderTests, DoubleUnderscore) {
+ wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
+@vertex
+fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4f {
+ const pos = array(
+ vec2( 1.0, -1.0),
+ vec2(-1.0, -1.0),
+ vec2( 0.0, 1.0),
+ );
+ return vec4(pos[VertexIndex], 0.0, 1.0);
+})");
+
+ wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
+diagnostic(off, derivative_uniformity);
+
+@fragment
+fn main() -> @location(0) vec4f {
+ let re__sult = vec4f(1.0);
+ return re__sult;
+})");
+
+ utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);
+
+ utils::ComboRenderPipelineDescriptor descriptor;
+ descriptor.vertex.module = vsModule;
+ descriptor.cFragment.module = fsModule;
+ descriptor.primitive.topology = wgpu::PrimitiveTopology::TriangleList;
+ descriptor.cTargets[0].format = renderPass.colorFormat;
+ wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
+
+ wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
+ wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
+ pass.SetPipeline(pipeline);
+ pass.Draw(3);
+ pass.End();
+ wgpu::CommandBuffer commands = encoder.Finish();
+ queue.Submit(1, &commands);
+
+ EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8(255, 255, 255, 255), renderPass.color, 0, 0);
+}
+
DAWN_INSTANTIATE_TEST(ShaderTests,
D3D11Backend(),
D3D12Backend(),
diff --git a/src/tint/ast/transform/renamer.cc b/src/tint/ast/transform/renamer.cc
index b7c03a1..ff669f7 100644
--- a/src/tint/ast/transform/renamer.cc
+++ b/src/tint/ast/transform/renamer.cc
@@ -1350,7 +1350,7 @@
kReservedKeywordsGLSL +
sizeof(kReservedKeywordsGLSL) / sizeof(const char*),
name) ||
- name.compare(0, 3, "gl_") == 0;
+ name.compare(0, 3, "gl_") == 0 || name.find("__") != std::string::npos;
case Target::kHlslKeywords:
return std::binary_search(
kReservedKeywordsHLSL,
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
index 9e34bab..873c746 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
@@ -15,7 +15,7 @@
int arg_0;
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -25,15 +25,15 @@
} sb_rw;
void atomicCompareExchangeWeak_1bd40a() {
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, 1, 1);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_19 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_19, (x_19 == 1));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_19, (x_19 == 1));
+ res = tint_symbol_2;
return;
}
@@ -66,7 +66,7 @@
int arg_0;
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -76,15 +76,15 @@
} sb_rw;
void atomicCompareExchangeWeak_1bd40a() {
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, 1, 1);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_19 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_19, (x_19 == 1));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_19, (x_19 == 1));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
index cb7126a..36812c3 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
@@ -15,7 +15,7 @@
uint arg_0;
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -25,15 +25,15 @@
} sb_rw;
void atomicCompareExchangeWeak_63d8e6() {
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, 1u, 1u);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1u;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_17 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_17, (x_17 == 1u));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_17, (x_17 == 1u));
+ res = tint_symbol_2;
return;
}
@@ -66,7 +66,7 @@
uint arg_0;
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -76,15 +76,15 @@
} sb_rw;
void atomicCompareExchangeWeak_63d8e6() {
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, 1u, 1u);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1u;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_17 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_17, (x_17 == 1u));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_17, (x_17 == 1u));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
index e84462a..6e8440d 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
@@ -6,7 +6,7 @@
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -14,15 +14,15 @@
uint local_invocation_index_1 = 0u;
shared int arg_0;
void atomicCompareExchangeWeak_e88938() {
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(arg_0, 1, 1);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_18 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_18, (x_18 == 1));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_18, (x_18 == 1));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
index b8db0ed..b127c4a 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
@@ -6,7 +6,7 @@
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -14,15 +14,15 @@
uint local_invocation_index_1 = 0u;
shared uint arg_0;
void atomicCompareExchangeWeak_83580d() {
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(arg_0, 1u, 1u);
atomic_compare_result.exchanged = atomic_compare_result.old_value == 1u;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_17 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_17, (x_17 == 1u));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_17, (x_17 == 1u));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
index dffc402..0ae1686 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.glsl
@@ -15,7 +15,7 @@
int arg_0;
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -27,7 +27,7 @@
void atomicCompareExchangeWeak_1bd40a() {
int arg_1 = 0;
int arg_2 = 0;
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
arg_1 = 1;
arg_2 = 1;
int x_23 = arg_2;
@@ -35,11 +35,11 @@
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, x_24, x_23);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_24;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_25 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_25, (x_25 == x_23));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_25, (x_25 == x_23));
+ res = tint_symbol_2;
return;
}
@@ -72,7 +72,7 @@
int arg_0;
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -84,7 +84,7 @@
void atomicCompareExchangeWeak_1bd40a() {
int arg_1 = 0;
int arg_2 = 0;
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
arg_1 = 1;
arg_2 = 1;
int x_23 = arg_2;
@@ -92,11 +92,11 @@
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, x_24, x_23);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_24;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_25 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_25, (x_25 == x_23));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_25, (x_25 == x_23));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
index 7c0b63f..a52bb8e 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.glsl
@@ -15,7 +15,7 @@
uint arg_0;
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -27,7 +27,7 @@
void atomicCompareExchangeWeak_63d8e6() {
uint arg_1 = 0u;
uint arg_2 = 0u;
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
arg_1 = 1u;
arg_2 = 1u;
uint x_21 = arg_2;
@@ -35,11 +35,11 @@
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, x_22, x_21);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_22;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_23 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_23, (x_23 == x_21));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_23, (x_23 == x_21));
+ res = tint_symbol_2;
return;
}
@@ -72,7 +72,7 @@
uint arg_0;
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -84,7 +84,7 @@
void atomicCompareExchangeWeak_63d8e6() {
uint arg_1 = 0u;
uint arg_2 = 0u;
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
arg_1 = 1u;
arg_2 = 1u;
uint x_21 = arg_2;
@@ -92,11 +92,11 @@
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(sb_rw.inner.arg_0, x_22, x_21);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_22;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_23 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_23, (x_23 == x_21));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_23, (x_23 == x_21));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
index c93cea2..18b479f 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.glsl
@@ -6,7 +6,7 @@
};
-struct x__atomic_compare_exchange_resulti32 {
+struct tint_symbol {
int old_value;
bool exchanged;
};
@@ -16,7 +16,7 @@
void atomicCompareExchangeWeak_e88938() {
int arg_1 = 0;
int arg_2 = 0;
- x__atomic_compare_exchange_resulti32 res = x__atomic_compare_exchange_resulti32(0, false);
+ tint_symbol res = tint_symbol(0, false);
arg_1 = 1;
arg_2 = 1;
int x_22 = arg_2;
@@ -24,11 +24,11 @@
atomic_compare_exchange_result_i32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(arg_0, x_23, x_22);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_23;
- atomic_compare_exchange_result_i32 tint_symbol = atomic_compare_result;
- int old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_i32 tint_symbol_1 = atomic_compare_result;
+ int old_value_1 = tint_symbol_1.old_value;
int x_24 = old_value_1;
- x__atomic_compare_exchange_resulti32 tint_symbol_1 = x__atomic_compare_exchange_resulti32(x_24, (x_24 == x_22));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_24, (x_24 == x_22));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
index 920a16e..51e6c91 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.glsl
@@ -6,7 +6,7 @@
};
-struct x__atomic_compare_exchange_resultu32 {
+struct tint_symbol {
uint old_value;
bool exchanged;
};
@@ -16,7 +16,7 @@
void atomicCompareExchangeWeak_83580d() {
uint arg_1 = 0u;
uint arg_2 = 0u;
- x__atomic_compare_exchange_resultu32 res = x__atomic_compare_exchange_resultu32(0u, false);
+ tint_symbol res = tint_symbol(0u, false);
arg_1 = 1u;
arg_2 = 1u;
uint x_21 = arg_2;
@@ -24,11 +24,11 @@
atomic_compare_exchange_result_u32 atomic_compare_result;
atomic_compare_result.old_value = atomicCompSwap(arg_0, x_22, x_21);
atomic_compare_result.exchanged = atomic_compare_result.old_value == x_22;
- atomic_compare_exchange_result_u32 tint_symbol = atomic_compare_result;
- uint old_value_1 = tint_symbol.old_value;
+ atomic_compare_exchange_result_u32 tint_symbol_1 = atomic_compare_result;
+ uint old_value_1 = tint_symbol_1.old_value;
uint x_23 = old_value_1;
- x__atomic_compare_exchange_resultu32 tint_symbol_1 = x__atomic_compare_exchange_resultu32(x_23, (x_23 == x_21));
- res = tint_symbol_1;
+ tint_symbol tint_symbol_2 = tint_symbol(x_23, (x_23 == x_21));
+ res = tint_symbol_2;
return;
}
diff --git a/test/tint/identifiers/underscore/double/fn.wgsl.expected.glsl b/test/tint/identifiers/underscore/double/fn.wgsl.expected.glsl
index 8e59b08..03def72 100644
--- a/test/tint/identifiers/underscore/double/fn.wgsl.expected.glsl
+++ b/test/tint/identifiers/underscore/double/fn.wgsl.expected.glsl
@@ -7,14 +7,14 @@
void a() {
}
-void a__() {
+void tint_symbol() {
}
void b() {
a();
}
-void b__() {
- a__();
+void tint_symbol_1() {
+ tint_symbol();
}
diff --git a/test/tint/identifiers/underscore/double/let.wgsl.expected.glsl b/test/tint/identifiers/underscore/double/let.wgsl.expected.glsl
index f274d04..638acd9 100644
--- a/test/tint/identifiers/underscore/double/let.wgsl.expected.glsl
+++ b/test/tint/identifiers/underscore/double/let.wgsl.expected.glsl
@@ -6,8 +6,8 @@
}
void f() {
int a = 1;
- int a__ = a;
+ int tint_symbol = a;
int b = a;
- int b__ = a__;
+ int tint_symbol_1 = tint_symbol;
}
diff --git a/test/tint/identifiers/underscore/double/parameter.wgsl.expected.glsl b/test/tint/identifiers/underscore/double/parameter.wgsl.expected.glsl
index 1c7262a..8e82935 100644
--- a/test/tint/identifiers/underscore/double/parameter.wgsl.expected.glsl
+++ b/test/tint/identifiers/underscore/double/parameter.wgsl.expected.glsl
@@ -4,7 +4,7 @@
void unused_entry_point() {
return;
}
-void f(int a__) {
- int b = a__;
+void f(int tint_symbol) {
+ int b = tint_symbol;
}
diff --git a/test/tint/identifiers/underscore/double/struct.wgsl.expected.glsl b/test/tint/identifiers/underscore/double/struct.wgsl.expected.glsl
index 9eb009e..a6ac4ff 100644
--- a/test/tint/identifiers/underscore/double/struct.wgsl.expected.glsl
+++ b/test/tint/identifiers/underscore/double/struct.wgsl.expected.glsl
@@ -8,12 +8,12 @@
int b;
};
-struct a__ {
- int b__;
+struct tint_symbol {
+ int tint_symbol_1;
};
void f() {
- a__ c = a__(0);
- int d = c.b__;
+ tint_symbol c = tint_symbol(0);
+ int d = c.tint_symbol_1;
}
diff --git a/test/tint/identifiers/underscore/double/var.wgsl.expected.glsl b/test/tint/identifiers/underscore/double/var.wgsl.expected.glsl
index f61376a..9addc29 100644
--- a/test/tint/identifiers/underscore/double/var.wgsl.expected.glsl
+++ b/test/tint/identifiers/underscore/double/var.wgsl.expected.glsl
@@ -5,9 +5,9 @@
return;
}
int a = 1;
-int a__ = 2;
+int tint_symbol = 2;
void f() {
int b = a;
- int b__ = a__;
+ int tint_symbol_1 = tint_symbol;
}