[tint][msl] Fix C++17 warning.
Bug: tint:2125
Change-Id: Id8189ffb5a77fbce409cb0b0ee14656b0da55f6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/171240
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
index 718770e..81caedb 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
@@ -3018,16 +3018,17 @@
return true;
}
-std::string_view ASTPrinter::IsolateUB() {
+std::string ASTPrinter::IsolateUB() {
if (isolate_ub_macro_name_.empty()) {
isolate_ub_macro_name_ = UniqueIdentifier("TINT_ISOLATE_UB");
- auto volatile_true = UniqueIdentifier("tint_volatile_true");
- Line(&helpers_) << "#define " << isolate_ub_macro_name_ << " \\";
- Line(&helpers_) << " if (volatile bool " << volatile_true << " = true; " << volatile_true
- << ")";
+ Line(&helpers_) << "#define " << isolate_ub_macro_name_ << "(VOLATILE_NAME) \\";
+ Line(&helpers_) << " volatile bool VOLATILE_NAME = true; \\";
+ Line(&helpers_) << " if (VOLATILE_NAME)";
Line(&helpers_);
}
- return isolate_ub_macro_name_;
+ StringStream ss;
+ ss << isolate_ub_macro_name_ << "(" << UniqueIdentifier("tint_volatile_true") << ")";
+ return ss.str();
}
template <typename F>
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.h b/src/tint/lang/msl/writer/ast_printer/ast_printer.h
index 70269c9..a9e9378 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.h
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.h
@@ -380,8 +380,8 @@
/// Lazilly generates the TINT_ISOLATE_UB macro, used to prevent UB statements from affecting
/// later logic.
- /// @return the unique name of the TINT_ISOLATE_UB macro.
- std::string_view IsolateUB();
+ /// @return the MSL to call the TINT_ISOLATE_UB macro.
+ std::string IsolateUB();
/// Handles generating a builtin name
/// @param builtin the semantic info for the builtin
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer_test.cc b/src/tint/lang/msl/writer/ast_printer/ast_printer_test.cc
index 74d8fdd..28a2d3e 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer_test.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer_test.cc
@@ -226,15 +226,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_3 {
tint_array<float2x2, 4> m;
};
void comp_main_inner(uint local_invocation_index, threadgroup tint_array<float2x2, 4>* const tint_symbol) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float2x2(float2(0.0f), float2(0.0f));
}
diff --git a/src/tint/lang/msl/writer/ast_printer/continue_test.cc b/src/tint/lang/msl/writer/ast_printer/continue_test.cc
index 727f05c..ad68153 100644
--- a/src/tint/lang/msl/writer/ast_printer/continue_test.cc
+++ b/src/tint/lang/msl/writer/ast_printer/continue_test.cc
@@ -44,11 +44,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void test_function() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (false) {
break;
}
diff --git a/src/tint/lang/msl/writer/ast_printer/loop_test.cc b/src/tint/lang/msl/writer/ast_printer/loop_test.cc
index 7aed227..3d1dd64 100644
--- a/src/tint/lang/msl/writer/ast_printer/loop_test.cc
+++ b/src/tint/lang/msl/writer/ast_printer/loop_test.cc
@@ -51,11 +51,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
fragment void F() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
break;
}
return;
@@ -80,14 +81,15 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void a_statement() {
}
fragment void F() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
break;
{
a_statement();
@@ -115,14 +117,15 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void a_statement() {
}
fragment void F() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
break;
{
a_statement();
@@ -156,8 +159,8 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(outer)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while(true) {
- TINT_ISOLATE_UB while(true) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
break;
{
a_statement();
@@ -194,7 +197,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(outer)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while(true) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while(true) {
float lhs = 2.5f;
float other = 0.0f;
break;
@@ -217,7 +220,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB for(; ; ) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) for(; ; ) {
return;
}
)");
@@ -235,7 +238,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB for(int i = 0; ; ) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; ; ) {
return;
}
)");
@@ -266,7 +269,7 @@
f(1);
f(2);
}
- TINT_ISOLATE_UB for(; ; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; ; ) {
return;
}
}
@@ -285,7 +288,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB for(; true; ) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) for(; true; ) {
return;
}
)");
@@ -304,8 +307,9 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(),
- R"(TINT_ISOLATE_UB for(; ; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ EXPECT_EQ(
+ gen.Result(),
+ R"(TINT_ISOLATE_UB(tint_volatile_true) for(; ; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
return;
}
)");
@@ -331,7 +335,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(loop)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while(true) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while(true) {
return;
{
f(1);
@@ -357,7 +361,7 @@
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
EXPECT_EQ(
gen.Result(),
- R"(TINT_ISOLATE_UB for(int i = 0; true; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ R"(TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; true; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
a_statement();
}
)");
@@ -389,7 +393,7 @@
f(1);
f(2);
}
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!(true)) { break; }
return;
{
@@ -412,7 +416,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while(true) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while(true) {
return;
}
)");
@@ -429,7 +433,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while(true) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while(true) {
continue;
}
)");
@@ -449,7 +453,7 @@
ASTPrinter& gen = Build();
ASSERT_TRUE(gen.EmitStatement(f)) << gen.Diagnostics();
- EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB while((t && false)) {
+ EXPECT_EQ(gen.Result(), R"(TINT_ISOLATE_UB(tint_volatile_true) while((t && false)) {
return;
}
)");
diff --git a/test/tint/array/assign_to_function_var.wgsl.expected.msl b/test/tint/array/assign_to_function_var.wgsl.expected.msl
index 2c9731b..8de70f5 100644
--- a/test/tint/array/assign_to_function_var.wgsl.expected.msl
+++ b/test/tint/array/assign_to_function_var.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
tint_array<int4, 4> src_private;
@@ -57,7 +58,7 @@
}
void tint_symbol_inner(uint local_invocation_index, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<int4, 4>* const tint_symbol_8, const constant S* const tint_symbol_9, device S* const tint_symbol_10) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_8))[i] = int4(0);
}
diff --git a/test/tint/array/assign_to_private_var.wgsl.expected.msl b/test/tint/array/assign_to_private_var.wgsl.expected.msl
index 5e2e692..5fe77e8 100644
--- a/test/tint/array/assign_to_private_var.wgsl.expected.msl
+++ b/test/tint/array/assign_to_private_var.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
tint_array<int4, 4> src_private;
@@ -57,7 +58,7 @@
}
void tint_symbol_inner(uint local_invocation_index, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<int4, 4>* const tint_symbol_8, const constant S* const tint_symbol_9, device S* const tint_symbol_10) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_8))[i] = int4(0);
}
diff --git a/test/tint/array/assign_to_storage_var.wgsl.expected.msl b/test/tint/array/assign_to_storage_var.wgsl.expected.msl
index e0a8b7d..bdfe75a 100644
--- a/test/tint/array/assign_to_storage_var.wgsl.expected.msl
+++ b/test/tint/array/assign_to_storage_var.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
tint_array<int4, 4> src_private;
@@ -59,7 +60,7 @@
}
void tint_symbol_inner(uint local_invocation_index, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<int4, 4>* const tint_symbol_10, device S* const tint_symbol_11, const constant S* const tint_symbol_12, device S* const tint_symbol_13, device S_nested* const tint_symbol_14) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_10))[i] = int4(0);
}
diff --git a/test/tint/array/assign_to_workgroup_var.wgsl.expected.msl b/test/tint/array/assign_to_workgroup_var.wgsl.expected.msl
index bc6e5d4..e45a4b0 100644
--- a/test/tint/array/assign_to_workgroup_var.wgsl.expected.msl
+++ b/test/tint/array/assign_to_workgroup_var.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
tint_array<int4, 4> src_private;
@@ -55,12 +56,12 @@
}
void tint_symbol_inner(uint local_invocation_index, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<int4, 4>* const tint_symbol_10, threadgroup tint_array<int4, 4>* const tint_symbol_11, threadgroup tint_array<tint_array<tint_array<int, 2>, 3>, 4>* const tint_symbol_12, const constant S* const tint_symbol_13, device S* const tint_symbol_14) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_10))[i] = int4(0);
(*(tint_symbol_11))[i] = int4(0);
}
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index; (idx_1 < 24u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index; (idx_1 < 24u); idx_1 = (idx_1 + 1u)) {
uint const i_1 = (idx_1 / 6u);
uint const i_2 = ((idx_1 % 6u) / 2u);
uint const i_3 = (idx_1 % 2u);
diff --git a/test/tint/array/strides.spvasm.expected.msl b/test/tint/array/strides.spvasm.expected.msl
index 3499687..331afc2 100644
--- a/test/tint/array/strides.spvasm.expected.msl
+++ b/test/tint/array/strides.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct strided_arr {
/* 0x0000 */ float el;
@@ -36,13 +37,13 @@
}
void assign_and_preserve_padding_3(device tint_array<strided_arr, 2>* const dest, tint_array<strided_arr, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
assign_and_preserve_padding_4(&((*(dest))[i]), value[i]);
}
}
void assign_and_preserve_padding_2(device tint_array<tint_array<strided_arr, 2>, 3>* const dest, tint_array<tint_array<strided_arr, 2>, 3> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 3u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint i = 0u; (i < 3u); i = (i + 1u)) {
assign_and_preserve_padding_3(&((*(dest))[i]), value[i]);
}
}
@@ -52,7 +53,7 @@
}
void assign_and_preserve_padding(device tint_array<strided_arr_1, 4>* const dest, tint_array<strided_arr_1, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
index d4470df..beaa591 100644
--- a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -105,7 +106,7 @@
}
void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
index ee7f114..ba02219 100644
--- a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -160,7 +161,7 @@
}
void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
index 7d6a510..69afba3 100644
--- a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -107,7 +108,7 @@
}
void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i].elements = packed_float3(value[i]);
}
}
diff --git a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
index f28bf39..ef66275 100644
--- a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -164,7 +165,7 @@
}
void assign_and_preserve_padding_6(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
(*(dest))[i].elements = packed_float3(value[i]);
}
}
@@ -176,7 +177,7 @@
}
void assign_and_preserve_padding_8(device tint_array<Inner, 4>* const dest, tint_array<Inner, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_7(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.msl
index d9ef1ab..8c973bd 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float2x2, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<float2x2, 4>* const tint_symbol, const constant tint_array<float2x2, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float2x2(float2(0.0f), float2(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
index e09bee8..064fbc7 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
@@ -38,7 +39,7 @@
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* const dest, tint_array<half2x3, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
index 80b97c0..8a967df 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_7 {
tint_array<half2x3, 4> w;
@@ -37,7 +38,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<half2x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4>* const tint_symbol_1, device half* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = half2x3(half3(0.0h), half3(0.0h));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
index 6ca9dae..caa5898 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -38,7 +39,7 @@
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* const dest, tint_array<float2x3, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
index 01ed488..90c28f4 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float2x3, 4> w;
@@ -37,7 +38,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<float2x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float2x3(float3(0.0f), float3(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.msl
index 4dd72bb..010d0e7 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<half2x4, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<half2x4, 4>* const tint_symbol, const constant tint_array<half2x4, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = half2x4(half4(0.0h), half4(0.0h));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.msl
index 8219d90..642a8e1 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float2x4, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<float2x4, 4>* const tint_symbol, const constant tint_array<float2x4, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float2x4(float4(0.0f), float4(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
index 084c472..774ab90 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -39,7 +40,7 @@
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* const dest, tint_array<float3x3, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
index aacf68d..ade5401 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float3x3, 4> w;
@@ -37,7 +38,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<float3x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float3x3(float3(0.0f), float3(0.0f), float3(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.msl
index 7d93adf..5773552 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float3x4, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<float3x4, 4>* const tint_symbol, const constant tint_array<float3x4, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float3x4(float4(0.0f), float4(0.0f), float4(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.msl
index 9c7eb06..0814a7d 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<half4x2, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<half4x2, 4>* const tint_symbol, const constant tint_array<half4x2, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = half4x2(half2(0.0h), half2(0.0h), half2(0.0h), half2(0.0h));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.msl
index 346f524..ba4fff3 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float4x2, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<float4x2, 4>* const tint_symbol, const constant tint_array<float4x2, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float4x2(float2(0.0f), float2(0.0f), float2(0.0f), float2(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
index b83bc68..4193d09 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
@@ -40,7 +41,7 @@
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4>* const dest, tint_array<half4x3, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
index a887469..90a5714 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<half4x3, 4> w;
@@ -37,7 +38,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<half4x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = half4x3(half3(0.0h), half3(0.0h), half3(0.0h), half3(0.0h));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
index 7891af0..3aa3e7d 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -40,7 +41,7 @@
}
void assign_and_preserve_padding(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4>* const dest, tint_array<float4x3, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
index efad62c..7c41b15 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float4x3, 4> w;
@@ -37,7 +38,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<float4x3, 4>* const tint_symbol, const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float4x3(float3(0.0f), float3(0.0f), float3(0.0f), float3(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.msl
index 1a5b6c4..b6a330f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<half4x4, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<half4x4, 4>* const tint_symbol, const constant tint_array<half4x4, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = half4x4(half4(0.0h), half4(0.0h), half4(0.0h), half4(0.0h));
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.msl
index d0a15df..d834d87 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,15 +14,16 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_5 {
tint_array<float4x4, 4> w;
};
void f_inner(uint local_invocation_index, threadgroup tint_array<float4x4, 4>* const tint_symbol, const constant tint_array<float4x4, 4>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i] = float4x4(float4(0.0f), float4(0.0f), float4(0.0f), float4(0.0f));
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.msl
index b9955f2..cb8a8d8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -32,7 +33,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.msl
index 5c82a33..4197aca 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.msl
index 34e488f..0084bbe 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.msl
index 3f279dc..199abfb 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
index 56713e0..2d8a663 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
@@ -67,7 +68,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
index 588aaab..2b3c31c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -60,7 +61,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
index ff079b0..6eac46f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -67,7 +68,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
index d33bd36..589edbc 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -60,7 +61,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.msl
index ad499d1..ccc6b0a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.msl
index d159c8c..96d7dd3 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.msl
index 25e5698..ed35a67 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.msl
index e5b4037..f23ac67 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.msl
index abdbcb8..805b281 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -32,7 +33,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.msl
index e42dc9b..8f15a71 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.msl
index 8044d64..005e620 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.msl
index e48327d..34e4808 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
index 82c29d0..655bc2d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
@@ -68,7 +69,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
index 6933c8e..b3f3dc8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -60,7 +61,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
index b5946b4..07d8848 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -67,7 +68,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
index f97c99e..6c1cf8c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -59,7 +60,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.msl
index 76fa2d8..71ee1ce 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.msl
index be68271..f018f8f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.msl
index cd77cae..4ca161f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -32,7 +33,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.msl
index 82d11af..149aa04 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.msl
index f02b27e..9350b1f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -32,7 +33,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.msl
index 5e57962..b58a037 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.msl
index 4713bde..f463cad 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.msl
index 0f591ce..2c686d0 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
index 752e4c5..a32e29f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f16_array_element {
/* 0x0000 */ packed_half3 elements;
@@ -69,7 +70,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
index 6428fa2..12f8a4c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -60,7 +61,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
index ec467fa..eebace9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -69,7 +70,7 @@
}
void assign_and_preserve_padding(device tint_array<S_tint_packed_vec3, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
index 45ddab1..78c0ba8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int before;
@@ -60,7 +61,7 @@
}
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S_tint_packed_vec3, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.msl
index 69895c5..ed271f9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.msl
index ad29c63..1fe454a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.msl
index 5153c38..e62b530 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -33,7 +34,7 @@
}
void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 4u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 4u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.msl
index a97f92f..2d8ee79 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
/* 0x0000 */ int before;
@@ -31,7 +32,7 @@
};
void f_inner(uint local_invocation_index, threadgroup tint_array<S, 4>* const tint_symbol_1, const constant tint_array<S, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
S const tint_symbol = S{};
(*(tint_symbol_1))[i] = tint_symbol;
diff --git a/test/tint/bug/chromium/1403752.wgsl.expected.msl b/test/tint/bug/chromium/1403752.wgsl.expected.msl
index 7ae6187..4b4bc84 100644
--- a/test/tint/bug/chromium/1403752.wgsl.expected.msl
+++ b/test/tint/bug/chromium/1403752.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void d() {
int j = 0;
- TINT_ISOLATE_UB for(; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; false; ) {
}
}
diff --git a/test/tint/bug/chromium/1449538.wgsl.expected.msl b/test/tint/bug/chromium/1449538.wgsl.expected.msl
index c9600a2..f317e66 100644
--- a/test/tint/bug/chromium/1449538.wgsl.expected.msl
+++ b/test/tint/bug/chromium/1449538.wgsl.expected.msl
@@ -2,25 +2,26 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
- TINT_ISOLATE_UB for(int i0520 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i0520 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i62 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int i62 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i0520 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(int i0520 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i62 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_3) for(int i62 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i62 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_4) for(int i62 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i60 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_5) for(int i60 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i62 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_6) for(int i62 = 0; false; ) {
}
- TINT_ISOLATE_UB for(int i60 = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true_7) for(int i60 = 0; false; ) {
}
}
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.msl b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.msl
index b14a8c8..a0b7b5d 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct UBO {
/* 0x0000 */ int dynamic_idx;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup S* const tint_symbol, device Result* const tint_symbol_1, const constant UBO* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol)).data[i] = 0;
}
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.msl b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.msl
index 3ac2c9d..34a9062 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct UBO {
/* 0x0000 */ int dynamic_idx;
@@ -30,7 +31,7 @@
};
void f_inner(uint local_invocation_index, threadgroup S* const tint_symbol, const constant UBO* const tint_symbol_1, device Result* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol)).data[i] = 0;
}
diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl
index 8a54b5e..d5797f0 100644
--- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl
+++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float2 vUV [[user(locn0)]];
@@ -16,7 +17,7 @@
float4 tint_symbol_inner(float2 vUV, texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5) {
float3 const random = tint_symbol_4.sample(tint_symbol_5, vUV).rgb;
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((i < 1)) {
} else {
break;
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_loop.wgsl.expected.msl b/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_loop.wgsl.expected.msl
index da64fd9..54555c1 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_loop.wgsl.expected.msl
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_loop.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
float2 v2f;
@@ -13,7 +14,7 @@
};
void foo(thread tint_private_vars_struct* const tint_private_vars) {
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
(*(tint_private_vars)).v2f[i] = 1.0f;
(*(tint_private_vars)).v3i[i] = 1;
(*(tint_private_vars)).v4u[i] = 1u;
@@ -23,7 +24,7 @@
kernel void tint_symbol() {
thread tint_private_vars_struct tint_private_vars = {};
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_private_vars));
}
return;
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_no_loop.wgsl.expected.msl b/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_no_loop.wgsl.expected.msl
index af0bc02..0be7944 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_no_loop.wgsl.expected.msl
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_call_with_no_loop.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
float2 v2f;
@@ -22,7 +23,7 @@
kernel void tint_symbol() {
thread tint_private_vars_struct tint_private_vars = {};
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_private_vars));
}
return;
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_all.wgsl.expected.msl b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_all.wgsl.expected.msl
index 0c01f6d..2304b9f 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_all.wgsl.expected.msl
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_all.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
float2 v2f = 0.0f;
@@ -18,7 +19,7 @@
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3f[i] = 1.0f;
v4f[i] = 1.0f;
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_repeated.wgsl.expected.msl b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_repeated.wgsl.expected.msl
index e455d47..478a818 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_repeated.wgsl.expected.msl
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_repeated.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
float2 v2f = 0.0f;
@@ -14,7 +15,7 @@
uint4 v4u_2 = 0u;
bool2 v2b = false;
bool2 v2b_2 = false;
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3i[i] = 1;
v4u[i] = 1u;
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.msl b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.msl
index 1904207..3faf230 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.msl
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
float2 v2f = 0.0f;
@@ -18,7 +19,7 @@
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v2i[i] = 1;
v2u[i] = 1u;
diff --git a/test/tint/bug/tint/1064.wgsl.expected.msl b/test/tint/bug/tint/1064.wgsl.expected.msl
index 3b9997e..4ea4a7c 100644
--- a/test/tint/bug/tint/1064.wgsl.expected.msl
+++ b/test/tint/bug/tint/1064.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
fragment void tint_symbol() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (false) {
} else {
break;
diff --git a/test/tint/bug/tint/1081.wgsl.expected.msl b/test/tint/bug/tint/1081.wgsl.expected.msl
index d1ab933..64f9887 100644
--- a/test/tint/bug/tint/1081.wgsl.expected.msl
+++ b/test/tint/bug/tint/1081.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
bool tint_discarded;
@@ -26,7 +27,7 @@
int tint_symbol_inner(int3 x, thread tint_private_vars_struct* const tint_private_vars) {
int y = x[0];
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
int const r = f(y, tint_private_vars);
if ((r == 0)) {
break;
diff --git a/test/tint/bug/tint/1121.wgsl.expected.msl b/test/tint/bug/tint/1121.wgsl.expected.msl
index 9f26018..bf996f9 100644
--- a/test/tint/bug/tint/1121.wgsl.expected.msl
+++ b/test/tint/bug/tint/1121.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct LightData_tint_packed_vec3 {
/* 0x0000 */ float4 position;
@@ -87,8 +88,8 @@
int const TILE_SIZE = 16;
int const TILE_COUNT_X = 2;
int const TILE_COUNT_Y = 2;
- TINT_ISOLATE_UB for(int y = 0; (y < TILE_COUNT_Y); y = as_type<int>((as_type<uint>(y) + as_type<uint>(1)))) {
- TINT_ISOLATE_UB for(int x = 0; (x < TILE_COUNT_X); x = as_type<int>((as_type<uint>(x) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int y = 0; (y < TILE_COUNT_Y); y = as_type<int>((as_type<uint>(y) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int x = 0; (x < TILE_COUNT_X); x = as_type<int>((as_type<uint>(x) + as_type<uint>(1)))) {
int2 tilePixel0Idx = int2(as_type<int>((as_type<uint>(x) * as_type<uint>(TILE_SIZE))), as_type<int>((as_type<uint>(y) * as_type<uint>(TILE_SIZE))));
float2 floorCoord = (((2.0f * float2(tilePixel0Idx)) / (*(tint_symbol_3)).fullScreenSize.xy) - float2(1.0f));
float2 ceilCoord = (((2.0f * float2(as_type<int2>((as_type<uint2>(tilePixel0Idx) + as_type<uint2>(int2(TILE_SIZE)))))) / (*(tint_symbol_3)).fullScreenSize.xy) - float2(1.0f));
@@ -99,7 +100,7 @@
frustumPlanes[2] = float4(0.0f, 1.0f, (-(viewFloorCoord[1]) / viewNear), 0.0f);
frustumPlanes[3] = float4(0.0f, -1.0f, (viewCeilCoord[1] / viewNear), 0.0f);
float dp = 0.0f;
- TINT_ISOLATE_UB for(uint i = 0u; (i < 6u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint i = 0u; (i < 6u); i = (i + 1u)) {
float4 p = 0.0f;
if ((frustumPlanes[i][0] > 0.0f)) {
p[0] = boxMax[0];
diff --git a/test/tint/bug/tint/1321.wgsl.expected.msl b/test/tint/bug/tint/1321.wgsl.expected.msl
index 2d4a466..8dfe5a5 100644
--- a/test/tint/bug/tint/1321.wgsl.expected.msl
+++ b/test/tint/bug/tint/1321.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int foo() {
return 1;
@@ -26,7 +27,7 @@
{
int const tint_symbol_1 = foo();
int const a_save = tint_symbol_1;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
{
float const x = arr[a_save];
break;
diff --git a/test/tint/bug/tint/1474-a.wgsl.expected.msl b/test/tint/bug/tint/1474-a.wgsl.expected.msl
index dda1010..4d8d438 100644
--- a/test/tint/bug/tint/1474-a.wgsl.expected.msl
+++ b/test/tint/bug/tint/1474-a.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (true) {
break;
} else {
diff --git a/test/tint/bug/tint/1538.wgsl.expected.msl b/test/tint/bug/tint/1538.wgsl.expected.msl
index bff79a4..87ec4d5 100644
--- a/test/tint/bug/tint/1538.wgsl.expected.msl
+++ b/test/tint/bug/tint/1538.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
template<typename T, size_t N>
struct tint_array {
@@ -22,7 +23,7 @@
}
int f() {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
g();
break;
}
@@ -31,7 +32,7 @@
}
kernel void tint_symbol(device tint_array<uint, 1>* tint_symbol_1 [[buffer(0)]]) {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
if (((*(tint_symbol_1))[0] == 0u)) {
break;
}
diff --git a/test/tint/bug/tint/1557.wgsl.expected.msl b/test/tint/bug/tint/1557.wgsl.expected.msl
index d47a9f9..c4a412f 100644
--- a/test/tint/bug/tint/1557.wgsl.expected.msl
+++ b/test/tint/bug/tint/1557.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
return 0;
@@ -11,7 +12,7 @@
void g() {
int j = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((j >= 1)) {
break;
}
diff --git a/test/tint/bug/tint/1604.wgsl.expected.msl b/test/tint/bug/tint/1604.wgsl.expected.msl
index 10273a4..beb2f4d 100644
--- a/test/tint/bug/tint/1604.wgsl.expected.msl
+++ b/test/tint/bug/tint/1604.wgsl.expected.msl
@@ -2,13 +2,14 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol(const constant int* tint_symbol_1 [[buffer(0)]]) {
switch(*(tint_symbol_1)) {
case 0: {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
return;
}
break;
diff --git a/test/tint/bug/tint/1605.wgsl.expected.msl b/test/tint/bug/tint/1605.wgsl.expected.msl
index bface6e..86a658c 100644
--- a/test/tint/bug/tint/1605.wgsl.expected.msl
+++ b/test/tint/bug/tint/1605.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
bool func_3(const constant int* const tint_symbol_1) {
- TINT_ISOLATE_UB for(int i = 0; (i < *(tint_symbol_1)); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
- TINT_ISOLATE_UB for(int j = -1; (j == 1); j = as_type<int>((as_type<uint>(j) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < *(tint_symbol_1)); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int j = -1; (j == 1); j = as_type<int>((as_type<uint>(j) + as_type<uint>(1)))) {
return false;
}
}
diff --git a/test/tint/bug/tint/1764.wgsl.expected.msl b/test/tint/bug/tint/1764.wgsl.expected.msl
index ded1dcc..c1e8f28 100644
--- a/test/tint/bug/tint/1764.wgsl.expected.msl
+++ b/test/tint/bug/tint/1764.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<int, 246>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 246u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 246u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_1))[i] = 0;
}
diff --git a/test/tint/bug/tint/2010.spvasm.expected.msl b/test/tint/bug/tint/2010.spvasm.expected.msl
index c528ebb..7b4aa0d 100644
--- a/test/tint/bug/tint/2010.spvasm.expected.msl
+++ b/test/tint/bug/tint/2010.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint3 x_3;
@@ -49,7 +50,7 @@
uint x_88 = 0u;
uint const x_52 = (*(tint_private_vars)).x_3[0];
x_54 = 0u;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
uint x_55 = 0u;
x_58 = (*(tint_symbol_3)).field0.field0;
if ((x_54 < x_58)) {
@@ -81,7 +82,7 @@
}
x_85 = x_76.xyxy;
x_88 = 1u;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
float4 x_111 = 0.0f;
float4 x_86 = 0.0f;
uint x_89 = 0u;
@@ -131,7 +132,7 @@
atomic_store_explicit(tint_symbol_13, 0u, memory_order_relaxed);
atomic_store_explicit(tint_symbol_14, 0u, memory_order_relaxed);
}
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 32u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 32u)) {
uint const i = idx;
S const tint_symbol_1 = S{};
(*(tint_symbol_15))[i] = tint_symbol_1;
diff --git a/test/tint/bug/tint/2059.wgsl.expected.msl b/test/tint/bug/tint/2059.wgsl.expected.msl
index 3488383..5588ec6 100644
--- a/test/tint/bug/tint/2059.wgsl.expected.msl
+++ b/test/tint/bug/tint/2059.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_packed_vec3_f32_array_element {
/* 0x0000 */ packed_float3 elements;
@@ -65,7 +66,7 @@
}
void assign_and_preserve_padding_3(device tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 1>* const dest, tint_array<float3x3, 1> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 1u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 1u); i = (i + 1u)) {
assign_and_preserve_padding(&((*(dest))[i]), value[i]);
}
}
@@ -79,7 +80,7 @@
}
void assign_and_preserve_padding_6(device tint_array<S_tint_packed_vec3, 1>* const dest, tint_array<S, 1> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 1u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint i = 0u; (i < 1u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
@@ -89,14 +90,14 @@
}
void assign_and_preserve_padding_7(device tint_array<S2_tint_packed_vec3, 1>* const dest, tint_array<S2, 1> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 1u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint i = 0u; (i < 1u); i = (i + 1u)) {
assign_and_preserve_padding_2(&((*(dest))[i]), value[i]);
}
}
kernel void tint_symbol(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_8 [[buffer(0)]], device S_tint_packed_vec3* tint_symbol_9 [[buffer(1)]], device S2_tint_packed_vec3* tint_symbol_10 [[buffer(2)]], device S3_tint_packed_vec3* tint_symbol_11 [[buffer(3)]], device S4_tint_packed_vec3* tint_symbol_12 [[buffer(4)]], device tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 1>* tint_symbol_13 [[buffer(5)]], device tint_array<S_tint_packed_vec3, 1>* tint_symbol_14 [[buffer(6)]], device tint_array<S2_tint_packed_vec3, 1>* tint_symbol_15 [[buffer(7)]]) {
float3x3 m = float3x3(0.0f);
- TINT_ISOLATE_UB for(uint c = 0u; (c < 3u); c = (c + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_3) for(uint c = 0u; (c < 3u); c = (c + 1u)) {
m[c] = float3(float(((c * 3u) + 1u)), float(((c * 3u) + 2u)), float(((c * 3u) + 3u)));
}
{
diff --git a/test/tint/bug/tint/221.wgsl.expected.msl b/test/tint/bug/tint/221.wgsl.expected.msl
index 79c1851..c418ea4 100644
--- a/test/tint/bug/tint/221.wgsl.expected.msl
+++ b/test/tint/bug/tint/221.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Buf {
/* 0x0000 */ uint count;
@@ -28,7 +29,7 @@
kernel void tint_symbol(device Buf* tint_symbol_1 [[buffer(0)]]) {
uint i = 0u;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((i >= (*(tint_symbol_1)).count)) {
break;
}
diff --git a/test/tint/bug/tint/534.wgsl.expected.msl b/test/tint/bug/tint/534.wgsl.expected.msl
index 1594381..4a79dfc 100644
--- a/test/tint/bug/tint/534.wgsl.expected.msl
+++ b/test/tint/bug/tint/534.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
uint4 tint_ftou(float4 v) {
return select(uint4(4294967295u), select(uint4(v), uint4(0u), (v < float4(0.0f))), (v < float4(4294967040.0f)));
@@ -48,7 +49,7 @@
bool success = true;
uint4 srcColorBits = 0u;
uint4 dstColorBits = tint_ftou(dstColor);
- TINT_ISOLATE_UB for(uint i = 0u; (i < (*(tint_symbol_3)).channelCount); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < (*(tint_symbol_3)).channelCount); i = (i + 1u)) {
uint const tint_symbol_1 = i;
srcColorBits[tint_symbol_1] = ConvertToFp16FloatValue(srcColor[i]);
success = (success && (srcColorBits[i] == dstColorBits[i]));
diff --git a/test/tint/bug/tint/744.wgsl.expected.msl b/test/tint/bug/tint/744.wgsl.expected.msl
index 9300f34..ccb621f 100644
--- a/test/tint/bug/tint/744.wgsl.expected.msl
+++ b/test/tint/bug/tint/744.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Uniforms {
/* 0x0000 */ uint2 aShape;
@@ -32,7 +33,7 @@
uint const dimInner = (*(tint_symbol_1)).aShape[1];
uint const dimOutter = (*(tint_symbol_1)).outShape[1];
uint result = 0u;
- TINT_ISOLATE_UB for(uint i = 0u; (i < dimInner); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < dimInner); i = (i + 1u)) {
uint const a = (i + (resultCell[0] * dimInner));
uint const b = (resultCell[1] + (i * dimOutter));
result = (result + ((*(tint_symbol_2)).numbers[a] * (*(tint_symbol_3)).numbers[b]));
diff --git a/test/tint/bug/tint/757.wgsl.expected.msl b/test/tint/bug/tint/757.wgsl.expected.msl
index b70aae4..b59e7b3 100644
--- a/test/tint/bug/tint/757.wgsl.expected.msl
+++ b/test/tint/bug/tint/757.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Constants {
int level;
@@ -29,7 +30,7 @@
uint flatIndex = (((4u * GlobalInvocationID[2]) + (2u * GlobalInvocationID[1])) + GlobalInvocationID[0]);
flatIndex = (flatIndex * 1u);
float4 texel = tint_symbol_1.read(uint2(int2(GlobalInvocationID.xy)), 0, 0);
- TINT_ISOLATE_UB for(uint i = 0u; (i < 1u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 1u); i = (i + 1u)) {
(*(tint_symbol_2)).values[(flatIndex + i)] = texel[0];
}
}
diff --git a/test/tint/bug/tint/914.wgsl.expected.msl b/test/tint/bug/tint/914.wgsl.expected.msl
index 2c3568d..7456ef8 100644
--- a/test/tint/bug/tint/914.wgsl.expected.msl
+++ b/test/tint/bug/tint/914.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Uniforms {
/* 0x0000 */ uint dimAOuter;
@@ -55,7 +56,7 @@
}
void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_index, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_11, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_12, const constant Uniforms* const tint_symbol_13, const device Matrix* const tint_symbol_14, const device Matrix* const tint_symbol_15, device Matrix* const tint_symbol_16) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 256u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 256u)) {
uint const i = (idx / 64u);
uint const i_1 = (idx % 64u);
(*(tint_symbol_11))[i][i_1] = 0.0f;
@@ -70,16 +71,16 @@
tint_array<float, 16> acc = {};
float ACached = 0.0f;
tint_array<float, 4> BCached = {};
- TINT_ISOLATE_UB for(uint index = 0u; (index < 16u); index = (index + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint index = 0u; (index < 16u); index = (index + 1u)) {
acc[index] = 0.0f;
}
uint const ColPerThreadA = 4u;
uint const tileColA = (local_id[0] * ColPerThreadA);
uint const RowPerThreadB = 4u;
uint const tileRowB = (local_id[1] * RowPerThreadB);
- TINT_ISOLATE_UB for(uint t = 0u; (t < numTiles); t = (t + 1u)) {
- TINT_ISOLATE_UB for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
- TINT_ISOLATE_UB for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint t = 0u; (t < numTiles); t = (t + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_3) for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_4) for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
uint const inputRow = (tileRow + innerRow);
uint const inputCol = (tileColA + innerCol);
uint const tint_symbol_1 = inputRow;
@@ -87,8 +88,8 @@
(*(tint_symbol_11))[tint_symbol_1][tint_symbol_2] = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol), tint_symbol_13, tint_symbol_14);
}
}
- TINT_ISOLATE_UB for(uint innerRow = 0u; (innerRow < RowPerThreadB); innerRow = (innerRow + 1u)) {
- TINT_ISOLATE_UB for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_5) for(uint innerRow = 0u; (innerRow < RowPerThreadB); innerRow = (innerRow + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_6) for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint const inputRow = (tileRowB + innerRow);
uint const inputCol = (tileCol + innerCol);
uint const tint_symbol_3 = innerCol;
@@ -97,13 +98,13 @@
}
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- TINT_ISOLATE_UB for(uint k = 0u; (k < 64u); k = (k + 1u)) {
- TINT_ISOLATE_UB for(uint inner = 0u; (inner < 4u); inner = (inner + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_7) for(uint k = 0u; (k < 64u); k = (k + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_8) for(uint inner = 0u; (inner < 4u); inner = (inner + 1u)) {
BCached[inner] = (*(tint_symbol_12))[k][(tileCol + inner)];
}
- TINT_ISOLATE_UB for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_9) for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
ACached = (*(tint_symbol_11))[(tileRow + innerRow)][k];
- TINT_ISOLATE_UB for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_10) for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint const index = ((innerRow * 4u) + innerCol);
acc[index] = (acc[index] + (ACached * BCached[innerCol]));
}
@@ -111,8 +112,8 @@
}
threadgroup_barrier(mem_flags::mem_threadgroup);
}
- TINT_ISOLATE_UB for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
- TINT_ISOLATE_UB for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_11) for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_12) for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint const index = ((innerRow * 4u) + innerCol);
mm_write((globalRow + innerRow), (globalCol + innerCol), acc[index], tint_symbol_13, tint_symbol_16);
}
diff --git a/test/tint/bug/tint/942.wgsl.expected.msl b/test/tint/bug/tint/942.wgsl.expected.msl
index 7a7d361..0e2fc15 100644
--- a/test/tint/bug/tint/942.wgsl.expected.msl
+++ b/test/tint/bug/tint/942.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Params {
/* 0x0000 */ uint filterDim;
@@ -31,7 +32,7 @@
}
void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_invocation_index, threadgroup tint_array<tint_array<float3, 256>, 4>* const tint_symbol_1, const constant Params* const tint_symbol_2, texture2d<float, access::sample> tint_symbol_3, const constant Flip* const tint_symbol_4, sampler tint_symbol_5, texture2d<float, access::write> tint_symbol_6) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 1024u); idx = (idx + 64u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 1024u); idx = (idx + 64u)) {
uint const i_1 = (idx / 256u);
uint const i_2 = (idx % 256u);
(*(tint_symbol_1))[i_1][i_2] = float3(0.0f);
@@ -40,8 +41,8 @@
uint const filterOffset = tint_div(((*(tint_symbol_2)).filterDim - 1u), 2u);
uint2 const dims = uint2(tint_symbol_3.get_width(0), tint_symbol_3.get_height(0));
uint2 const baseIndex = (((WorkGroupID.xy * uint2((*(tint_symbol_2)).blockDim, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u))) - uint2(filterOffset, 0u));
- TINT_ISOLATE_UB for(uint r = 0u; (r < 4u); r = (r + 1u)) {
- TINT_ISOLATE_UB for(uint c = 0u; (c < 4u); c = (c + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint r = 0u; (r < 4u); r = (r + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_2) for(uint c = 0u; (c < 4u); c = (c + 1u)) {
uint2 loadIndex = (baseIndex + uint2(c, r));
if (((*(tint_symbol_4)).value != 0u)) {
loadIndex = loadIndex.yx;
@@ -50,8 +51,8 @@
}
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- TINT_ISOLATE_UB for(uint r = 0u; (r < 4u); r = (r + 1u)) {
- TINT_ISOLATE_UB for(uint c = 0u; (c < 4u); c = (c + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_3) for(uint r = 0u; (r < 4u); r = (r + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_4) for(uint c = 0u; (c < 4u); c = (c + 1u)) {
uint2 writeIndex = (baseIndex + uint2(c, r));
if (((*(tint_symbol_4)).value != 0u)) {
writeIndex = writeIndex.yx;
@@ -59,7 +60,7 @@
uint const center = ((4u * LocalInvocationID[0]) + c);
if ((((center >= filterOffset) && (center < (256u - filterOffset))) && all((writeIndex < dims)))) {
float3 acc = float3(0.0f);
- TINT_ISOLATE_UB for(uint f = 0u; (f < (*(tint_symbol_2)).filterDim); f = (f + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_5) for(uint f = 0u; (f < (*(tint_symbol_2)).filterDim); f = (f + 1u)) {
uint i = ((center + f) - filterOffset);
acc = (acc + ((1.0f / float((*(tint_symbol_2)).filterDim)) * (*(tint_symbol_1))[r][i]));
}
diff --git a/test/tint/bug/tint/948.wgsl.expected.msl b/test/tint/bug/tint/948.wgsl.expected.msl
index 0047f1c..cc95fb8 100644
--- a/test/tint/bug/tint/948.wgsl.expected.msl
+++ b/test/tint/bug/tint/948.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
float2 tUV;
@@ -101,7 +102,7 @@
float2 const x_111 = (*(tint_symbol_8)).stageSize;
stageUnits = (float2(1.0f) / x_111);
i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
int const x_122 = i;
if ((x_122 < 2)) {
} else {
@@ -137,7 +138,7 @@
float const x_184 = animationData[2];
(*(tint_private_vars)).mt = fmod((x_181 * x_184), 1.0f);
f = 0.0f;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
float const x_193 = f;
if ((x_193 < 8.0f)) {
} else {
diff --git a/test/tint/bug/tint/949.wgsl.expected.msl b/test/tint/bug/tint/949.wgsl.expected.msl
index d8b8c4f..b832adc6 100644
--- a/test/tint/bug/tint/949.wgsl.expected.msl
+++ b/test/tint/bug/tint/949.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
float u_Float;
@@ -333,7 +334,7 @@
lastSampledHeight = 1.0f;
currSampledHeight = 1.0f;
i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
int const x_388 = i;
if ((x_388 < 15)) {
} else {
diff --git a/test/tint/bug/tint/990.wgsl.expected.msl b/test/tint/bug/tint/990.wgsl.expected.msl
index ec5a232..09a7dbc 100644
--- a/test/tint/bug/tint/990.wgsl.expected.msl
+++ b/test/tint/bug/tint/990.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; false; ) {
}
}
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl
index 9c324b7..e009490 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint local_invocation_index_1;
@@ -32,7 +33,7 @@
void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol) {
uint idx = 0u;
idx = local_invocation_index_2;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((idx < 6u))) {
break;
}
@@ -56,7 +57,7 @@
}
void compute_main_inner_1(uint local_invocation_index_1_param, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 6u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 6u); idx_1 = (idx_1 + 1u)) {
uint const i = (idx_1 / 2u);
uint const i_1 = (idx_1 % 2u);
uint const i_2 = (idx_1 % 1u);
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.msl b/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.msl
index 3ae828f..b568170 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.msl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void compute_main_inner(uint local_invocation_index, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
uint const i = (idx / 2u);
uint const i_1 = (idx % 2u);
uint const i_2 = (idx % 1u);
diff --git a/test/tint/builtins/atomicStore/array/array.spvasm.expected.msl b/test/tint/builtins/atomicStore/array/array.spvasm.expected.msl
index 312a5cf..16afbf7 100644
--- a/test/tint/builtins/atomicStore/array/array.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/array/array.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint local_invocation_index_1;
@@ -24,7 +25,7 @@
void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<atomic_uint, 4>* const tint_symbol) {
uint idx = 0u;
idx = local_invocation_index_2;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((idx < 4u))) {
break;
}
@@ -46,7 +47,7 @@
}
void compute_main_inner_1(uint local_invocation_index_1_param, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<atomic_uint, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 4u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 4u); idx_1 = (idx_1 + 1u)) {
uint const i = idx_1;
atomic_store_explicit(&((*(tint_symbol_2))[i]), 0u, memory_order_relaxed);
}
diff --git a/test/tint/builtins/atomicStore/array/array.wgsl.expected.msl b/test/tint/builtins/atomicStore/array/array.wgsl.expected.msl
index d5d5e27..9477dfb 100644
--- a/test/tint/builtins/atomicStore/array/array.wgsl.expected.msl
+++ b/test/tint/builtins/atomicStore/array/array.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void compute_main_inner(uint local_invocation_index, threadgroup tint_array<atomic_uint, 4>* const tint_symbol) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
atomic_store_explicit(&((*(tint_symbol))[i]), 0u, memory_order_relaxed);
}
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
index 9c324b7..e009490 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint local_invocation_index_1;
@@ -32,7 +33,7 @@
void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol) {
uint idx = 0u;
idx = local_invocation_index_2;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((idx < 6u))) {
break;
}
@@ -56,7 +57,7 @@
}
void compute_main_inner_1(uint local_invocation_index_1_param, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 6u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 6u); idx_1 = (idx_1 + 1u)) {
uint const i = (idx_1 / 2u);
uint const i_1 = (idx_1 % 2u);
uint const i_2 = (idx_1 % 1u);
diff --git a/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.msl b/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.msl
index 3ae828f..b568170 100644
--- a/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.msl
+++ b/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void compute_main_inner(uint local_invocation_index, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
uint const i = (idx / 2u);
uint const i_1 = (idx % 2u);
uint const i_2 = (idx % 1u);
diff --git a/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.msl b/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.msl
index 431c5c2..858e4d9 100644
--- a/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint local_invocation_index_1;
@@ -36,7 +37,7 @@
void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<S_atomic, 10>* const tint_symbol) {
uint idx = 0u;
idx = local_invocation_index_2;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((idx < 10u))) {
break;
}
@@ -60,7 +61,7 @@
}
void compute_main_inner_1(uint local_invocation_index_1_param, thread tint_private_vars_struct* const tint_private_vars, threadgroup tint_array<S_atomic, 10>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 10u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 10u); idx_1 = (idx_1 + 1u)) {
uint const i = idx_1;
(*(tint_symbol_2))[i].x = 0;
atomic_store_explicit(&((*(tint_symbol_2))[i].a), 0u, memory_order_relaxed);
diff --git a/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.msl b/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.msl
index 04d1917..bef111c 100644
--- a/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.msl
+++ b/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int x;
@@ -24,7 +25,7 @@
};
void compute_main_inner(uint local_invocation_index, threadgroup tint_array<S, 10>* const tint_symbol) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 10u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 10u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol))[i].x = 0;
atomic_store_explicit(&((*(tint_symbol))[i].a), 0u, memory_order_relaxed);
diff --git a/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.msl b/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.msl
index 1e6af34..1ca5272 100644
--- a/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint local_invocation_index_1;
@@ -38,7 +39,7 @@
(*(tint_symbol)).x = 0;
(*(tint_symbol)).y = 0u;
idx = local_invocation_index_2;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((idx < 10u))) {
break;
}
@@ -64,7 +65,7 @@
(*(tint_symbol_2)).x = 0;
(*(tint_symbol_2)).y = 0u;
}
- TINT_ISOLATE_UB for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 10u); idx_1 = (idx_1 + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(uint idx_1 = local_invocation_index_1_param; (idx_1 < 10u); idx_1 = (idx_1 + 1u)) {
uint const i = idx_1;
atomic_store_explicit(&((*(tint_symbol_2)).a[i]), 0u, memory_order_relaxed);
}
diff --git a/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.msl b/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.msl
index ad1e165..487589e 100644
--- a/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.msl
+++ b/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int x;
@@ -28,7 +29,7 @@
(*(tint_symbol)).x = 0;
(*(tint_symbol)).y = 0u;
}
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 10u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 10u); idx = (idx + 1u)) {
uint const i = idx;
atomic_store_explicit(&((*(tint_symbol)).a[i]), 0u, memory_order_relaxed);
}
diff --git a/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.msl b/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.msl
index 2242f0f..9d7fb7d 100644
--- a/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.msl
+++ b/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.msl
@@ -2,13 +2,14 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void foo(texture2d<int, access::read_write> tint_symbol) {
{
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((i < 3))) {
break;
}
diff --git a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.msl b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.msl
index b840f6f..5a52532 100644
--- a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.msl
+++ b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int tint_workgroupUniformLoad(threadgroup int* const p) {
threadgroup_barrier(mem_flags::mem_threadgroup);
@@ -15,7 +16,7 @@
void foo(threadgroup int* const tint_symbol_4, threadgroup int* const tint_symbol_5) {
{
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
int const tint_symbol = i;
int const tint_symbol_1 = tint_workgroupUniformLoad(tint_symbol_4);
if (!((tint_symbol < tint_symbol_1))) {
diff --git a/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.msl
index 071ba03..63a1789 100644
--- a/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.msl
@@ -14,8 +14,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
@@ -23,7 +24,7 @@
void tint_symbol_inner(float x) {
float4 v = float4(0.0f);
- TINT_ISOLATE_UB for(; ((x > v[0]) && (dfdx(1.0f) > 0.0f)); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; ((x > v[0]) && (dfdx(1.0f) > 0.0f)); ) {
}
}
diff --git a/test/tint/diagnostic_filtering/for_loop_body_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/for_loop_body_attribute.wgsl.expected.msl
index f410fb6..68189b2 100644
--- a/test/tint/diagnostic_filtering/for_loop_body_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/for_loop_body_attribute.wgsl.expected.msl
@@ -14,8 +14,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
@@ -23,7 +24,7 @@
void tint_symbol_inner(float x, texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
float4 v = float4(0.0f);
- TINT_ISOLATE_UB for(; (x > v[0]); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (x > v[0]); ) {
v = tint_symbol_3.sample(tint_symbol_4, float2(0.0f));
}
}
diff --git a/test/tint/diagnostic_filtering/loop_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/loop_attribute.wgsl.expected.msl
index 3dae810..e8e448f 100644
--- a/test/tint/diagnostic_filtering/loop_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/loop_attribute.wgsl.expected.msl
@@ -14,15 +14,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
};
void tint_symbol_inner(float x) {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
{
if ((x > 0.0f)) { break; }
}
diff --git a/test/tint/diagnostic_filtering/loop_body_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/loop_body_attribute.wgsl.expected.msl
index 602c64b..1d37883 100644
--- a/test/tint/diagnostic_filtering/loop_body_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/loop_body_attribute.wgsl.expected.msl
@@ -14,15 +14,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
};
void tint_symbol_inner(float x) {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
{
if ((x > 0.0f)) { break; }
}
diff --git a/test/tint/diagnostic_filtering/loop_continuing_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/loop_continuing_attribute.wgsl.expected.msl
index 38499a3..93fca0d 100644
--- a/test/tint/diagnostic_filtering/loop_continuing_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/loop_continuing_attribute.wgsl.expected.msl
@@ -14,15 +14,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
};
void tint_symbol_inner(float x) {
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
{
if ((x > 0.0f)) { break; }
}
diff --git a/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.msl
index 2c394d5..686748f 100644
--- a/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.msl
@@ -14,8 +14,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
@@ -23,7 +24,7 @@
void tint_symbol_inner(float x) {
float4 v = float4(0.0f);
- TINT_ISOLATE_UB while(((x > 0.0f) && (dfdx(1.0f) > 0.0f))) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(((x > 0.0f) && (dfdx(1.0f) > 0.0f))) {
}
}
diff --git a/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl.expected.msl b/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl.expected.msl
index 649759e..b2e7ce2 100644
--- a/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl.expected.msl
+++ b/test/tint/diagnostic_filtering/while_loop_body_attribute.wgsl.expected.msl
@@ -14,8 +14,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_2 {
float x [[user(locn0)]];
@@ -23,7 +24,7 @@
void tint_symbol_inner(float x, texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
float4 v = float4(0.0f);
- TINT_ISOLATE_UB while((x > v[0])) {
+ TINT_ISOLATE_UB(tint_volatile_true) while((x > v[0])) {
v = tint_symbol_3.sample(tint_symbol_4, float2(0.0f));
}
}
diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.msl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.msl
index d82e019..74e58e2 100644
--- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.msl
+++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct strided_arr {
/* 0x0000 */ float2 el;
@@ -42,7 +43,7 @@
}
void assign_and_preserve_padding(device tint_array<strided_arr, 2>* const dest, tint_array<strided_arr, 2> value) {
- TINT_ISOLATE_UB for(uint i = 0u; (i < 2u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 2u); i = (i + 1u)) {
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
}
}
diff --git a/test/tint/loops/continue_in_switch.wgsl.expected.msl b/test/tint/loops/continue_in_switch.wgsl.expected.msl
index e2991a3..890daca 100644
--- a/test/tint/loops/continue_in_switch.wgsl.expected.msl
+++ b/test/tint/loops/continue_in_switch.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void f() {
- TINT_ISOLATE_UB for(int i = 0; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
switch(i) {
case 0: {
continue;
diff --git a/test/tint/loops/loop.wgsl.expected.msl b/test/tint/loops/loop.wgsl.expected.msl
index b26d512..3ab3d8e 100644
--- a/test/tint/loops/loop.wgsl.expected.msl
+++ b/test/tint/loops/loop.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
if ((i > 4)) {
return i;
diff --git a/test/tint/loops/loop_with_break_if.wgsl.expected.msl b/test/tint/loops/loop_with_break_if.wgsl.expected.msl
index 1344663..08f6c09 100644
--- a/test/tint/loops/loop_with_break_if.wgsl.expected.msl
+++ b/test/tint/loops/loop_with_break_if.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((i > 4)) {
return i;
}
diff --git a/test/tint/loops/loop_with_continuing.wgsl.expected.msl b/test/tint/loops/loop_with_continuing.wgsl.expected.msl
index 024d5b9..2f3b467 100644
--- a/test/tint/loops/loop_with_continuing.wgsl.expected.msl
+++ b/test/tint/loops/loop_with_continuing.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((i > 4)) {
return i;
}
diff --git a/test/tint/loops/multiple_continues.wgsl.expected.msl b/test/tint/loops/multiple_continues.wgsl.expected.msl
index 803ee58..f8aaba6 100644
--- a/test/tint/loops/multiple_continues.wgsl.expected.msl
+++ b/test/tint/loops/multiple_continues.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
switch(i) {
case 0: {
continue;
diff --git a/test/tint/loops/multiple_switch.wgsl.expected.msl b/test/tint/loops/multiple_switch.wgsl.expected.msl
index 5becfcc..0bad249 100644
--- a/test/tint/loops/multiple_switch.wgsl.expected.msl
+++ b/test/tint/loops/multiple_switch.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
int i = 0;
- TINT_ISOLATE_UB for(int i_1 = 0; (i_1 < 2); i_1 = as_type<int>((as_type<uint>(i_1) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i_1 = 0; (i_1 < 2); i_1 = as_type<int>((as_type<uint>(i_1) + as_type<uint>(1)))) {
switch(i_1) {
case 0: {
continue;
diff --git a/test/tint/loops/nested_loop_loop_switch.wgsl.expected.msl b/test/tint/loops/nested_loop_loop_switch.wgsl.expected.msl
index 01dd258..8940027 100644
--- a/test/tint/loops/nested_loop_loop_switch.wgsl.expected.msl
+++ b/test/tint/loops/nested_loop_loop_switch.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
- TINT_ISOLATE_UB for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
switch(i) {
case 0: {
continue;
diff --git a/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.msl b/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.msl
index e4d3cb7..2662928 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.msl
+++ b/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.msl
@@ -2,14 +2,15 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
switch(i) {
case 0: {
- TINT_ISOLATE_UB for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
switch(j) {
case 0: {
continue;
diff --git a/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.msl b/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.msl
index 5aa6cb9..47f158b 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.msl
+++ b/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.msl
@@ -2,15 +2,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
int k = 0;
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
switch(i) {
case 0: {
- TINT_ISOLATE_UB for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
switch(j) {
case 0: {
continue;
diff --git a/test/tint/loops/nested_loop_switch_switch.wgsl.expected.msl b/test/tint/loops/nested_loop_switch_switch.wgsl.expected.msl
index 1adeeb0..0f78ee3 100644
--- a/test/tint/loops/nested_loop_switch_switch.wgsl.expected.msl
+++ b/test/tint/loops/nested_loop_switch_switch.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
int j = 0;
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
switch(i) {
case 0: {
switch(j) {
diff --git a/test/tint/loops/nested_loops.wgsl.expected.msl b/test/tint/loops/nested_loops.wgsl.expected.msl
index 3c0a637..8f176cb 100644
--- a/test/tint/loops/nested_loops.wgsl.expected.msl
+++ b/test/tint/loops/nested_loops.wgsl.expected.msl
@@ -2,18 +2,19 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
int j = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
if ((i > 4)) {
return 1;
}
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
j = as_type<int>((as_type<uint>(j) + as_type<uint>(1)));
if ((j > 4)) {
return 2;
diff --git a/test/tint/loops/nested_loops_with_continuing.wgsl.expected.msl b/test/tint/loops/nested_loops_with_continuing.wgsl.expected.msl
index 000b361..25ea8bc 100644
--- a/test/tint/loops/nested_loops_with_continuing.wgsl.expected.msl
+++ b/test/tint/loops/nested_loops_with_continuing.wgsl.expected.msl
@@ -2,17 +2,18 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
int j = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((i > 4)) {
return 1;
}
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
if ((j > 4)) {
return 2;
}
diff --git a/test/tint/loops/single_continue.wgsl.expected.msl b/test/tint/loops/single_continue.wgsl.expected.msl
index f321a4b..e223c34 100644
--- a/test/tint/loops/single_continue.wgsl.expected.msl
+++ b/test/tint/loops/single_continue.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
kernel void tint_symbol() {
- TINT_ISOLATE_UB for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
switch(i) {
case 0: {
continue;
diff --git a/test/tint/loops/while.wgsl.expected.msl b/test/tint/loops/while.wgsl.expected.msl
index f7428f9..d044fb0 100644
--- a/test/tint/loops/while.wgsl.expected.msl
+++ b/test/tint/loops/while.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
- TINT_ISOLATE_UB while((i < 4)) {
+ TINT_ISOLATE_UB(tint_volatile_true) while((i < 4)) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
}
return i;
diff --git a/test/tint/loops/while_with_continue.wgsl.expected.msl b/test/tint/loops/while_with_continue.wgsl.expected.msl
index 65fe6f5..35233d4 100644
--- a/test/tint/loops/while_with_continue.wgsl.expected.msl
+++ b/test/tint/loops/while_with_continue.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
int f() {
int i = 0;
- TINT_ISOLATE_UB while((i < 4)) {
+ TINT_ISOLATE_UB(tint_volatile_true) while((i < 4)) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
continue;
}
diff --git a/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.msl b/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.msl
index 457eb5c..cc8c3ec 100644
--- a/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.msl
+++ b/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct str {
tint_array<int, 4> arr;
@@ -26,7 +27,7 @@
}
void tint_symbol_inner(uint local_invocation_index, threadgroup str* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_1)).arr[i] = 0;
}
diff --git a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.msl b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.msl
index 91fb413..bfeeb54 100644
--- a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.msl
+++ b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct str {
int i;
@@ -26,7 +27,7 @@
}
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<str, 4>* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i_1 = idx;
str const tint_symbol_1 = str{};
(*(tint_symbol_2))[i_1] = tint_symbol_1;
diff --git a/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.msl b/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.msl
index 140b544..eea4b36 100644
--- a/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.msl
+++ b/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct str {
tint_array<int, 4> arr;
@@ -27,7 +28,7 @@
}
void tint_symbol_inner(uint local_invocation_index, threadgroup str* const tint_symbol_2) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_2)).arr[i] = 0;
}
diff --git a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.msl b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.msl
index 054a738..ef74323 100644
--- a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.msl
+++ b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct str {
int i;
@@ -27,7 +28,7 @@
}
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<str, 4>* const tint_symbol_3) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i_1 = idx;
str const tint_symbol_1 = str{};
(*(tint_symbol_3))[i_1] = tint_symbol_1;
diff --git a/test/tint/samples/compute_boids.wgsl.expected.msl b/test/tint/samples/compute_boids.wgsl.expected.msl
index cec623c..e64ec48 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.msl
+++ b/test/tint/samples/compute_boids.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_symbol_1 {
float2 a_particlePos [[attribute(0)]];
@@ -88,7 +89,7 @@
int cVelCount = 0;
float2 pos = 0.0f;
float2 vel = 0.0f;
- TINT_ISOLATE_UB for(uint i = 0u; (i < 5u); i = (i + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint i = 0u; (i < 5u); i = (i + 1u)) {
if ((i == index)) {
continue;
}
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.msl
index 6972c31..091fcb0 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Uniforms {
/* 0x0000 */ uint i;
@@ -32,7 +33,7 @@
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
- TINT_ISOLATE_UB for(int i = 0; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
s1.a1[(*(tint_symbol_1)).i] = v;
}
return;
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.msl
index 1bbb83c..884c030 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Uniforms {
/* 0x0000 */ uint i;
@@ -32,7 +33,7 @@
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
- TINT_ISOLATE_UB for(int i = 0; (i < 4); s1.a1[(*(tint_symbol_1)).i] = v) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 4); s1.a1[(*(tint_symbol_1)).i] = v) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
}
return;
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.msl
index db29e84..4431501 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct Uniforms {
/* 0x0000 */ uint i;
@@ -33,7 +34,7 @@
InnerS v = {};
OuterS s1 = {};
int i = 0;
- TINT_ISOLATE_UB for(s1.a1[(*(tint_symbol_1)).i] = v; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(s1.a1[(*(tint_symbol_1)).i] = v; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
}
return;
}
diff --git a/test/tint/statements/compound_assign/for_loop.wgsl.expected.msl b/test/tint/statements/compound_assign/for_loop.wgsl.expected.msl
index 4a7047b..190496d 100644
--- a/test/tint/statements/compound_assign/for_loop.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/for_loop.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint i;
@@ -48,7 +49,7 @@
int const tint_symbol_2 = idx1(tint_private_vars);
int const tint_symbol_save = tint_symbol_2;
a[tint_symbol_save] = (a[tint_symbol_save] * 2.0f);
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
int const tint_symbol_3 = idx2(tint_private_vars);
if (!((a[tint_symbol_3] < 10.0f))) {
break;
diff --git a/test/tint/statements/decrement/complex.wgsl.expected.msl b/test/tint/statements/decrement/complex.wgsl.expected.msl
index 49634f7..e31aa32 100644
--- a/test/tint/statements/decrement/complex.wgsl.expected.msl
+++ b/test/tint/statements/decrement/complex.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint v;
@@ -63,7 +64,7 @@
int const tint_symbol_2_save_1 = tint_symbol_7;
int const tint_symbol_3 = idx3(tint_private_vars);
(*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] = as_type<int>((as_type<uint>((*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3]) - as_type<uint>(1)));
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!(((*(tint_private_vars)).v < 10u))) {
break;
}
diff --git a/test/tint/statements/decrement/for_loop_continuing.wgsl.expected.msl b/test/tint/statements/decrement/for_loop_continuing.wgsl.expected.msl
index 195cf52..46ba1a3 100644
--- a/test/tint/statements/decrement/for_loop_continuing.wgsl.expected.msl
+++ b/test/tint/statements/decrement/for_loop_continuing.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol(device uint* const tint_symbol_1) {
- TINT_ISOLATE_UB for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) - 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) - 1u)) {
}
}
diff --git a/test/tint/statements/decrement/for_loop_initializer.wgsl.expected.msl b/test/tint/statements/decrement/for_loop_initializer.wgsl.expected.msl
index bee2a0c..53fcca7 100644
--- a/test/tint/statements/decrement/for_loop_initializer.wgsl.expected.msl
+++ b/test/tint/statements/decrement/for_loop_initializer.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol(device uint* const tint_symbol_1) {
- TINT_ISOLATE_UB for(*(tint_symbol_1) = (*(tint_symbol_1) - 1u); (*(tint_symbol_1) < 10u); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(*(tint_symbol_1) = (*(tint_symbol_1) - 1u); (*(tint_symbol_1) < 10u); ) {
}
}
diff --git a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.msl b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.msl
index 9316b19..75776fc 100644
--- a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.msl
+++ b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
bool tint_discarded;
@@ -29,7 +30,7 @@
int result = tint_ftoi(tint_symbol_4.sample(tint_symbol_5, coord)[0]);
{
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!((i < 10))) {
break;
}
diff --git a/test/tint/statements/discard/multiple_returns.wgsl.expected.msl b/test/tint/statements/discard/multiple_returns.wgsl.expected.msl
index 6eac933..281e9bb 100644
--- a/test/tint/statements/discard/multiple_returns.wgsl.expected.msl
+++ b/test/tint/statements/discard/multiple_returns.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
bool tint_discarded;
@@ -20,7 +21,7 @@
}
if ((*(tint_symbol_2) < 0.0f)) {
int i = 0;
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((*(tint_symbol_2) > float(i))) {
if (!(tint_private_vars.tint_discarded)) {
*(tint_symbol_2) = float(i);
diff --git a/test/tint/statements/for/basic.wgsl.expected.msl b/test/tint/statements/for/basic.wgsl.expected.msl
index ecdaaf5..d43d02c 100644
--- a/test/tint/statements/for/basic.wgsl.expected.msl
+++ b/test/tint/statements/for/basic.wgsl.expected.msl
@@ -2,14 +2,15 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void some_loop_body() {
}
void f() {
- TINT_ISOLATE_UB for(int i = 0; (i < 5); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 5); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
some_loop_body();
}
}
diff --git a/test/tint/statements/for/complex.wgsl.expected.msl b/test/tint/statements/for/complex.wgsl.expected.msl
index 38b2dcb..a33d5d0 100644
--- a/test/tint/statements/for/complex.wgsl.expected.msl
+++ b/test/tint/statements/for/complex.wgsl.expected.msl
@@ -2,15 +2,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void some_loop_body() {
}
void f() {
int j = 0;
- TINT_ISOLATE_UB for(int i = 0; ((i < 5) && (j < 10)); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; ((i < 5) && (j < 10)); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
some_loop_body();
j = as_type<int>((as_type<uint>(i) * as_type<uint>(30)));
}
diff --git a/test/tint/statements/for/condition/array_ctor.wgsl.expected.msl b/test/tint/statements/for/condition/array_ctor.wgsl.expected.msl
index 225ca95..1ff0ed4 100644
--- a/test/tint/statements/for/condition/array_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/condition/array_ctor.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; (i < 1); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (i < 1); ) {
}
}
diff --git a/test/tint/statements/for/condition/basic.wgsl.expected.msl b/test/tint/statements/for/condition/basic.wgsl.expected.msl
index 9e4d48b..960d032 100644
--- a/test/tint/statements/for/condition/basic.wgsl.expected.msl
+++ b/test/tint/statements/for/condition/basic.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; (i < 4); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (i < 4); ) {
}
}
diff --git a/test/tint/statements/for/condition/struct_ctor.wgsl.expected.msl b/test/tint/statements/for/condition/struct_ctor.wgsl.expected.msl
index 1ce1740..848e21b 100644
--- a/test/tint/statements/for/condition/struct_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/condition/struct_ctor.wgsl.expected.msl
@@ -2,8 +2,9 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int i;
@@ -11,7 +12,7 @@
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; (i < 1); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (i < 1); ) {
}
}
diff --git a/test/tint/statements/for/continuing/array_ctor.wgsl.expected.msl b/test/tint/statements/for/continuing/array_ctor.wgsl.expected.msl
index 91eff5e..f40f0a7 100644
--- a/test/tint/statements/for/continuing/array_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/continuing/array_ctor.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
}
}
diff --git a/test/tint/statements/for/continuing/basic.wgsl.expected.msl b/test/tint/statements/for/continuing/basic.wgsl.expected.msl
index 91eff5e..f40f0a7 100644
--- a/test/tint/statements/for/continuing/basic.wgsl.expected.msl
+++ b/test/tint/statements/for/continuing/basic.wgsl.expected.msl
@@ -2,12 +2,13 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
int i = 0;
- TINT_ISOLATE_UB for(; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
}
}
diff --git a/test/tint/statements/for/continuing/struct_ctor.wgsl.expected.msl b/test/tint/statements/for/continuing/struct_ctor.wgsl.expected.msl
index 6b5fe78..549cf31 100644
--- a/test/tint/statements/for/continuing/struct_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/continuing/struct_ctor.wgsl.expected.msl
@@ -2,15 +2,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int i;
};
void f() {
- TINT_ISOLATE_UB for(int i = 0; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; false; i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
}
}
diff --git a/test/tint/statements/for/empty.wgsl.expected.msl b/test/tint/statements/for/empty.wgsl.expected.msl
index 92bb29d..3637121 100644
--- a/test/tint/statements/for/empty.wgsl.expected.msl
+++ b/test/tint/statements/for/empty.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
- TINT_ISOLATE_UB for(; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; false; ) {
}
}
diff --git a/test/tint/statements/for/initializer/array_ctor.wgsl.expected.msl b/test/tint/statements/for/initializer/array_ctor.wgsl.expected.msl
index e9d4bc4..5caf7e9 100644
--- a/test/tint/statements/for/initializer/array_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/initializer/array_ctor.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
- TINT_ISOLATE_UB for(int i = 1; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 1; false; ) {
}
}
diff --git a/test/tint/statements/for/initializer/basic.wgsl.expected.msl b/test/tint/statements/for/initializer/basic.wgsl.expected.msl
index f1ec896..d8c6ba5 100644
--- a/test/tint/statements/for/initializer/basic.wgsl.expected.msl
+++ b/test/tint/statements/for/initializer/basic.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
- TINT_ISOLATE_UB for(int i = 0; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; false; ) {
}
}
diff --git a/test/tint/statements/for/initializer/struct_ctor.wgsl.expected.msl b/test/tint/statements/for/initializer/struct_ctor.wgsl.expected.msl
index 1af8e13..3afd169 100644
--- a/test/tint/statements/for/initializer/struct_ctor.wgsl.expected.msl
+++ b/test/tint/statements/for/initializer/struct_ctor.wgsl.expected.msl
@@ -2,15 +2,16 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct S {
int i;
};
void f() {
- TINT_ISOLATE_UB for(int i = 1; false; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int i = 1; false; ) {
}
}
diff --git a/test/tint/statements/for/scoping.wgsl.expected.msl b/test/tint/statements/for/scoping.wgsl.expected.msl
index 74c7f3b..7ac803c 100644
--- a/test/tint/statements/for/scoping.wgsl.expected.msl
+++ b/test/tint/statements/for/scoping.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void f() {
- TINT_ISOLATE_UB for(int must_not_collide = 0; ; ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(int must_not_collide = 0; ; ) {
break;
}
int must_not_collide = 0;
diff --git a/test/tint/statements/increment/complex.wgsl.expected.msl b/test/tint/statements/increment/complex.wgsl.expected.msl
index 9f7b0fa..8ed663a 100644
--- a/test/tint/statements/increment/complex.wgsl.expected.msl
+++ b/test/tint/statements/increment/complex.wgsl.expected.msl
@@ -14,8 +14,9 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
struct tint_private_vars_struct {
uint v;
@@ -63,7 +64,7 @@
int const tint_symbol_2_save_1 = tint_symbol_7;
int const tint_symbol_3 = idx3(tint_private_vars);
(*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] = as_type<int>((as_type<uint>((*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3]) + as_type<uint>(1)));
- TINT_ISOLATE_UB while(true) {
+ TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if (!(((*(tint_private_vars)).v < 10u))) {
break;
}
diff --git a/test/tint/statements/increment/for_loop_continuing.wgsl.expected.msl b/test/tint/statements/increment/for_loop_continuing.wgsl.expected.msl
index e452d03..c3f779c 100644
--- a/test/tint/statements/increment/for_loop_continuing.wgsl.expected.msl
+++ b/test/tint/statements/increment/for_loop_continuing.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol(device uint* const tint_symbol_1) {
- TINT_ISOLATE_UB for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) + 1u)) {
}
}
diff --git a/test/tint/statements/increment/for_loop_initializer.wgsl.expected.msl b/test/tint/statements/increment/for_loop_initializer.wgsl.expected.msl
index f46177a..53257b5 100644
--- a/test/tint/statements/increment/for_loop_initializer.wgsl.expected.msl
+++ b/test/tint/statements/increment/for_loop_initializer.wgsl.expected.msl
@@ -2,11 +2,12 @@
using namespace metal;
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol(device uint* const tint_symbol_1) {
- TINT_ISOLATE_UB for(*(tint_symbol_1) = (*(tint_symbol_1) + 1u); (*(tint_symbol_1) < 10u); ) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(*(tint_symbol_1) = (*(tint_symbol_1) + 1u); (*(tint_symbol_1) < 10u); ) {
}
}
diff --git a/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.msl b/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.msl
index 37f33b9..53b0d79 100644
--- a/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.msl
+++ b/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<tint_array<int, 3>, 2>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 6u); idx = (idx + 1u)) {
uint const i = (idx / 3u);
uint const i_1 = (idx % 3u);
(*(tint_symbol_1))[i][i_1] = 0;
diff --git a/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.msl b/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.msl
index a1ca997..6039b69 100644
--- a/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.msl
+++ b/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.msl
@@ -14,11 +14,12 @@
T elements[N];
};
-#define TINT_ISOLATE_UB \
- if (volatile bool tint_volatile_true = true; tint_volatile_true)
+#define TINT_ISOLATE_UB(VOLATILE_NAME) \
+ volatile bool VOLATILE_NAME = true; \
+ if (VOLATILE_NAME)
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<int, 3>* const tint_symbol_1) {
- TINT_ISOLATE_UB for(uint idx = local_invocation_index; (idx < 3u); idx = (idx + 1u)) {
+ TINT_ISOLATE_UB(tint_volatile_true) for(uint idx = local_invocation_index; (idx < 3u); idx = (idx + 1u)) {
uint const i = idx;
(*(tint_symbol_1))[i] = 0;
}