Move tint::transform::Robustness to a santizier transform
There's no good reason for this to be public.
Move it into the writers, and expose a 'disable_robustness' option to
turn it off. This can be expanded to hold more fine-grain control in the
future.
Change-Id: I6ea6e54a27b2ae0fbcba5fdf45539063045cc15a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122203
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
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 a6aa784..5ffea48 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
@@ -215,12 +215,12 @@
(*(tint_symbol_5)).mat4x4_f16 = half4x4(half4(0.0h), half4(0.0h), half4(0.0h), half4(0.0h));
tint_array<float3, 2> const tint_symbol_1 = tint_array<float3, 2>{};
assign_and_preserve_padding_6(&((*(tint_symbol_5)).arr2_vec3_f32), tint_symbol_1);
- tint_array<half4x2, 2> const tint_symbol_4 = tint_array<half4x2, 2>{};
- (*(tint_symbol_5)).arr2_mat4x2_f16 = tint_symbol_4;
- Inner const tint_symbol_2 = Inner{};
- assign_and_preserve_padding_7(&((*(tint_symbol_5)).struct_inner), tint_symbol_2);
- tint_array<Inner, 4> const tint_symbol_3 = tint_array<Inner, 4>{};
- assign_and_preserve_padding_8(&((*(tint_symbol_5)).array_struct_inner), tint_symbol_3);
+ tint_array<half4x2, 2> const tint_symbol_2 = tint_array<half4x2, 2>{};
+ (*(tint_symbol_5)).arr2_mat4x2_f16 = tint_symbol_2;
+ Inner const tint_symbol_3 = Inner{};
+ assign_and_preserve_padding_7(&((*(tint_symbol_5)).struct_inner), tint_symbol_3);
+ tint_array<Inner, 4> const tint_symbol_4 = tint_array<Inner, 4>{};
+ assign_and_preserve_padding_8(&((*(tint_symbol_5)).array_struct_inner), tint_symbol_4);
return;
}
diff --git a/test/tint/bug/chromium/1386647.wgsl.expected.dxc.hlsl b/test/tint/bug/chromium/1386647.wgsl.expected.dxc.hlsl
index 424a72f..c659c3b 100644
--- a/test/tint/bug/chromium/1386647.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/chromium/1386647.wgsl.expected.dxc.hlsl
@@ -7,9 +7,7 @@
};
void f_inner(uint3 v) {
- const uint tint_symbol_2 = v.x;
- const uint tint_symbol_3 = tint_mod(v.y, 1u);
- const uint l = (tint_symbol_2 << (tint_symbol_3 & 31u));
+ const uint l = (v.x << (tint_mod(v.y, 1u) & 31u));
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/bug/chromium/1386647.wgsl.expected.fxc.hlsl b/test/tint/bug/chromium/1386647.wgsl.expected.fxc.hlsl
index 424a72f..c659c3b 100644
--- a/test/tint/bug/chromium/1386647.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/chromium/1386647.wgsl.expected.fxc.hlsl
@@ -7,9 +7,7 @@
};
void f_inner(uint3 v) {
- const uint tint_symbol_2 = v.x;
- const uint tint_symbol_3 = tint_mod(v.y, 1u);
- const uint l = (tint_symbol_2 << (tint_symbol_3 & 31u));
+ const uint l = (v.x << (tint_mod(v.y, 1u) & 31u));
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/bug/chromium/1386647.wgsl.expected.glsl b/test/tint/bug/chromium/1386647.wgsl.expected.glsl
index ab0cb6e..8f7b5c8 100644
--- a/test/tint/bug/chromium/1386647.wgsl.expected.glsl
+++ b/test/tint/bug/chromium/1386647.wgsl.expected.glsl
@@ -5,9 +5,7 @@
}
void f(uvec3 v) {
- uint tint_symbol = v.x;
- uint tint_symbol_1 = tint_mod(v.y, 1u);
- uint l = (tint_symbol << (tint_symbol_1 & 31u));
+ uint l = (v.x << (tint_mod(v.y, 1u) & 31u));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
diff --git a/test/tint/bug/chromium/1386647.wgsl.expected.msl b/test/tint/bug/chromium/1386647.wgsl.expected.msl
index 694a88a..d85fa99 100644
--- a/test/tint/bug/chromium/1386647.wgsl.expected.msl
+++ b/test/tint/bug/chromium/1386647.wgsl.expected.msl
@@ -6,9 +6,7 @@
}
void f_inner(uint3 v) {
- uint const tint_symbol = v[0];
- uint const tint_symbol_1 = tint_mod(v[1], 1u);
- uint const l = (tint_symbol << (tint_symbol_1 & 31u));
+ uint const l = (v[0] << (tint_mod(v[1], 1u) & 31u));
}
kernel void f(uint3 v [[thread_position_in_grid]]) {
diff --git a/test/tint/bug/tint/1076.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1076.wgsl.expected.dxc.hlsl
index 868773b..71abaff 100644
--- a/test/tint/bug/tint/1076.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1076.wgsl.expected.dxc.hlsl
@@ -16,13 +16,13 @@
if ((tint_symbol.mask == 0u)) {
return tint_symbol;
}
- const FragIn tint_symbol_4 = {b, 1u};
- return tint_symbol_4;
+ const FragIn tint_symbol_5 = {b, 1u};
+ return tint_symbol_5;
}
tint_symbol_3 main(tint_symbol_2 tint_symbol_1) {
- const FragIn tint_symbol_5 = {tint_symbol_1.a, tint_symbol_1.mask};
- const FragIn inner_result = main_inner(tint_symbol_5, tint_symbol_1.b);
+ const FragIn tint_symbol_4 = {tint_symbol_1.a, tint_symbol_1.mask};
+ const FragIn inner_result = main_inner(tint_symbol_4, tint_symbol_1.b);
tint_symbol_3 wrapper_result = (tint_symbol_3)0;
wrapper_result.a = inner_result.a;
wrapper_result.mask = inner_result.mask;
diff --git a/test/tint/bug/tint/1076.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1076.wgsl.expected.fxc.hlsl
index 868773b..71abaff 100644
--- a/test/tint/bug/tint/1076.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1076.wgsl.expected.fxc.hlsl
@@ -16,13 +16,13 @@
if ((tint_symbol.mask == 0u)) {
return tint_symbol;
}
- const FragIn tint_symbol_4 = {b, 1u};
- return tint_symbol_4;
+ const FragIn tint_symbol_5 = {b, 1u};
+ return tint_symbol_5;
}
tint_symbol_3 main(tint_symbol_2 tint_symbol_1) {
- const FragIn tint_symbol_5 = {tint_symbol_1.a, tint_symbol_1.mask};
- const FragIn inner_result = main_inner(tint_symbol_5, tint_symbol_1.b);
+ const FragIn tint_symbol_4 = {tint_symbol_1.a, tint_symbol_1.mask};
+ const FragIn inner_result = main_inner(tint_symbol_4, tint_symbol_1.b);
tint_symbol_3 wrapper_result = (tint_symbol_3)0;
wrapper_result.a = inner_result.a;
wrapper_result.mask = inner_result.mask;
diff --git a/test/tint/bug/tint/1076.wgsl.expected.msl b/test/tint/bug/tint/1076.wgsl.expected.msl
index 926bbcb..b01d931 100644
--- a/test/tint/bug/tint/1076.wgsl.expected.msl
+++ b/test/tint/bug/tint/1076.wgsl.expected.msl
@@ -20,13 +20,13 @@
if ((in.mask == 0u)) {
return in;
}
- FragIn const tint_symbol_4 = {.a=b, .mask=1u};
- return tint_symbol_4;
+ FragIn const tint_symbol_5 = {.a=b, .mask=1u};
+ return tint_symbol_5;
}
fragment tint_symbol_3 tint_symbol(uint mask [[sample_mask]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
- FragIn const tint_symbol_5 = {.a=tint_symbol_1.a, .mask=mask};
- FragIn const inner_result = tint_symbol_inner(tint_symbol_5, tint_symbol_1.b);
+ FragIn const tint_symbol_4 = {.a=tint_symbol_1.a, .mask=mask};
+ FragIn const inner_result = tint_symbol_inner(tint_symbol_4, tint_symbol_1.b);
tint_symbol_3 wrapper_result = {};
wrapper_result.a = inner_result.a;
wrapper_result.mask = inner_result.mask;
diff --git a/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl
index e6e0b7a..aa083e3 100644
--- a/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl
@@ -67,7 +67,7 @@
int g55 = LUTatomicLoad(0u);
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -103,12 +103,12 @@
}
[numthreads(128, 1, 1)]
-void main_count(tint_symbol_1 tint_symbol) {
- main_count_inner(tint_symbol.GlobalInvocationID);
+void main_count(tint_symbol_2 tint_symbol_1) {
+ main_count_inner(tint_symbol_1.GlobalInvocationID);
return;
}
-struct tint_symbol_3 {
+struct tint_symbol_4 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -135,19 +135,19 @@
uint numTriangles = countersatomicLoad((4u * voxelIndex));
int offset = -1;
if ((numTriangles > 0u)) {
- const uint tint_symbol_6 = dbgatomicAdd(0u, numTriangles);
- offset = int(tint_symbol_6);
+ const uint tint_symbol = dbgatomicAdd(0u, numTriangles);
+ offset = int(tint_symbol);
}
LUTatomicStore((4u * voxelIndex), offset);
}
[numthreads(128, 1, 1)]
-void main_create_lut(tint_symbol_3 tint_symbol_2) {
- main_create_lut_inner(tint_symbol_2.GlobalInvocationID);
+void main_create_lut(tint_symbol_4 tint_symbol_3) {
+ main_create_lut_inner(tint_symbol_3.GlobalInvocationID);
return;
}
-struct tint_symbol_5 {
+struct tint_symbol_6 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -177,7 +177,7 @@
}
[numthreads(128, 1, 1)]
-void main_sort_triangles(tint_symbol_5 tint_symbol_4) {
- main_sort_triangles_inner(tint_symbol_4.GlobalInvocationID);
+void main_sort_triangles(tint_symbol_6 tint_symbol_5) {
+ main_sort_triangles_inner(tint_symbol_5.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl
index e6e0b7a..aa083e3 100644
--- a/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl
@@ -67,7 +67,7 @@
int g55 = LUTatomicLoad(0u);
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -103,12 +103,12 @@
}
[numthreads(128, 1, 1)]
-void main_count(tint_symbol_1 tint_symbol) {
- main_count_inner(tint_symbol.GlobalInvocationID);
+void main_count(tint_symbol_2 tint_symbol_1) {
+ main_count_inner(tint_symbol_1.GlobalInvocationID);
return;
}
-struct tint_symbol_3 {
+struct tint_symbol_4 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -135,19 +135,19 @@
uint numTriangles = countersatomicLoad((4u * voxelIndex));
int offset = -1;
if ((numTriangles > 0u)) {
- const uint tint_symbol_6 = dbgatomicAdd(0u, numTriangles);
- offset = int(tint_symbol_6);
+ const uint tint_symbol = dbgatomicAdd(0u, numTriangles);
+ offset = int(tint_symbol);
}
LUTatomicStore((4u * voxelIndex), offset);
}
[numthreads(128, 1, 1)]
-void main_create_lut(tint_symbol_3 tint_symbol_2) {
- main_create_lut_inner(tint_symbol_2.GlobalInvocationID);
+void main_create_lut(tint_symbol_4 tint_symbol_3) {
+ main_create_lut_inner(tint_symbol_3.GlobalInvocationID);
return;
}
-struct tint_symbol_5 {
+struct tint_symbol_6 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -177,7 +177,7 @@
}
[numthreads(128, 1, 1)]
-void main_sort_triangles(tint_symbol_5 tint_symbol_4) {
- main_sort_triangles_inner(tint_symbol_4.GlobalInvocationID);
+void main_sort_triangles(tint_symbol_6 tint_symbol_5) {
+ main_sort_triangles_inner(tint_symbol_5.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl
index fbfa52c..33d4b13 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl
@@ -25,8 +25,7 @@
ok = true;
x_41 = false;
if (true) {
- const int4 tint_symbol_3 = tint_div((0).xxxx, int4(x_27, x_27, x_27, x_27));
- x_40 = all((tint_symbol_3 == (0).xxxx));
+ x_40 = all((tint_div((0).xxxx, int4(x_27, x_27, x_27, x_27)) == (0).xxxx));
x_41 = x_40;
}
ok = x_41;
@@ -152,8 +151,8 @@
sk_Clockwise = sk_Clockwise_param;
vcolor_S0 = vcolor_S0_param;
main_1();
- const main_out tint_symbol_4 = {sk_FragColor};
- return tint_symbol_4;
+ const main_out tint_symbol_3 = {sk_FragColor};
+ return tint_symbol_3;
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
diff --git a/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl
index fbfa52c..33d4b13 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl
@@ -25,8 +25,7 @@
ok = true;
x_41 = false;
if (true) {
- const int4 tint_symbol_3 = tint_div((0).xxxx, int4(x_27, x_27, x_27, x_27));
- x_40 = all((tint_symbol_3 == (0).xxxx));
+ x_40 = all((tint_div((0).xxxx, int4(x_27, x_27, x_27, x_27)) == (0).xxxx));
x_41 = x_40;
}
ok = x_41;
@@ -152,8 +151,8 @@
sk_Clockwise = sk_Clockwise_param;
vcolor_S0 = vcolor_S0_param;
main_1();
- const main_out tint_symbol_4 = {sk_FragColor};
- return tint_symbol_4;
+ const main_out tint_symbol_3 = {sk_FragColor};
+ return tint_symbol_3;
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
diff --git a/test/tint/bug/tint/1520.spvasm.expected.glsl b/test/tint/bug/tint/1520.spvasm.expected.glsl
index 8cd026f..0ae2579 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.glsl
+++ b/test/tint/bug/tint/1520.spvasm.expected.glsl
@@ -44,8 +44,7 @@
ok = true;
x_41 = false;
if (true) {
- ivec4 tint_symbol_1 = tint_div(ivec4(0), ivec4(x_27, x_27, x_27, x_27));
- x_40 = all(equal(tint_symbol_1, ivec4(0)));
+ x_40 = all(equal(tint_div(ivec4(0), ivec4(x_27, x_27, x_27, x_27)), ivec4(0)));
x_41 = x_40;
}
ok = x_41;
@@ -164,8 +163,8 @@
sk_Clockwise = sk_Clockwise_param;
vcolor_S0 = vcolor_S0_param;
main_1();
- main_out tint_symbol_2 = main_out(sk_FragColor);
- return tint_symbol_2;
+ main_out tint_symbol_1 = main_out(sk_FragColor);
+ return tint_symbol_1;
}
void main() {
diff --git a/test/tint/bug/tint/1520.spvasm.expected.msl b/test/tint/bug/tint/1520.spvasm.expected.msl
index 472b6e8..d03b423 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.msl
+++ b/test/tint/bug/tint/1520.spvasm.expected.msl
@@ -39,7 +39,7 @@
return (lhs / select(rhs, int4(1), ((rhs == int4(0)) | ((lhs == int4((-2147483647 - 1))) & (rhs == int4(-1))))));
}
-bool test_int_S1_c0_b(const constant UniformBuffer_tint_packed_vec3* const tint_symbol_6) {
+bool test_int_S1_c0_b(const constant UniformBuffer_tint_packed_vec3* const tint_symbol_5) {
int unknown = 0;
bool ok = false;
int4 val = 0;
@@ -49,14 +49,13 @@
bool x_55 = false;
bool x_65 = false;
bool x_66 = false;
- float const x_26 = (*(tint_symbol_6)).unknownInput_S1_c0;
+ float const x_26 = (*(tint_symbol_5)).unknownInput_S1_c0;
int const x_27 = int(x_26);
unknown = x_27;
ok = true;
x_41 = false;
if (true) {
- int4 const tint_symbol_4 = tint_div(int4(0), int4(x_27, x_27, x_27, x_27));
- x_40 = all((tint_symbol_4 == int4(0)));
+ x_40 = all((tint_div(int4(0), int4(x_27, x_27, x_27, x_27)) == int4(0)));
x_41 = x_40;
}
ok = x_41;
@@ -93,7 +92,7 @@
return x_66;
}
-void main_1(thread float4* const tint_symbol_7, const constant UniformBuffer_tint_packed_vec3* const tint_symbol_8, thread float4* const tint_symbol_9) {
+void main_1(thread float4* const tint_symbol_6, const constant UniformBuffer_tint_packed_vec3* const tint_symbol_7, thread float4* const tint_symbol_8) {
float4 outputColor_S0 = 0.0f;
float4 output_S1 = 0.0f;
float x_8_unknown = 0.0f;
@@ -108,9 +107,9 @@
bool x_111 = false;
bool x_114 = false;
bool x_115 = false;
- float4 const x_72 = *(tint_symbol_7);
+ float4 const x_72 = *(tint_symbol_6);
outputColor_S0 = x_72;
- float const x_77 = (*(tint_symbol_8)).unknownInput_S1_c0;
+ float const x_77 = (*(tint_symbol_7)).unknownInput_S1_c0;
x_8_unknown = x_77;
x_9_ok = true;
x_87 = false;
@@ -151,19 +150,19 @@
x_9_ok = x_111;
x_115 = false;
if (x_111) {
- x_114 = test_int_S1_c0_b(tint_symbol_8);
+ x_114 = test_int_S1_c0_b(tint_symbol_7);
x_115 = x_114;
}
if (x_115) {
- float4 const x_122 = (*(tint_symbol_8)).ucolorGreen_S1_c0;
+ float4 const x_122 = (*(tint_symbol_7)).ucolorGreen_S1_c0;
x_116 = x_122;
} else {
- float4 const x_124 = (*(tint_symbol_8)).ucolorRed_S1_c0;
+ float4 const x_124 = (*(tint_symbol_7)).ucolorRed_S1_c0;
x_116 = x_124;
}
float4 const x_125 = x_116;
output_S1 = x_125;
- *(tint_symbol_9) = x_125;
+ *(tint_symbol_8) = x_125;
return;
}
@@ -179,19 +178,19 @@
float4 sk_FragColor_1 [[color(0)]];
};
-main_out tint_symbol_inner(bool sk_Clockwise_param, float4 vcolor_S0_param, thread float4* const tint_symbol_11, const constant UniformBuffer_tint_packed_vec3* const tint_symbol_12, thread float4* const tint_symbol_13) {
- thread bool tint_symbol_10 = false;
- tint_symbol_10 = sk_Clockwise_param;
- *(tint_symbol_11) = vcolor_S0_param;
- main_1(tint_symbol_11, tint_symbol_12, tint_symbol_13);
- main_out const tint_symbol_5 = {.sk_FragColor_1=*(tint_symbol_13)};
- return tint_symbol_5;
+main_out tint_symbol_inner(bool sk_Clockwise_param, float4 vcolor_S0_param, thread float4* const tint_symbol_10, const constant UniformBuffer_tint_packed_vec3* const tint_symbol_11, thread float4* const tint_symbol_12) {
+ thread bool tint_symbol_9 = false;
+ tint_symbol_9 = sk_Clockwise_param;
+ *(tint_symbol_10) = vcolor_S0_param;
+ main_1(tint_symbol_10, tint_symbol_11, tint_symbol_12);
+ main_out const tint_symbol_4 = {.sk_FragColor_1=*(tint_symbol_12)};
+ return tint_symbol_4;
}
-fragment tint_symbol_3 tint_symbol(const constant UniformBuffer_tint_packed_vec3* tint_symbol_15 [[buffer(0)]], bool sk_Clockwise_param [[front_facing]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
- thread float4 tint_symbol_14 = 0.0f;
- thread float4 tint_symbol_16 = 0.0f;
- main_out const inner_result = tint_symbol_inner(sk_Clockwise_param, tint_symbol_1.vcolor_S0_param, &(tint_symbol_14), tint_symbol_15, &(tint_symbol_16));
+fragment tint_symbol_3 tint_symbol(const constant UniformBuffer_tint_packed_vec3* tint_symbol_14 [[buffer(0)]], bool sk_Clockwise_param [[front_facing]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
+ thread float4 tint_symbol_13 = 0.0f;
+ thread float4 tint_symbol_15 = 0.0f;
+ main_out const inner_result = tint_symbol_inner(sk_Clockwise_param, tint_symbol_1.vcolor_S0_param, &(tint_symbol_13), tint_symbol_14, &(tint_symbol_15));
tint_symbol_3 wrapper_result = {};
wrapper_result.sk_FragColor_1 = inner_result.sk_FragColor_1;
return wrapper_result;
diff --git a/test/tint/bug/tint/1520.spvasm.expected.spvasm b/test/tint/bug/tint/1520.spvasm.expected.spvasm
index 3a07adf..98e5816 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.spvasm
+++ b/test/tint/bug/tint/1520.spvasm.expected.spvasm
@@ -161,11 +161,11 @@
OpSelectionMerge %68 None
OpBranchConditional %true %69 %68
%69 = OpLabel
- %71 = OpCompositeConstruct %v4int %66 %66 %66 %66
- %70 = OpFunctionCall %v4int %tint_div %31 %71
- %73 = OpIEqual %v4bool %70 %31
- %72 = OpAll %bool %73
- OpStore %x_40 %72
+ %72 = OpCompositeConstruct %v4int %66 %66 %66 %66
+ %71 = OpFunctionCall %v4int %tint_div %31 %72
+ %73 = OpIEqual %v4bool %71 %31
+ %70 = OpAll %bool %73
+ OpStore %x_40 %70
%74 = OpLoad %bool %x_40
OpStore %x_41 %74
OpBranch %68
diff --git a/test/tint/bug/tint/1563.wgsl.expected.wgsl b/test/tint/bug/tint/1563.wgsl.expected.wgsl
index cb6ed35..e89aa30 100644
--- a/test/tint/bug/tint/1563.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/1563.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn foo() -> f32 {
let oob = 99;
- let b = vec4<f32>()[min(u32(oob), 3u)];
+ let b = vec4<f32>()[oob];
var v : vec4<f32>;
- v[min(u32(oob), 3u)] = b;
+ v[oob] = b;
return b;
}
diff --git a/test/tint/bug/tint/1725.wgsl.expected.wgsl b/test/tint/bug/tint/1725.wgsl.expected.wgsl
index eefb582..b20dd47 100644
--- a/test/tint/bug/tint/1725.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/1725.wgsl.expected.wgsl
@@ -5,5 +5,5 @@
let tint_symbol_3 = 0;
let tint_symbol_4 = 0;
let tint_symbol_5 = 0;
- let tint_symbol_6 = tint_symbol[min(tint_symbol_2, (arrayLength(&(tint_symbol)) - 1u))];
+ let tint_symbol_6 = tint_symbol[tint_symbol_2];
}
diff --git a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
index 1d22d68..59b8b93 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
@@ -1,4 +1,8 @@
-int2 tint_clamp(int2 e, int2 low, int2 high) {
+int tint_clamp(int e, int low, int high) {
+ return min(max(e, low), high);
+}
+
+int2 tint_clamp_1(int2 e, int2 low, int2 high) {
return min(max(e, low), high);
}
@@ -40,9 +44,27 @@
const int2 coord1 = (coord >> (1u).xx);
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = plane0.Load(int3(coord, 0)).rgb;
+ int3 tint_tmp;
+ int3 tint_tmp_1;
+ plane0.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
+ plane0.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_1.z) - 1u))), tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 tint_tmp_2;
+ plane0.GetDimensions(0, tint_tmp_2.x, tint_tmp_2.y, tint_tmp_2.z);
+ color = plane0.Load(int3(tint_clamp_1(coord, (0).xx, int2((uint2(tint_tmp.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_2.z) - 1u))))).rgb;
} else {
- color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(int3(coord, 0)).r, plane1.Load(int3(coord1, 0)).rg, 1.0f));
+ int3 tint_tmp_3;
+ int3 tint_tmp_4;
+ plane0.GetDimensions(0, tint_tmp_4.x, tint_tmp_4.y, tint_tmp_4.z);
+ plane0.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_4.z) - 1u))), tint_tmp_3.x, tint_tmp_3.y, tint_tmp_3.z);
+ int3 tint_tmp_5;
+ plane0.GetDimensions(0, tint_tmp_5.x, tint_tmp_5.y, tint_tmp_5.z);
+ int3 tint_tmp_6;
+ int3 tint_tmp_7;
+ plane1.GetDimensions(0, tint_tmp_7.x, tint_tmp_7.y, tint_tmp_7.z);
+ plane1.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_7.z) - 1u))), tint_tmp_6.x, tint_tmp_6.y, tint_tmp_6.z);
+ int3 tint_tmp_8;
+ plane1.GetDimensions(0, tint_tmp_8.x, tint_tmp_8.y, tint_tmp_8.z);
+ color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(int3(tint_clamp_1(coord, (0).xx, int2((uint2(tint_tmp_3.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_5.z) - 1u))))).r, plane1.Load(int3(tint_clamp_1(coord1, (0).xx, int2((uint2(tint_tmp_6.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_8.z) - 1u))))).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -68,8 +90,8 @@
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
- const GammaTransferParams tint_symbol_4 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]};
- return tint_symbol_4;
+ const GammaTransferParams tint_symbol = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]};
+ return tint_symbol;
}
float3x3 ext_tex_params_load_6(uint offset) {
@@ -92,27 +114,19 @@
ExternalTextureParams ext_tex_params_load(uint offset) {
const uint scalar_offset_17 = ((offset + 0u)) / 4;
const uint scalar_offset_18 = ((offset + 4u)) / 4;
- const ExternalTextureParams tint_symbol_5 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))};
- return tint_symbol_5;
+ const ExternalTextureParams tint_symbol_1 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))};
+ return tint_symbol_1;
}
[numthreads(1, 1, 1)]
void main() {
- int2 tint_tmp;
- t.GetDimensions(tint_tmp.x, tint_tmp.y);
- const int2 tint_symbol = tint_clamp((10).xx, (0).xx, int2((uint2(tint_tmp) - (1u).xx)));
- float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, ext_tex_params_load(0u));
- int2 tint_tmp_1;
- outImage.GetDimensions(tint_tmp_1.x, tint_tmp_1.y);
- const int2 tint_symbol_1 = tint_clamp((0).xx, (0).xx, int2((uint2(tint_tmp_1) - (1u).xx)));
- outImage[tint_symbol_1] = red;
- int2 tint_tmp_2;
- t.GetDimensions(tint_tmp_2.x, tint_tmp_2.y);
- const int2 tint_symbol_2 = tint_clamp(int2(70, 118), (0).xx, int2((uint2(tint_tmp_2) - (1u).xx)));
- float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, ext_tex_params_load(0u));
- int2 tint_tmp_3;
- outImage.GetDimensions(tint_tmp_3.x, tint_tmp_3.y);
- const int2 tint_symbol_3 = tint_clamp(int2(1, 0), (0).xx, int2((uint2(tint_tmp_3) - (1u).xx)));
- outImage[tint_symbol_3] = green;
+ float4 red = textureLoadExternal(t, ext_tex_plane_1, (10).xx, ext_tex_params_load(0u));
+ int2 tint_tmp_9;
+ outImage.GetDimensions(tint_tmp_9.x, tint_tmp_9.y);
+ outImage[tint_clamp_1((0).xx, (0).xx, int2((uint2(tint_tmp_9) - (1u).xx)))] = red;
+ float4 green = textureLoadExternal(t, ext_tex_plane_1, int2(70, 118), ext_tex_params_load(0u));
+ int2 tint_tmp_10;
+ outImage.GetDimensions(tint_tmp_10.x, tint_tmp_10.y);
+ outImage[tint_clamp_1(int2(1, 0), (0).xx, int2((uint2(tint_tmp_10) - (1u).xx)))] = green;
return;
}
diff --git a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
index 1d22d68..59b8b93 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
@@ -1,4 +1,8 @@
-int2 tint_clamp(int2 e, int2 low, int2 high) {
+int tint_clamp(int e, int low, int high) {
+ return min(max(e, low), high);
+}
+
+int2 tint_clamp_1(int2 e, int2 low, int2 high) {
return min(max(e, low), high);
}
@@ -40,9 +44,27 @@
const int2 coord1 = (coord >> (1u).xx);
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = plane0.Load(int3(coord, 0)).rgb;
+ int3 tint_tmp;
+ int3 tint_tmp_1;
+ plane0.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
+ plane0.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_1.z) - 1u))), tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 tint_tmp_2;
+ plane0.GetDimensions(0, tint_tmp_2.x, tint_tmp_2.y, tint_tmp_2.z);
+ color = plane0.Load(int3(tint_clamp_1(coord, (0).xx, int2((uint2(tint_tmp.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_2.z) - 1u))))).rgb;
} else {
- color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(int3(coord, 0)).r, plane1.Load(int3(coord1, 0)).rg, 1.0f));
+ int3 tint_tmp_3;
+ int3 tint_tmp_4;
+ plane0.GetDimensions(0, tint_tmp_4.x, tint_tmp_4.y, tint_tmp_4.z);
+ plane0.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_4.z) - 1u))), tint_tmp_3.x, tint_tmp_3.y, tint_tmp_3.z);
+ int3 tint_tmp_5;
+ plane0.GetDimensions(0, tint_tmp_5.x, tint_tmp_5.y, tint_tmp_5.z);
+ int3 tint_tmp_6;
+ int3 tint_tmp_7;
+ plane1.GetDimensions(0, tint_tmp_7.x, tint_tmp_7.y, tint_tmp_7.z);
+ plane1.GetDimensions(tint_clamp(0, 0, int((uint(tint_tmp_7.z) - 1u))), tint_tmp_6.x, tint_tmp_6.y, tint_tmp_6.z);
+ int3 tint_tmp_8;
+ plane1.GetDimensions(0, tint_tmp_8.x, tint_tmp_8.y, tint_tmp_8.z);
+ color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(int3(tint_clamp_1(coord, (0).xx, int2((uint2(tint_tmp_3.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_5.z) - 1u))))).r, plane1.Load(int3(tint_clamp_1(coord1, (0).xx, int2((uint2(tint_tmp_6.xy) - (1u).xx))), tint_clamp(0, 0, int((uint(tint_tmp_8.z) - 1u))))).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -68,8 +90,8 @@
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
- const GammaTransferParams tint_symbol_4 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]};
- return tint_symbol_4;
+ const GammaTransferParams tint_symbol = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]};
+ return tint_symbol;
}
float3x3 ext_tex_params_load_6(uint offset) {
@@ -92,27 +114,19 @@
ExternalTextureParams ext_tex_params_load(uint offset) {
const uint scalar_offset_17 = ((offset + 0u)) / 4;
const uint scalar_offset_18 = ((offset + 4u)) / 4;
- const ExternalTextureParams tint_symbol_5 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))};
- return tint_symbol_5;
+ const ExternalTextureParams tint_symbol_1 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))};
+ return tint_symbol_1;
}
[numthreads(1, 1, 1)]
void main() {
- int2 tint_tmp;
- t.GetDimensions(tint_tmp.x, tint_tmp.y);
- const int2 tint_symbol = tint_clamp((10).xx, (0).xx, int2((uint2(tint_tmp) - (1u).xx)));
- float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, ext_tex_params_load(0u));
- int2 tint_tmp_1;
- outImage.GetDimensions(tint_tmp_1.x, tint_tmp_1.y);
- const int2 tint_symbol_1 = tint_clamp((0).xx, (0).xx, int2((uint2(tint_tmp_1) - (1u).xx)));
- outImage[tint_symbol_1] = red;
- int2 tint_tmp_2;
- t.GetDimensions(tint_tmp_2.x, tint_tmp_2.y);
- const int2 tint_symbol_2 = tint_clamp(int2(70, 118), (0).xx, int2((uint2(tint_tmp_2) - (1u).xx)));
- float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, ext_tex_params_load(0u));
- int2 tint_tmp_3;
- outImage.GetDimensions(tint_tmp_3.x, tint_tmp_3.y);
- const int2 tint_symbol_3 = tint_clamp(int2(1, 0), (0).xx, int2((uint2(tint_tmp_3) - (1u).xx)));
- outImage[tint_symbol_3] = green;
+ float4 red = textureLoadExternal(t, ext_tex_plane_1, (10).xx, ext_tex_params_load(0u));
+ int2 tint_tmp_9;
+ outImage.GetDimensions(tint_tmp_9.x, tint_tmp_9.y);
+ outImage[tint_clamp_1((0).xx, (0).xx, int2((uint2(tint_tmp_9) - (1u).xx)))] = red;
+ float4 green = textureLoadExternal(t, ext_tex_plane_1, int2(70, 118), ext_tex_params_load(0u));
+ int2 tint_tmp_10;
+ outImage.GetDimensions(tint_tmp_10.x, tint_tmp_10.y);
+ outImage[tint_clamp_1(int2(1, 0), (0).xx, int2((uint2(tint_tmp_10) - (1u).xx)))] = green;
return;
}
diff --git a/test/tint/bug/tint/1739.wgsl.expected.glsl b/test/tint/bug/tint/1739.wgsl.expected.glsl
index cdc0b3c..3bbb840 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.glsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
#version 310 es
struct GammaTransferParams {
@@ -57,9 +59,9 @@
ivec2 coord1 = (coord >> uvec2(1u));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = texelFetch(plane0_1, coord, 0).rgb;
+ color = texelFetch(plane0_1, clamp(coord, ivec2(0), ivec2((uvec2(uvec2(textureSize(plane0_1, clamp(0, 0, int((uint(uint(textureQueryLevels(plane0_1))) - 1u)))))) - uvec2(1u)))), clamp(0, 0, int((uint(uint(textureQueryLevels(plane0_1))) - 1u)))).rgb;
} else {
- color = (vec4(texelFetch(plane0_1, coord, 0).r, texelFetch(plane1_1, coord1, 0).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (vec4(texelFetch(plane0_1, clamp(coord, ivec2(0), ivec2((uvec2(uvec2(textureSize(plane0_1, clamp(0, 0, int((uint(uint(textureQueryLevels(plane0_1))) - 1u)))))) - uvec2(1u)))), clamp(0, 0, int((uint(uint(textureQueryLevels(plane0_1))) - 1u)))).r, texelFetch(plane1_1, clamp(coord1, ivec2(0), ivec2((uvec2(uvec2(textureSize(plane1_1, clamp(0, 0, int((uint(uint(textureQueryLevels(plane1_1))) - 1u)))))) - uvec2(1u)))), clamp(0, 0, int((uint(uint(textureQueryLevels(plane1_1))) - 1u)))).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -76,9 +78,9 @@
}
void tint_symbol() {
- vec4 red = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(10), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), conv_ExternalTextureParams(ext_tex_params.inner));
+ vec4 red = textureLoadExternal(t_2, ext_tex_plane_1_1, ivec2(10), conv_ExternalTextureParams(ext_tex_params.inner));
imageStore(outImage, clamp(ivec2(0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), red);
- vec4 green = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(70, 118), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), conv_ExternalTextureParams(ext_tex_params.inner));
+ vec4 green = textureLoadExternal(t_2, ext_tex_plane_1_1, ivec2(70, 118), conv_ExternalTextureParams(ext_tex_params.inner));
imageStore(outImage, clamp(ivec2(1, 0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), green);
return;
}
@@ -88,3 +90,10 @@
tint_symbol();
return;
}
+Error parsing GLSL shader:
+ERROR: 0:60: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:60: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/bug/tint/1739.wgsl.expected.msl b/test/tint/bug/tint/1739.wgsl.expected.msl
index cdd5da4..55a4fff 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.msl
+++ b/test/tint/bug/tint/1739.wgsl.expected.msl
@@ -72,7 +72,11 @@
return result;
}
-int2 tint_clamp(int2 e, int2 low, int2 high) {
+int tint_clamp(int e, int low, int high) {
+ return min(max(e, low), high);
+}
+
+int2 tint_clamp_1(int2 e, int2 low, int2 high) {
return min(max(e, low), high);
}
@@ -87,9 +91,9 @@
int2 const coord1 = (coord >> uint2(1u));
float3 color = 0.0f;
if ((params.numPlanes == 1u)) {
- color = plane0.read(uint2(coord), 0).rgb;
+ color = plane0.read(uint2(tint_clamp_1(coord, int2(0), int2((uint2(uint2(plane0.get_width(tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u)))), plane0.get_height(tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u)))))) - uint2(1u))))), tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u)))).rgb;
} else {
- color = (float4(plane0.read(uint2(coord), 0)[0], plane1.read(uint2(coord1), 0).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (float4(plane0.read(uint2(tint_clamp_1(coord, int2(0), int2((uint2(uint2(plane0.get_width(tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u)))), plane0.get_height(tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u)))))) - uint2(1u))))), tint_clamp(0, 0, int((uint(plane0.get_num_mip_levels()) - 1u))))[0], plane1.read(uint2(tint_clamp_1(coord1, int2(0), int2((uint2(uint2(plane1.get_width(tint_clamp(0, 0, int((uint(plane1.get_num_mip_levels()) - 1u)))), plane1.get_height(tint_clamp(0, 0, int((uint(plane1.get_num_mip_levels()) - 1u)))))) - uint2(1u))))), tint_clamp(0, 0, int((uint(plane1.get_num_mip_levels()) - 1u)))).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -99,15 +103,11 @@
return float4(color, 1.0f);
}
-kernel void tint_symbol(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], texture2d<float, access::sample> tint_symbol_6 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_7 [[buffer(0)]], texture2d<float, access::write> tint_symbol_8 [[texture(2)]]) {
- int2 const tint_symbol_1 = tint_clamp(int2(10), int2(0), int2((uint2(uint2(tint_symbol_5.get_width(), tint_symbol_5.get_height())) - uint2(1u))));
- float4 red = textureLoadExternal(tint_symbol_5, tint_symbol_6, tint_symbol_1, tint_unpack_vec3_in_composite_1(*(tint_symbol_7)));
- int2 const tint_symbol_2 = tint_clamp(int2(0), int2(0), int2((uint2(uint2(tint_symbol_8.get_width(), tint_symbol_8.get_height())) - uint2(1u))));
- tint_symbol_8.write(red, uint2(tint_symbol_2));
- int2 const tint_symbol_3 = tint_clamp(int2(70, 118), int2(0), int2((uint2(uint2(tint_symbol_5.get_width(), tint_symbol_5.get_height())) - uint2(1u))));
- float4 green = textureLoadExternal(tint_symbol_5, tint_symbol_6, tint_symbol_3, tint_unpack_vec3_in_composite_1(*(tint_symbol_7)));
- int2 const tint_symbol_4 = tint_clamp(int2(1, 0), int2(0), int2((uint2(uint2(tint_symbol_8.get_width(), tint_symbol_8.get_height())) - uint2(1u))));
- tint_symbol_8.write(green, uint2(tint_symbol_4));
+kernel void tint_symbol(texture2d<float, access::sample> tint_symbol_1 [[texture(0)]], texture2d<float, access::sample> tint_symbol_2 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_3 [[buffer(0)]], texture2d<float, access::write> tint_symbol_4 [[texture(2)]]) {
+ float4 red = textureLoadExternal(tint_symbol_1, tint_symbol_2, int2(10), tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+ tint_symbol_4.write(red, uint2(tint_clamp_1(int2(0), int2(0), int2((uint2(uint2(tint_symbol_4.get_width(), tint_symbol_4.get_height())) - uint2(1u))))));
+ float4 green = textureLoadExternal(tint_symbol_1, tint_symbol_2, int2(70, 118), tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+ tint_symbol_4.write(green, uint2(tint_clamp_1(int2(1, 0), int2(0), int2((uint2(uint2(tint_symbol_4.get_width(), tint_symbol_4.get_height())) - uint2(1u))))));
return;
}
diff --git a/test/tint/bug/tint/1739.wgsl.expected.spvasm b/test/tint/bug/tint/1739.wgsl.expected.spvasm
index 059885c..32f8da9 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1739.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 197
+; Bound: 237
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
- %29 = OpExtInstImport "GLSL.std.450"
+ %28 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
@@ -38,6 +38,10 @@
OpName %e "e"
OpName %low "low"
OpName %high "high"
+ OpName %tint_clamp_1 "tint_clamp_1"
+ OpName %e_0 "e"
+ OpName %low_0 "low"
+ OpName %high_0 "high"
OpName %gammaCorrection "gammaCorrection"
OpName %v "v"
OpName %params "params"
@@ -126,198 +130,233 @@
%_ptr_UniformConstant_19 = OpTypePointer UniformConstant %19
%outImage = OpVariable %_ptr_UniformConstant_19 UniformConstant
%int = OpTypeInt 32 1
+ %20 = OpTypeFunction %int %int %int %int
%v2int = OpTypeVector %int 2
- %20 = OpTypeFunction %v2int %v2int %v2int %v2int
- %31 = OpTypeFunction %v3float %v3float %GammaTransferParams
+ %30 = OpTypeFunction %v2int %v2int %v2int %v2int
+ %39 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
- %50 = OpConstantNull %v3float
+ %58 = OpConstantNull %v3float
%mat3v2float = OpTypeMatrix %v2float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
- %70 = OpTypeFunction %v4float %3 %3 %v2int %ExternalTextureParams
+ %78 = OpTypeFunction %v4float %3 %3 %v2int %ExternalTextureParams
%v2uint = OpTypeVector %uint 2
%uint_1 = OpConstant %uint 1
- %81 = OpConstantComposite %v2uint %uint_1 %uint_1
- %90 = OpConstantNull %int
+ %89 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %99 = OpConstantNull %v2int
+ %104 = OpConstantNull %int
%float_1 = OpConstant %float 1
- %103 = OpConstantNull %uint
- %121 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+ %157 = OpConstantNull %uint
+ %175 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid
- %136 = OpTypeFunction %void
+ %190 = OpTypeFunction %void
%int_10 = OpConstant %int 10
- %142 = OpConstantComposite %v2int %int_10 %int_10
- %143 = OpConstantNull %v2int
- %int_0 = OpConstant %int 0
+ %198 = OpConstantComposite %v2int %int_10 %int_10
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %160 = OpConstantNull %v4float
+ %206 = OpConstantNull %v4float
%int_70 = OpConstant %int 70
%int_118 = OpConstant %int 118
- %173 = OpConstantComposite %v2int %int_70 %int_118
+ %221 = OpConstantComposite %v2int %int_70 %int_118
%int_1 = OpConstant %int 1
- %188 = OpConstantComposite %v2int %int_1 %90
- %tint_clamp = OpFunction %v2int None %20
- %e = OpFunctionParameter %v2int
- %low = OpFunctionParameter %v2int
- %high = OpFunctionParameter %v2int
- %27 = OpLabel
- %30 = OpExtInst %v2int %29 SMax %e %low
- %28 = OpExtInst %v2int %29 SMin %30 %high
- OpReturnValue %28
+ %230 = OpConstantComposite %v2int %int_1 %104
+ %tint_clamp = OpFunction %int None %20
+ %e = OpFunctionParameter %int
+ %low = OpFunctionParameter %int
+ %high = OpFunctionParameter %int
+ %26 = OpLabel
+ %29 = OpExtInst %int %28 SMax %e %low
+ %27 = OpExtInst %int %28 SMin %29 %high
+ OpReturnValue %27
OpFunctionEnd
-%gammaCorrection = OpFunction %v3float None %31
+%tint_clamp_1 = OpFunction %v2int None %30
+ %e_0 = OpFunctionParameter %v2int
+ %low_0 = OpFunctionParameter %v2int
+ %high_0 = OpFunctionParameter %v2int
+ %36 = OpLabel
+ %38 = OpExtInst %v2int %28 SMax %e_0 %low_0
+ %37 = OpExtInst %v2int %28 SMin %38 %high_0
+ OpReturnValue %37
+ OpFunctionEnd
+%gammaCorrection = OpFunction %v3float None %39
%v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams
- %35 = OpLabel
- %48 = OpVariable %_ptr_Function_v3float Function %50
- %60 = OpVariable %_ptr_Function_v3float Function %50
- %66 = OpVariable %_ptr_Function_v3float Function %50
- %36 = OpExtInst %v3float %29 FAbs %v
- %37 = OpCompositeExtract %float %params 4
- %38 = OpCompositeConstruct %v3float %37 %37 %37
- %39 = OpFOrdLessThan %v3bool %36 %38
- %42 = OpExtInst %v3float %29 FSign %v
- %43 = OpCompositeExtract %float %params 3
- %44 = OpExtInst %v3float %29 FAbs %v
- %45 = OpVectorTimesScalar %v3float %44 %43
- %46 = OpCompositeExtract %float %params 6
- %51 = OpCompositeConstruct %v3float %46 %46 %46
- %47 = OpFAdd %v3float %45 %51
- %52 = OpFMul %v3float %42 %47
- %53 = OpExtInst %v3float %29 FSign %v
- %55 = OpCompositeExtract %float %params 1
- %56 = OpExtInst %v3float %29 FAbs %v
- %57 = OpVectorTimesScalar %v3float %56 %55
- %58 = OpCompositeExtract %float %params 2
- %61 = OpCompositeConstruct %v3float %58 %58 %58
- %59 = OpFAdd %v3float %57 %61
- %62 = OpCompositeExtract %float %params 0
- %63 = OpCompositeConstruct %v3float %62 %62 %62
- %54 = OpExtInst %v3float %29 Pow %59 %63
- %64 = OpCompositeExtract %float %params 5
- %67 = OpCompositeConstruct %v3float %64 %64 %64
- %65 = OpFAdd %v3float %54 %67
- %68 = OpFMul %v3float %53 %65
- %69 = OpSelect %v3float %39 %52 %68
- OpReturnValue %69
+ %43 = OpLabel
+ %56 = OpVariable %_ptr_Function_v3float Function %58
+ %68 = OpVariable %_ptr_Function_v3float Function %58
+ %74 = OpVariable %_ptr_Function_v3float Function %58
+ %44 = OpExtInst %v3float %28 FAbs %v
+ %45 = OpCompositeExtract %float %params 4
+ %46 = OpCompositeConstruct %v3float %45 %45 %45
+ %47 = OpFOrdLessThan %v3bool %44 %46
+ %50 = OpExtInst %v3float %28 FSign %v
+ %51 = OpCompositeExtract %float %params 3
+ %52 = OpExtInst %v3float %28 FAbs %v
+ %53 = OpVectorTimesScalar %v3float %52 %51
+ %54 = OpCompositeExtract %float %params 6
+ %59 = OpCompositeConstruct %v3float %54 %54 %54
+ %55 = OpFAdd %v3float %53 %59
+ %60 = OpFMul %v3float %50 %55
+ %61 = OpExtInst %v3float %28 FSign %v
+ %63 = OpCompositeExtract %float %params 1
+ %64 = OpExtInst %v3float %28 FAbs %v
+ %65 = OpVectorTimesScalar %v3float %64 %63
+ %66 = OpCompositeExtract %float %params 2
+ %69 = OpCompositeConstruct %v3float %66 %66 %66
+ %67 = OpFAdd %v3float %65 %69
+ %70 = OpCompositeExtract %float %params 0
+ %71 = OpCompositeConstruct %v3float %70 %70 %70
+ %62 = OpExtInst %v3float %28 Pow %67 %71
+ %72 = OpCompositeExtract %float %params 5
+ %75 = OpCompositeConstruct %v3float %72 %72 %72
+ %73 = OpFAdd %v3float %62 %75
+ %76 = OpFMul %v3float %61 %73
+ %77 = OpSelect %v3float %47 %60 %76
+ OpReturnValue %77
OpFunctionEnd
-%textureLoadExternal = OpFunction %v4float None %70
+%textureLoadExternal = OpFunction %v4float None %78
%plane0 = OpFunctionParameter %3
%plane1 = OpFunctionParameter %3
%coord = OpFunctionParameter %v2int
%params_0 = OpFunctionParameter %ExternalTextureParams
- %78 = OpLabel
- %color = OpVariable %_ptr_Function_v3float Function %50
- %82 = OpShiftRightArithmetic %v2int %coord %81
- %84 = OpCompositeExtract %uint %params_0 0
- %85 = OpIEqual %bool %84 %uint_1
- OpSelectionMerge %86 None
- OpBranchConditional %85 %87 %88
- %87 = OpLabel
- %89 = OpImageFetch %v4float %plane0 %coord Lod %90
- %91 = OpVectorShuffle %v3float %89 %89 0 1 2
- OpStore %color %91
- OpBranch %86
- %88 = OpLabel
- %92 = OpImageFetch %v4float %plane0 %coord Lod %90
- %93 = OpCompositeExtract %float %92 0
- %94 = OpImageFetch %v4float %plane1 %82 Lod %90
- %95 = OpVectorShuffle %v2float %94 %94 0 1
- %96 = OpCompositeExtract %float %95 0
- %97 = OpCompositeExtract %float %95 1
- %99 = OpCompositeConstruct %v4float %93 %96 %97 %float_1
- %100 = OpCompositeExtract %mat3v4float %params_0 2
- %101 = OpVectorTimesMatrix %v3float %99 %100
- OpStore %color %101
- OpBranch %86
%86 = OpLabel
- %102 = OpCompositeExtract %uint %params_0 1
- %104 = OpIEqual %bool %102 %103
- OpSelectionMerge %105 None
- OpBranchConditional %104 %106 %105
- %106 = OpLabel
- %108 = OpLoad %v3float %color
- %109 = OpCompositeExtract %GammaTransferParams %params_0 3
- %107 = OpFunctionCall %v3float %gammaCorrection %108 %109
- OpStore %color %107
- %110 = OpCompositeExtract %mat3v3float %params_0 5
- %111 = OpLoad %v3float %color
- %112 = OpMatrixTimesVector %v3float %110 %111
- OpStore %color %112
- %114 = OpLoad %v3float %color
- %115 = OpCompositeExtract %GammaTransferParams %params_0 4
- %113 = OpFunctionCall %v3float %gammaCorrection %114 %115
- OpStore %color %113
- OpBranch %105
- %105 = OpLabel
- %116 = OpLoad %v3float %color
- %117 = OpCompositeExtract %float %116 0
- %118 = OpCompositeExtract %float %116 1
- %119 = OpCompositeExtract %float %116 2
- %120 = OpCompositeConstruct %v4float %117 %118 %119 %float_1
- OpReturnValue %120
+ %color = OpVariable %_ptr_Function_v3float Function %58
+ %90 = OpShiftRightArithmetic %v2int %coord %89
+ %92 = OpCompositeExtract %uint %params_0 0
+ %93 = OpIEqual %bool %92 %uint_1
+ OpSelectionMerge %94 None
+ OpBranchConditional %93 %95 %96
+ %95 = OpLabel
+ %107 = OpImageQueryLevels %uint %plane0
+ %108 = OpISub %uint %107 %uint_1
+ %105 = OpBitcast %int %108
+ %103 = OpFunctionCall %int %tint_clamp %104 %104 %105
+ %102 = OpImageQuerySizeLod %v2uint %plane0 %103
+ %109 = OpISub %v2uint %102 %89
+ %100 = OpBitcast %v2int %109
+ %98 = OpFunctionCall %v2int %tint_clamp_1 %coord %99 %100
+ %113 = OpImageQueryLevels %uint %plane0
+ %114 = OpISub %uint %113 %uint_1
+ %111 = OpBitcast %int %114
+ %110 = OpFunctionCall %int %tint_clamp %104 %104 %111
+ %97 = OpImageFetch %v4float %plane0 %98 Lod %110
+ %115 = OpVectorShuffle %v3float %97 %97 0 1 2
+ OpStore %color %115
+ OpBranch %94
+ %96 = OpLabel
+ %124 = OpImageQueryLevels %uint %plane0
+ %125 = OpISub %uint %124 %uint_1
+ %122 = OpBitcast %int %125
+ %121 = OpFunctionCall %int %tint_clamp %104 %104 %122
+ %120 = OpImageQuerySizeLod %v2uint %plane0 %121
+ %126 = OpISub %v2uint %120 %89
+ %118 = OpBitcast %v2int %126
+ %117 = OpFunctionCall %v2int %tint_clamp_1 %coord %99 %118
+ %130 = OpImageQueryLevels %uint %plane0
+ %131 = OpISub %uint %130 %uint_1
+ %128 = OpBitcast %int %131
+ %127 = OpFunctionCall %int %tint_clamp %104 %104 %128
+ %116 = OpImageFetch %v4float %plane0 %117 Lod %127
+ %132 = OpCompositeExtract %float %116 0
+ %141 = OpImageQueryLevels %uint %plane1
+ %142 = OpISub %uint %141 %uint_1
+ %139 = OpBitcast %int %142
+ %138 = OpFunctionCall %int %tint_clamp %104 %104 %139
+ %137 = OpImageQuerySizeLod %v2uint %plane1 %138
+ %143 = OpISub %v2uint %137 %89
+ %135 = OpBitcast %v2int %143
+ %134 = OpFunctionCall %v2int %tint_clamp_1 %90 %99 %135
+ %147 = OpImageQueryLevels %uint %plane1
+ %148 = OpISub %uint %147 %uint_1
+ %145 = OpBitcast %int %148
+ %144 = OpFunctionCall %int %tint_clamp %104 %104 %145
+ %133 = OpImageFetch %v4float %plane1 %134 Lod %144
+ %149 = OpVectorShuffle %v2float %133 %133 0 1
+ %150 = OpCompositeExtract %float %149 0
+ %151 = OpCompositeExtract %float %149 1
+ %153 = OpCompositeConstruct %v4float %132 %150 %151 %float_1
+ %154 = OpCompositeExtract %mat3v4float %params_0 2
+ %155 = OpVectorTimesMatrix %v3float %153 %154
+ OpStore %color %155
+ OpBranch %94
+ %94 = OpLabel
+ %156 = OpCompositeExtract %uint %params_0 1
+ %158 = OpIEqual %bool %156 %157
+ OpSelectionMerge %159 None
+ OpBranchConditional %158 %160 %159
+ %160 = OpLabel
+ %162 = OpLoad %v3float %color
+ %163 = OpCompositeExtract %GammaTransferParams %params_0 3
+ %161 = OpFunctionCall %v3float %gammaCorrection %162 %163
+ OpStore %color %161
+ %164 = OpCompositeExtract %mat3v3float %params_0 5
+ %165 = OpLoad %v3float %color
+ %166 = OpMatrixTimesVector %v3float %164 %165
+ OpStore %color %166
+ %168 = OpLoad %v3float %color
+ %169 = OpCompositeExtract %GammaTransferParams %params_0 4
+ %167 = OpFunctionCall %v3float %gammaCorrection %168 %169
+ OpStore %color %167
+ OpBranch %159
+ %159 = OpLabel
+ %170 = OpLoad %v3float %color
+ %171 = OpCompositeExtract %float %170 0
+ %172 = OpCompositeExtract %float %170 1
+ %173 = OpCompositeExtract %float %170 2
+ %174 = OpCompositeConstruct %v4float %171 %172 %173 %float_1
+ OpReturnValue %174
OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %121
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %175
%val = OpFunctionParameter %ExternalTextureParams_std140
- %124 = OpLabel
- %125 = OpCompositeExtract %uint %val 0
- %126 = OpCompositeExtract %uint %val 1
- %127 = OpCompositeExtract %mat3v4float %val 2
- %128 = OpCompositeExtract %GammaTransferParams %val 3
- %129 = OpCompositeExtract %GammaTransferParams %val 4
- %130 = OpCompositeExtract %mat3v3float %val 5
- %131 = OpCompositeExtract %v2float %val 6
- %132 = OpCompositeExtract %v2float %val 7
- %133 = OpCompositeExtract %v2float %val 8
- %134 = OpCompositeConstruct %mat3v2float %131 %132 %133
- %135 = OpCompositeConstruct %ExternalTextureParams %125 %126 %127 %128 %129 %130 %134
- OpReturnValue %135
+ %178 = OpLabel
+ %179 = OpCompositeExtract %uint %val 0
+ %180 = OpCompositeExtract %uint %val 1
+ %181 = OpCompositeExtract %mat3v4float %val 2
+ %182 = OpCompositeExtract %GammaTransferParams %val 3
+ %183 = OpCompositeExtract %GammaTransferParams %val 4
+ %184 = OpCompositeExtract %mat3v3float %val 5
+ %185 = OpCompositeExtract %v2float %val 6
+ %186 = OpCompositeExtract %v2float %val 7
+ %187 = OpCompositeExtract %v2float %val 8
+ %188 = OpCompositeConstruct %mat3v2float %185 %186 %187
+ %189 = OpCompositeConstruct %ExternalTextureParams %179 %180 %181 %182 %183 %184 %188
+ OpReturnValue %189
OpFunctionEnd
- %main = OpFunction %void None %136
- %139 = OpLabel
- %red = OpVariable %_ptr_Function_v4float Function %160
- %green = OpVariable %_ptr_Function_v4float Function %160
- %147 = OpLoad %3 %t
- %146 = OpImageQuerySizeLod %v2uint %147 %int_0
- %149 = OpISub %v2uint %146 %81
- %144 = OpBitcast %v2int %149
- %140 = OpFunctionCall %v2int %tint_clamp %142 %143 %144
- %151 = OpLoad %3 %t
- %152 = OpLoad %3 %ext_tex_plane_1
- %156 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
- %157 = OpLoad %ExternalTextureParams_std140 %156
- %153 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %157
- %150 = OpFunctionCall %v4float %textureLoadExternal %151 %152 %140 %153
- OpStore %red %150
- %165 = OpLoad %19 %outImage
- %164 = OpImageQuerySize %v2uint %165
- %166 = OpISub %v2uint %164 %81
- %162 = OpBitcast %v2int %166
- %161 = OpFunctionCall %v2int %tint_clamp %143 %143 %162
- %168 = OpLoad %19 %outImage
- %169 = OpLoad %v4float %red
- OpImageWrite %168 %161 %169
- %177 = OpLoad %3 %t
- %176 = OpImageQuerySizeLod %v2uint %177 %int_0
- %178 = OpISub %v2uint %176 %81
- %174 = OpBitcast %v2int %178
- %170 = OpFunctionCall %v2int %tint_clamp %173 %143 %174
- %180 = OpLoad %3 %t
- %181 = OpLoad %3 %ext_tex_plane_1
- %183 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
- %184 = OpLoad %ExternalTextureParams_std140 %183
- %182 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %184
- %179 = OpFunctionCall %v4float %textureLoadExternal %180 %181 %170 %182
- OpStore %green %179
- %192 = OpLoad %19 %outImage
- %191 = OpImageQuerySize %v2uint %192
- %193 = OpISub %v2uint %191 %81
- %189 = OpBitcast %v2int %193
- %186 = OpFunctionCall %v2int %tint_clamp %188 %143 %189
- %195 = OpLoad %19 %outImage
- %196 = OpLoad %v4float %green
- OpImageWrite %195 %186 %196
+ %main = OpFunction %void None %190
+ %193 = OpLabel
+ %red = OpVariable %_ptr_Function_v4float Function %206
+ %green = OpVariable %_ptr_Function_v4float Function %206
+ %195 = OpLoad %3 %t
+ %196 = OpLoad %3 %ext_tex_plane_1
+ %202 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+ %203 = OpLoad %ExternalTextureParams_std140 %202
+ %199 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %203
+ %194 = OpFunctionCall %v4float %textureLoadExternal %195 %196 %198 %199
+ OpStore %red %194
+ %208 = OpLoad %19 %outImage
+ %213 = OpLoad %19 %outImage
+ %212 = OpImageQuerySize %v2uint %213
+ %214 = OpISub %v2uint %212 %89
+ %210 = OpBitcast %v2int %214
+ %209 = OpFunctionCall %v2int %tint_clamp_1 %99 %99 %210
+ %215 = OpLoad %v4float %red
+ OpImageWrite %208 %209 %215
+ %217 = OpLoad %3 %t
+ %218 = OpLoad %3 %ext_tex_plane_1
+ %223 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+ %224 = OpLoad %ExternalTextureParams_std140 %223
+ %222 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %224
+ %216 = OpFunctionCall %v4float %textureLoadExternal %217 %218 %221 %222
+ OpStore %green %216
+ %227 = OpLoad %19 %outImage
+ %234 = OpLoad %19 %outImage
+ %233 = OpImageQuerySize %v2uint %234
+ %235 = OpISub %v2uint %233 %89
+ %231 = OpBitcast %v2int %235
+ %228 = OpFunctionCall %v2int %tint_clamp_1 %230 %99 %231
+ %236 = OpLoad %v4float %green
+ OpImageWrite %227 %228 %236
OpReturn
OpFunctionEnd
diff --git a/test/tint/bug/tint/1739.wgsl.expected.wgsl b/test/tint/bug/tint/1739.wgsl.expected.wgsl
index e87373c..403d2d7 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.wgsl
@@ -52,9 +52,9 @@
@compute @workgroup_size(1)
fn main() {
- var red : vec4<f32> = textureLoadExternal(t, ext_tex_plane_1, clamp(vec2<i32>(10, 10), vec2(0), vec2<i32>((vec2<u32>(textureDimensions(t)) - vec2(1)))), ext_tex_params);
- textureStore(outImage, clamp(vec2<i32>(0, 0), vec2(0), vec2<i32>((vec2<u32>(textureDimensions(outImage)) - vec2(1)))), red);
- var green : vec4<f32> = textureLoadExternal(t, ext_tex_plane_1, clamp(vec2<i32>(70, 118), vec2(0), vec2<i32>((vec2<u32>(textureDimensions(t)) - vec2(1)))), ext_tex_params);
- textureStore(outImage, clamp(vec2<i32>(1, 0), vec2(0), vec2<i32>((vec2<u32>(textureDimensions(outImage)) - vec2(1)))), green);
+ var red : vec4<f32> = textureLoadExternal(t, ext_tex_plane_1, vec2<i32>(10, 10), ext_tex_params);
+ textureStore(outImage, vec2<i32>(0, 0), red);
+ var green : vec4<f32> = textureLoadExternal(t, ext_tex_plane_1, vec2<i32>(70, 118), ext_tex_params);
+ textureStore(outImage, vec2<i32>(1, 0), green);
return;
}
diff --git a/test/tint/bug/tint/221.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/221.wgsl.expected.dxc.hlsl
index 4038566..c5a8e9d 100644
--- a/test/tint/bug/tint/221.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/221.wgsl.expected.dxc.hlsl
@@ -12,8 +12,7 @@
break;
}
const uint p_save = i;
- const uint tint_symbol = tint_mod(i, 2u);
- if ((tint_symbol == 0u)) {
+ if ((tint_mod(i, 2u) == 0u)) {
{
b.Store((4u + (4u * p_save)), asuint((b.Load((4u + (4u * p_save))) * 2u)));
i = (i + 1u);
diff --git a/test/tint/bug/tint/221.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/221.wgsl.expected.fxc.hlsl
index 4038566..c5a8e9d 100644
--- a/test/tint/bug/tint/221.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/221.wgsl.expected.fxc.hlsl
@@ -12,8 +12,7 @@
break;
}
const uint p_save = i;
- const uint tint_symbol = tint_mod(i, 2u);
- if ((tint_symbol == 0u)) {
+ if ((tint_mod(i, 2u) == 0u)) {
{
b.Store((4u + (4u * p_save)), asuint((b.Load((4u + (4u * p_save))) * 2u)));
i = (i + 1u);
diff --git a/test/tint/bug/tint/221.wgsl.expected.glsl b/test/tint/bug/tint/221.wgsl.expected.glsl
index 4bcee5e..eebf44d 100644
--- a/test/tint/bug/tint/221.wgsl.expected.glsl
+++ b/test/tint/bug/tint/221.wgsl.expected.glsl
@@ -20,8 +20,7 @@
break;
}
uint p_save = i;
- uint tint_symbol_1 = tint_mod(i, 2u);
- if ((tint_symbol_1 == 0u)) {
+ if ((tint_mod(i, 2u) == 0u)) {
{
b.inner.data[p_save] = (b.inner.data[p_save] * 2u);
i = (i + 1u);
diff --git a/test/tint/bug/tint/221.wgsl.expected.msl b/test/tint/bug/tint/221.wgsl.expected.msl
index 8a82c43..9a2fe97 100644
--- a/test/tint/bug/tint/221.wgsl.expected.msl
+++ b/test/tint/bug/tint/221.wgsl.expected.msl
@@ -23,24 +23,23 @@
return (lhs % select(rhs, 1u, (rhs == 0u)));
}
-kernel void tint_symbol(device Buf* tint_symbol_2 [[buffer(0)]]) {
+kernel void tint_symbol(device Buf* tint_symbol_1 [[buffer(0)]]) {
uint i = 0u;
while (true) {
- if ((i >= (*(tint_symbol_2)).count)) {
+ if ((i >= (*(tint_symbol_1)).count)) {
break;
}
uint const p_save = i;
- uint const tint_symbol_1 = tint_mod(i, 2u);
- if ((tint_symbol_1 == 0u)) {
+ if ((tint_mod(i, 2u) == 0u)) {
{
- (*(tint_symbol_2)).data[p_save] = ((*(tint_symbol_2)).data[p_save] * 2u);
+ (*(tint_symbol_1)).data[p_save] = ((*(tint_symbol_1)).data[p_save] * 2u);
i = (i + 1u);
}
continue;
}
- (*(tint_symbol_2)).data[p_save] = 0u;
+ (*(tint_symbol_1)).data[p_save] = 0u;
{
- (*(tint_symbol_2)).data[p_save] = ((*(tint_symbol_2)).data[p_save] * 2u);
+ (*(tint_symbol_1)).data[p_save] = ((*(tint_symbol_1)).data[p_save] * 2u);
i = (i + 1u);
}
}
diff --git a/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
index 2044cbb..518d19c 100644
--- a/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
@@ -13,7 +13,7 @@
return 1u;
}
-struct tint_symbol_2 {
+struct tint_symbol_3 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -33,8 +33,8 @@
uint4 dstColorBits = uint4(dstColor);
{
for(uint i = 0u; (i < uniforms[0].w); i = (i + 1u)) {
- const uint tint_symbol_3 = ConvertToFp16FloatValue(srcColor[i]);
- set_uint4(srcColorBits, i, tint_symbol_3);
+ const uint tint_symbol_1 = ConvertToFp16FloatValue(srcColor[i]);
+ set_uint4(srcColorBits, i, tint_symbol_1);
bool tint_tmp_1 = success;
if (tint_tmp_1) {
tint_tmp_1 = (srcColorBits[i] == dstColorBits[i]);
@@ -51,7 +51,7 @@
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_2 tint_symbol_1) {
- main_inner(tint_symbol_1.GlobalInvocationID);
+void main(tint_symbol_3 tint_symbol_2) {
+ main_inner(tint_symbol_2.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
index 2044cbb..518d19c 100644
--- a/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
@@ -13,7 +13,7 @@
return 1u;
}
-struct tint_symbol_2 {
+struct tint_symbol_3 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -33,8 +33,8 @@
uint4 dstColorBits = uint4(dstColor);
{
for(uint i = 0u; (i < uniforms[0].w); i = (i + 1u)) {
- const uint tint_symbol_3 = ConvertToFp16FloatValue(srcColor[i]);
- set_uint4(srcColorBits, i, tint_symbol_3);
+ const uint tint_symbol_1 = ConvertToFp16FloatValue(srcColor[i]);
+ set_uint4(srcColorBits, i, tint_symbol_1);
bool tint_tmp_1 = success;
if (tint_tmp_1) {
tint_tmp_1 = (srcColorBits[i] == dstColorBits[i]);
@@ -51,7 +51,7 @@
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_2 tint_symbol_1) {
- main_inner(tint_symbol_1.GlobalInvocationID);
+void main(tint_symbol_3 tint_symbol_2) {
+ main_inner(tint_symbol_2.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
index f95b95c..df80614 100644
--- a/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
@@ -9,7 +9,7 @@
return (abs((value - expect)) < 0.001f);
}
-struct tint_symbol_2 {
+struct tint_symbol_8 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -49,33 +49,33 @@
const float4 srcColor = src.Load(int3(int2(srcTexCoord), 0));
const float4 dstColor = tint_symbol.Load(int3(int2(dstTexCoord), 0));
if ((uniforms[0].y == 2u)) {
- bool tint_symbol_4 = success;
- if (tint_symbol_4) {
- tint_symbol_4 = aboutEqual(dstColor.r, srcColor.r);
+ bool tint_symbol_2 = success;
+ if (tint_symbol_2) {
+ tint_symbol_2 = aboutEqual(dstColor.r, srcColor.r);
}
- bool tint_symbol_3 = tint_symbol_4;
- if (tint_symbol_3) {
- tint_symbol_3 = aboutEqual(dstColor.g, srcColor.g);
+ bool tint_symbol_1 = tint_symbol_2;
+ if (tint_symbol_1) {
+ tint_symbol_1 = aboutEqual(dstColor.g, srcColor.g);
}
- success = tint_symbol_3;
+ success = tint_symbol_1;
} else {
- bool tint_symbol_8 = success;
- if (tint_symbol_8) {
- tint_symbol_8 = aboutEqual(dstColor.r, srcColor.r);
- }
- bool tint_symbol_7 = tint_symbol_8;
- if (tint_symbol_7) {
- tint_symbol_7 = aboutEqual(dstColor.g, srcColor.g);
- }
- bool tint_symbol_6 = tint_symbol_7;
+ bool tint_symbol_6 = success;
if (tint_symbol_6) {
- tint_symbol_6 = aboutEqual(dstColor.b, srcColor.b);
+ tint_symbol_6 = aboutEqual(dstColor.r, srcColor.r);
}
bool tint_symbol_5 = tint_symbol_6;
if (tint_symbol_5) {
- tint_symbol_5 = aboutEqual(dstColor.a, srcColor.a);
+ tint_symbol_5 = aboutEqual(dstColor.g, srcColor.g);
}
- success = tint_symbol_5;
+ bool tint_symbol_4 = tint_symbol_5;
+ if (tint_symbol_4) {
+ tint_symbol_4 = aboutEqual(dstColor.b, srcColor.b);
+ }
+ bool tint_symbol_3 = tint_symbol_4;
+ if (tint_symbol_3) {
+ tint_symbol_3 = aboutEqual(dstColor.a, srcColor.a);
+ }
+ success = tint_symbol_3;
}
}
const uint outputIndex = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
@@ -87,7 +87,7 @@
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_2 tint_symbol_1) {
- main_inner(tint_symbol_1.GlobalInvocationID);
+void main(tint_symbol_8 tint_symbol_7) {
+ main_inner(tint_symbol_7.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
index f95b95c..df80614 100644
--- a/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
@@ -9,7 +9,7 @@
return (abs((value - expect)) < 0.001f);
}
-struct tint_symbol_2 {
+struct tint_symbol_8 {
uint3 GlobalInvocationID : SV_DispatchThreadID;
};
@@ -49,33 +49,33 @@
const float4 srcColor = src.Load(int3(int2(srcTexCoord), 0));
const float4 dstColor = tint_symbol.Load(int3(int2(dstTexCoord), 0));
if ((uniforms[0].y == 2u)) {
- bool tint_symbol_4 = success;
- if (tint_symbol_4) {
- tint_symbol_4 = aboutEqual(dstColor.r, srcColor.r);
+ bool tint_symbol_2 = success;
+ if (tint_symbol_2) {
+ tint_symbol_2 = aboutEqual(dstColor.r, srcColor.r);
}
- bool tint_symbol_3 = tint_symbol_4;
- if (tint_symbol_3) {
- tint_symbol_3 = aboutEqual(dstColor.g, srcColor.g);
+ bool tint_symbol_1 = tint_symbol_2;
+ if (tint_symbol_1) {
+ tint_symbol_1 = aboutEqual(dstColor.g, srcColor.g);
}
- success = tint_symbol_3;
+ success = tint_symbol_1;
} else {
- bool tint_symbol_8 = success;
- if (tint_symbol_8) {
- tint_symbol_8 = aboutEqual(dstColor.r, srcColor.r);
- }
- bool tint_symbol_7 = tint_symbol_8;
- if (tint_symbol_7) {
- tint_symbol_7 = aboutEqual(dstColor.g, srcColor.g);
- }
- bool tint_symbol_6 = tint_symbol_7;
+ bool tint_symbol_6 = success;
if (tint_symbol_6) {
- tint_symbol_6 = aboutEqual(dstColor.b, srcColor.b);
+ tint_symbol_6 = aboutEqual(dstColor.r, srcColor.r);
}
bool tint_symbol_5 = tint_symbol_6;
if (tint_symbol_5) {
- tint_symbol_5 = aboutEqual(dstColor.a, srcColor.a);
+ tint_symbol_5 = aboutEqual(dstColor.g, srcColor.g);
}
- success = tint_symbol_5;
+ bool tint_symbol_4 = tint_symbol_5;
+ if (tint_symbol_4) {
+ tint_symbol_4 = aboutEqual(dstColor.b, srcColor.b);
+ }
+ bool tint_symbol_3 = tint_symbol_4;
+ if (tint_symbol_3) {
+ tint_symbol_3 = aboutEqual(dstColor.a, srcColor.a);
+ }
+ success = tint_symbol_3;
}
}
const uint outputIndex = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
@@ -87,7 +87,7 @@
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_2 tint_symbol_1) {
- main_inner(tint_symbol_1.GlobalInvocationID);
+void main(tint_symbol_8 tint_symbol_7) {
+ main_inner(tint_symbol_7.GlobalInvocationID);
return;
}
diff --git a/test/tint/bug/tint/914.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/914.wgsl.expected.dxc.hlsl
index 6b741d6..f0d36c8 100644
--- a/test/tint/bug/tint/914.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/914.wgsl.expected.dxc.hlsl
@@ -47,7 +47,7 @@
return (lhs / ((rhs == 0u) ? 1u : rhs));
}
-struct tint_symbol_1 {
+struct tint_symbol_3 {
uint3 local_id : SV_GroupThreadID;
uint local_invocation_index : SV_GroupIndex;
uint3 global_id : SV_DispatchThreadID;
@@ -67,8 +67,7 @@
const uint tileCol = (local_id.x * 4u);
const uint globalRow = (global_id.y * 4u);
const uint globalCol = (global_id.x * 4u);
- const uint tint_symbol_2 = tint_div((uniforms[0].y - 1u), 64u);
- const uint numTiles = (tint_symbol_2 + 1u);
+ const uint numTiles = (tint_div((uniforms[0].y - 1u), 64u) + 1u);
float acc[16] = (float[16])0;
float ACached = 0.0f;
float BCached[4] = (float[4])0;
@@ -89,8 +88,8 @@
for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
const uint inputRow = (tileRow + innerRow);
const uint inputCol = (tileColA + innerCol);
- const float tint_symbol_3 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
- mm_Asub[inputRow][inputCol] = tint_symbol_3;
+ const float tint_symbol = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
+ mm_Asub[inputRow][inputCol] = tint_symbol;
}
}
}
@@ -101,8 +100,8 @@
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
const uint inputRow = (tileRowB + innerRow);
const uint inputCol = (tileCol + innerCol);
- const float tint_symbol_4 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
- mm_Bsub[innerCol][inputCol] = tint_symbol_4;
+ const float tint_symbol_1 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
+ mm_Bsub[innerCol][inputCol] = tint_symbol_1;
}
}
}
@@ -144,7 +143,7 @@
}
[numthreads(16, 16, 1)]
-void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.local_id, tint_symbol.global_id, tint_symbol.local_invocation_index);
+void main(tint_symbol_3 tint_symbol_2) {
+ main_inner(tint_symbol_2.local_id, tint_symbol_2.global_id, tint_symbol_2.local_invocation_index);
return;
}
diff --git a/test/tint/bug/tint/914.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/914.wgsl.expected.fxc.hlsl
index 6b741d6..f0d36c8 100644
--- a/test/tint/bug/tint/914.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/914.wgsl.expected.fxc.hlsl
@@ -47,7 +47,7 @@
return (lhs / ((rhs == 0u) ? 1u : rhs));
}
-struct tint_symbol_1 {
+struct tint_symbol_3 {
uint3 local_id : SV_GroupThreadID;
uint local_invocation_index : SV_GroupIndex;
uint3 global_id : SV_DispatchThreadID;
@@ -67,8 +67,7 @@
const uint tileCol = (local_id.x * 4u);
const uint globalRow = (global_id.y * 4u);
const uint globalCol = (global_id.x * 4u);
- const uint tint_symbol_2 = tint_div((uniforms[0].y - 1u), 64u);
- const uint numTiles = (tint_symbol_2 + 1u);
+ const uint numTiles = (tint_div((uniforms[0].y - 1u), 64u) + 1u);
float acc[16] = (float[16])0;
float ACached = 0.0f;
float BCached[4] = (float[4])0;
@@ -89,8 +88,8 @@
for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
const uint inputRow = (tileRow + innerRow);
const uint inputCol = (tileColA + innerCol);
- const float tint_symbol_3 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
- mm_Asub[inputRow][inputCol] = tint_symbol_3;
+ const float tint_symbol = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
+ mm_Asub[inputRow][inputCol] = tint_symbol;
}
}
}
@@ -101,8 +100,8 @@
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
const uint inputRow = (tileRowB + innerRow);
const uint inputCol = (tileCol + innerCol);
- const float tint_symbol_4 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
- mm_Bsub[innerCol][inputCol] = tint_symbol_4;
+ const float tint_symbol_1 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
+ mm_Bsub[innerCol][inputCol] = tint_symbol_1;
}
}
}
@@ -144,7 +143,7 @@
}
[numthreads(16, 16, 1)]
-void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.local_id, tint_symbol.global_id, tint_symbol.local_invocation_index);
+void main(tint_symbol_3 tint_symbol_2) {
+ main_inner(tint_symbol_2.local_id, tint_symbol_2.global_id, tint_symbol_2.local_invocation_index);
return;
}
diff --git a/test/tint/bug/tint/914.wgsl.expected.glsl b/test/tint/bug/tint/914.wgsl.expected.glsl
index fe3d6bc..cf748ec 100644
--- a/test/tint/bug/tint/914.wgsl.expected.glsl
+++ b/test/tint/bug/tint/914.wgsl.expected.glsl
@@ -78,8 +78,7 @@
uint tileCol = (local_id.x * 4u);
uint globalRow = (global_id.y * 4u);
uint globalCol = (global_id.x * 4u);
- uint tint_symbol_1 = tint_div((uniforms.inner.dimInner - 1u), 64u);
- uint numTiles = (tint_symbol_1 + 1u);
+ uint numTiles = (tint_div((uniforms.inner.dimInner - 1u), 64u) + 1u);
float acc[16] = float[16](0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
float ACached = 0.0f;
float BCached[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
@@ -100,8 +99,8 @@
for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
uint inputRow = (tileRow + innerRow);
uint inputCol = (tileColA + innerCol);
- float tint_symbol_2 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
- mm_Asub[inputRow][inputCol] = tint_symbol_2;
+ float tint_symbol_1 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol));
+ mm_Asub[inputRow][inputCol] = tint_symbol_1;
}
}
}
@@ -112,8 +111,8 @@
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint inputRow = (tileRowB + innerRow);
uint inputCol = (tileCol + innerCol);
- float tint_symbol_3 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
- mm_Bsub[innerCol][inputCol] = tint_symbol_3;
+ float tint_symbol_2 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
+ mm_Bsub[innerCol][inputCol] = tint_symbol_2;
}
}
}
diff --git a/test/tint/bug/tint/914.wgsl.expected.msl b/test/tint/bug/tint/914.wgsl.expected.msl
index 5ea78f2..acbc540 100644
--- a/test/tint/bug/tint/914.wgsl.expected.msl
+++ b/test/tint/bug/tint/914.wgsl.expected.msl
@@ -24,26 +24,26 @@
/* 0x0000 */ tint_array<float, 1> numbers;
};
-float mm_readA(uint row, uint col, const constant Uniforms* const tint_symbol_4, const device Matrix* const tint_symbol_5) {
- if (((row < (*(tint_symbol_4)).dimAOuter) && (col < (*(tint_symbol_4)).dimInner))) {
- float const result = (*(tint_symbol_5)).numbers[((row * (*(tint_symbol_4)).dimInner) + col)];
+float mm_readA(uint row, uint col, const constant Uniforms* const tint_symbol_3, const device Matrix* const tint_symbol_4) {
+ if (((row < (*(tint_symbol_3)).dimAOuter) && (col < (*(tint_symbol_3)).dimInner))) {
+ float const result = (*(tint_symbol_4)).numbers[((row * (*(tint_symbol_3)).dimInner) + col)];
return result;
}
return 0.0f;
}
-float mm_readB(uint row, uint col, const constant Uniforms* const tint_symbol_6, const device Matrix* const tint_symbol_7) {
- if (((row < (*(tint_symbol_6)).dimInner) && (col < (*(tint_symbol_6)).dimBOuter))) {
- float const result = (*(tint_symbol_7)).numbers[((row * (*(tint_symbol_6)).dimBOuter) + col)];
+float mm_readB(uint row, uint col, const constant Uniforms* const tint_symbol_5, const device Matrix* const tint_symbol_6) {
+ if (((row < (*(tint_symbol_5)).dimInner) && (col < (*(tint_symbol_5)).dimBOuter))) {
+ float const result = (*(tint_symbol_6)).numbers[((row * (*(tint_symbol_5)).dimBOuter) + col)];
return result;
}
return 0.0f;
}
-void mm_write(uint row, uint col, float value, const constant Uniforms* const tint_symbol_8, device Matrix* const tint_symbol_9) {
- if (((row < (*(tint_symbol_8)).dimAOuter) && (col < (*(tint_symbol_8)).dimBOuter))) {
- uint const index = (col + (row * (*(tint_symbol_8)).dimBOuter));
- (*(tint_symbol_9)).numbers[index] = value;
+void mm_write(uint row, uint col, float value, const constant Uniforms* const tint_symbol_7, device Matrix* const tint_symbol_8) {
+ if (((row < (*(tint_symbol_7)).dimAOuter) && (col < (*(tint_symbol_7)).dimBOuter))) {
+ uint const index = (col + (row * (*(tint_symbol_7)).dimBOuter));
+ (*(tint_symbol_8)).numbers[index] = value;
}
}
@@ -51,20 +51,19 @@
return (lhs / select(rhs, 1u, (rhs == 0u)));
}
-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_10, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_11, const constant Uniforms* const tint_symbol_12, const device Matrix* const tint_symbol_13, const device Matrix* const tint_symbol_14, device Matrix* const tint_symbol_15) {
+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_9, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_10, const constant Uniforms* const tint_symbol_11, const device Matrix* const tint_symbol_12, const device Matrix* const tint_symbol_13, device Matrix* const tint_symbol_14) {
for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 256u)) {
uint const i = (idx / 64u);
uint const i_1 = (idx % 64u);
+ (*(tint_symbol_9))[i][i_1] = 0.0f;
(*(tint_symbol_10))[i][i_1] = 0.0f;
- (*(tint_symbol_11))[i][i_1] = 0.0f;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
uint const tileRow = (local_id[1] * 4u);
uint const tileCol = (local_id[0] * 4u);
uint const globalRow = (global_id[1] * 4u);
uint const globalCol = (global_id[0] * 4u);
- uint const tint_symbol_1 = tint_div(((*(tint_symbol_12)).dimInner - 1u), 64u);
- uint const numTiles = (tint_symbol_1 + 1u);
+ uint const numTiles = (tint_div(((*(tint_symbol_11)).dimInner - 1u), 64u) + 1u);
tint_array<float, 16> acc = {};
float ACached = 0.0f;
tint_array<float, 4> BCached = {};
@@ -80,25 +79,25 @@
for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
uint const inputRow = (tileRow + innerRow);
uint const inputCol = (tileColA + innerCol);
- float const tint_symbol_2 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol), tint_symbol_12, tint_symbol_13);
- (*(tint_symbol_10))[inputRow][inputCol] = tint_symbol_2;
+ float const tint_symbol_1 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol), tint_symbol_11, tint_symbol_12);
+ (*(tint_symbol_9))[inputRow][inputCol] = tint_symbol_1;
}
}
for(uint innerRow = 0u; (innerRow < RowPerThreadB); innerRow = (innerRow + 1u)) {
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint const inputRow = (tileRowB + innerRow);
uint const inputCol = (tileCol + innerCol);
- float const tint_symbol_3 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol), tint_symbol_12, tint_symbol_14);
- (*(tint_symbol_11))[innerCol][inputCol] = tint_symbol_3;
+ float const tint_symbol_2 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol), tint_symbol_11, tint_symbol_13);
+ (*(tint_symbol_10))[innerCol][inputCol] = tint_symbol_2;
}
}
threadgroup_barrier(mem_flags::mem_threadgroup);
for(uint k = 0u; (k < 64u); k = (k + 1u)) {
for(uint inner = 0u; (inner < 4u); inner = (inner + 1u)) {
- BCached[inner] = (*(tint_symbol_11))[k][(tileCol + inner)];
+ BCached[inner] = (*(tint_symbol_10))[k][(tileCol + inner)];
}
for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
- ACached = (*(tint_symbol_10))[(tileRow + innerRow)][k];
+ ACached = (*(tint_symbol_9))[(tileRow + innerRow)][k];
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
uint const index = ((innerRow * 4u) + innerCol);
acc[index] = (acc[index] + (ACached * BCached[innerCol]));
@@ -110,15 +109,15 @@
for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
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_12, tint_symbol_15);
+ mm_write((globalRow + innerRow), (globalCol + innerCol), acc[index], tint_symbol_11, tint_symbol_14);
}
}
}
-kernel void tint_symbol(const constant Uniforms* tint_symbol_18 [[buffer(0)]], const device Matrix* tint_symbol_19 [[buffer(2)]], const device Matrix* tint_symbol_20 [[buffer(3)]], device Matrix* tint_symbol_21 [[buffer(1)]], uint3 local_id [[thread_position_in_threadgroup]], uint3 global_id [[thread_position_in_grid]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+kernel void tint_symbol(const constant Uniforms* tint_symbol_17 [[buffer(0)]], const device Matrix* tint_symbol_18 [[buffer(2)]], const device Matrix* tint_symbol_19 [[buffer(3)]], device Matrix* tint_symbol_20 [[buffer(1)]], uint3 local_id [[thread_position_in_threadgroup]], uint3 global_id [[thread_position_in_grid]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+ threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_15;
threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_16;
- threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_17;
- tint_symbol_inner(local_id, global_id, local_invocation_index, &(tint_symbol_16), &(tint_symbol_17), tint_symbol_18, tint_symbol_19, tint_symbol_20, tint_symbol_21);
+ tint_symbol_inner(local_id, global_id, local_invocation_index, &(tint_symbol_15), &(tint_symbol_16), tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
return;
}
diff --git a/test/tint/bug/tint/980.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/980.wgsl.expected.dxc.hlsl
index 9401dcb..32fbf9d 100644
--- a/test/tint/bug/tint/980.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/980.wgsl.expected.dxc.hlsl
@@ -10,17 +10,17 @@
RWByteAddressBuffer io : register(u0, space0);
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint idx : SV_GroupIndex;
};
void main_inner(uint idx) {
- const float3 tint_symbol_2 = Bad(io.Load(12u), asfloat(io.Load3(0u)));
- io.Store3(0u, asuint(tint_symbol_2));
+ const float3 tint_symbol = Bad(io.Load(12u), asfloat(io.Load3(0u)));
+ io.Store3(0u, asuint(tint_symbol));
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.idx);
+void main(tint_symbol_2 tint_symbol_1) {
+ main_inner(tint_symbol_1.idx);
return;
}
diff --git a/test/tint/bug/tint/980.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/980.wgsl.expected.fxc.hlsl
index 9401dcb..32fbf9d 100644
--- a/test/tint/bug/tint/980.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/980.wgsl.expected.fxc.hlsl
@@ -10,17 +10,17 @@
RWByteAddressBuffer io : register(u0, space0);
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint idx : SV_GroupIndex;
};
void main_inner(uint idx) {
- const float3 tint_symbol_2 = Bad(io.Load(12u), asfloat(io.Load3(0u)));
- io.Store3(0u, asuint(tint_symbol_2));
+ const float3 tint_symbol = Bad(io.Load(12u), asfloat(io.Load3(0u)));
+ io.Store3(0u, asuint(tint_symbol));
}
[numthreads(1, 1, 1)]
-void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.idx);
+void main(tint_symbol_2 tint_symbol_1) {
+ main_inner(tint_symbol_1.idx);
return;
}
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.dxc.hlsl
index 0c3cc70..2704bfd 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.dxc.hlsl
@@ -20,11 +20,8 @@
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
- const uint tint_symbol_2 = tint_div(x_31, 2u);
- const uint tint_symbol_3 = tint_mod(x_33, 2u);
- const uint tint_symbol_4 = tint_mod(x_35, 1u);
uint atomic_result = 0u;
- InterlockedExchange(wg[tint_symbol_2][tint_symbol_3][tint_symbol_4], 0u, atomic_result);
+ InterlockedExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.fxc.hlsl
index 0c3cc70..2704bfd 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.fxc.hlsl
@@ -20,11 +20,8 @@
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
- const uint tint_symbol_2 = tint_div(x_31, 2u);
- const uint tint_symbol_3 = tint_mod(x_33, 2u);
- const uint tint_symbol_4 = tint_mod(x_35, 1u);
uint atomic_result = 0u;
- InterlockedExchange(wg[tint_symbol_2][tint_symbol_3][tint_symbol_4], 0u, atomic_result);
+ InterlockedExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.glsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.glsl
index 800af68..b6f4776 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.glsl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.glsl
@@ -21,10 +21,7 @@
uint x_31 = idx;
uint x_33 = idx;
uint x_35 = idx;
- uint tint_symbol = tint_div(x_31, 2u);
- uint tint_symbol_1 = tint_mod(x_33, 2u);
- uint tint_symbol_2 = tint_mod(x_35, 1u);
- atomicExchange(wg[tint_symbol][tint_symbol_1][tint_symbol_2], 0u);
+ atomicExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u);
{
uint x_42 = idx;
idx = (x_42 + 1u);
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 d17c9b4..e7a3bfe 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.msl
@@ -22,7 +22,7 @@
return (lhs % select(rhs, 1u, (rhs == 0u)));
}
-void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_3) {
+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;
while (true) {
@@ -33,42 +33,39 @@
uint const x_31 = idx;
uint const x_33 = idx;
uint const x_35 = idx;
- uint const tint_symbol = tint_div(x_31, 2u);
- uint const tint_symbol_1 = tint_mod(x_33, 2u);
- uint const tint_symbol_2 = tint_mod(x_35, 1u);
- atomic_store_explicit(&((*(tint_symbol_3))[tint_symbol][tint_symbol_1][tint_symbol_2]), 0u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol))[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)]), 0u, memory_order_relaxed);
{
uint const x_42 = idx;
idx = (x_42 + 1u);
}
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- atomic_store_explicit(&((*(tint_symbol_3))[2][1][0]), 1u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol))[2][1][0]), 1u, memory_order_relaxed);
return;
}
-void compute_main_1(thread uint* const tint_symbol_4, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_5) {
- uint const x_57 = *(tint_symbol_4);
- compute_main_inner(x_57, tint_symbol_5);
+void compute_main_1(thread uint* const tint_symbol_1, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_2) {
+ uint const x_57 = *(tint_symbol_1);
+ compute_main_inner(x_57, tint_symbol_2);
return;
}
-void compute_main_inner_1(uint local_invocation_index_1_param, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_6, thread uint* const tint_symbol_7) {
+void compute_main_inner_1(uint local_invocation_index_1_param, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_3, thread uint* const tint_symbol_4) {
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);
- atomic_store_explicit(&((*(tint_symbol_6))[i][i_1][i_2]), 0u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol_3))[i][i_1][i_2]), 0u, memory_order_relaxed);
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- *(tint_symbol_7) = local_invocation_index_1_param;
- compute_main_1(tint_symbol_7, tint_symbol_6);
+ *(tint_symbol_4) = local_invocation_index_1_param;
+ compute_main_1(tint_symbol_4, tint_symbol_3);
}
kernel void compute_main(uint local_invocation_index_1_param [[thread_index_in_threadgroup]]) {
- threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3> tint_symbol_8;
- thread uint tint_symbol_9 = 0u;
- compute_main_inner_1(local_invocation_index_1_param, &(tint_symbol_8), &(tint_symbol_9));
+ threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3> tint_symbol_5;
+ thread uint tint_symbol_6 = 0u;
+ compute_main_inner_1(local_invocation_index_1_param, &(tint_symbol_5), &(tint_symbol_6));
return;
}
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.spvasm b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.spvasm
index 71bb07e..2ebbb32 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.spvasm
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.spvasm
@@ -96,10 +96,10 @@
%48 = OpLoad %uint %idx
%49 = OpLoad %uint %idx
%50 = OpLoad %uint %idx
- %51 = OpFunctionCall %uint %tint_div %48 %uint_2
- %52 = OpFunctionCall %uint %tint_mod %49 %uint_2
- %53 = OpFunctionCall %uint %tint_mod %50 %uint_1
- %58 = OpAccessChain %_ptr_Workgroup_uint %wg %51 %52 %53
+ %54 = OpFunctionCall %uint %tint_div %48 %uint_2
+ %55 = OpFunctionCall %uint %tint_mod %49 %uint_2
+ %56 = OpFunctionCall %uint %tint_mod %50 %uint_1
+ %58 = OpAccessChain %_ptr_Workgroup_uint %wg %54 %55 %56
OpAtomicStore %58 %uint_2 %uint_0 %6
OpBranch %40
%40 = OpLabel
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.dxc.hlsl
index 0c3cc70..2704bfd 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.dxc.hlsl
@@ -20,11 +20,8 @@
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
- const uint tint_symbol_2 = tint_div(x_31, 2u);
- const uint tint_symbol_3 = tint_mod(x_33, 2u);
- const uint tint_symbol_4 = tint_mod(x_35, 1u);
uint atomic_result = 0u;
- InterlockedExchange(wg[tint_symbol_2][tint_symbol_3][tint_symbol_4], 0u, atomic_result);
+ InterlockedExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.fxc.hlsl
index 0c3cc70..2704bfd 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.fxc.hlsl
@@ -20,11 +20,8 @@
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
- const uint tint_symbol_2 = tint_div(x_31, 2u);
- const uint tint_symbol_3 = tint_mod(x_33, 2u);
- const uint tint_symbol_4 = tint_mod(x_35, 1u);
uint atomic_result = 0u;
- InterlockedExchange(wg[tint_symbol_2][tint_symbol_3][tint_symbol_4], 0u, atomic_result);
+ InterlockedExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.glsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.glsl
index 800af68..b6f4776 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.glsl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.glsl
@@ -21,10 +21,7 @@
uint x_31 = idx;
uint x_33 = idx;
uint x_35 = idx;
- uint tint_symbol = tint_div(x_31, 2u);
- uint tint_symbol_1 = tint_mod(x_33, 2u);
- uint tint_symbol_2 = tint_mod(x_35, 1u);
- atomicExchange(wg[tint_symbol][tint_symbol_1][tint_symbol_2], 0u);
+ atomicExchange(wg[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)], 0u);
{
uint x_42 = idx;
idx = (x_42 + 1u);
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
index d17c9b4..e7a3bfe 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.msl
@@ -22,7 +22,7 @@
return (lhs % select(rhs, 1u, (rhs == 0u)));
}
-void compute_main_inner(uint local_invocation_index_2, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_3) {
+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;
while (true) {
@@ -33,42 +33,39 @@
uint const x_31 = idx;
uint const x_33 = idx;
uint const x_35 = idx;
- uint const tint_symbol = tint_div(x_31, 2u);
- uint const tint_symbol_1 = tint_mod(x_33, 2u);
- uint const tint_symbol_2 = tint_mod(x_35, 1u);
- atomic_store_explicit(&((*(tint_symbol_3))[tint_symbol][tint_symbol_1][tint_symbol_2]), 0u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol))[tint_div(x_31, 2u)][tint_mod(x_33, 2u)][tint_mod(x_35, 1u)]), 0u, memory_order_relaxed);
{
uint const x_42 = idx;
idx = (x_42 + 1u);
}
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- atomic_store_explicit(&((*(tint_symbol_3))[2][1][0]), 1u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol))[2][1][0]), 1u, memory_order_relaxed);
return;
}
-void compute_main_1(thread uint* const tint_symbol_4, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_5) {
- uint const x_57 = *(tint_symbol_4);
- compute_main_inner(x_57, tint_symbol_5);
+void compute_main_1(thread uint* const tint_symbol_1, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_2) {
+ uint const x_57 = *(tint_symbol_1);
+ compute_main_inner(x_57, tint_symbol_2);
return;
}
-void compute_main_inner_1(uint local_invocation_index_1_param, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_6, thread uint* const tint_symbol_7) {
+void compute_main_inner_1(uint local_invocation_index_1_param, threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3>* const tint_symbol_3, thread uint* const tint_symbol_4) {
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);
- atomic_store_explicit(&((*(tint_symbol_6))[i][i_1][i_2]), 0u, memory_order_relaxed);
+ atomic_store_explicit(&((*(tint_symbol_3))[i][i_1][i_2]), 0u, memory_order_relaxed);
}
threadgroup_barrier(mem_flags::mem_threadgroup);
- *(tint_symbol_7) = local_invocation_index_1_param;
- compute_main_1(tint_symbol_7, tint_symbol_6);
+ *(tint_symbol_4) = local_invocation_index_1_param;
+ compute_main_1(tint_symbol_4, tint_symbol_3);
}
kernel void compute_main(uint local_invocation_index_1_param [[thread_index_in_threadgroup]]) {
- threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3> tint_symbol_8;
- thread uint tint_symbol_9 = 0u;
- compute_main_inner_1(local_invocation_index_1_param, &(tint_symbol_8), &(tint_symbol_9));
+ threadgroup tint_array<tint_array<tint_array<atomic_uint, 1>, 2>, 3> tint_symbol_5;
+ thread uint tint_symbol_6 = 0u;
+ compute_main_inner_1(local_invocation_index_1_param, &(tint_symbol_5), &(tint_symbol_6));
return;
}
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.spvasm b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.spvasm
index 71bb07e..2ebbb32 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.spvasm
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.spvasm
@@ -96,10 +96,10 @@
%48 = OpLoad %uint %idx
%49 = OpLoad %uint %idx
%50 = OpLoad %uint %idx
- %51 = OpFunctionCall %uint %tint_div %48 %uint_2
- %52 = OpFunctionCall %uint %tint_mod %49 %uint_2
- %53 = OpFunctionCall %uint %tint_mod %50 %uint_1
- %58 = OpAccessChain %_ptr_Workgroup_uint %wg %51 %52 %53
+ %54 = OpFunctionCall %uint %tint_div %48 %uint_2
+ %55 = OpFunctionCall %uint %tint_mod %49 %uint_2
+ %56 = OpFunctionCall %uint %tint_mod %50 %uint_1
+ %58 = OpAccessChain %_ptr_Workgroup_uint %wg %54 %55 %56
OpAtomicStore %58 %uint_2 %uint_0 %6
OpBranch %40
%40 = OpLabel
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
index fe0811a..228a3a7 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
@@ -16,8 +16,8 @@
int atomic_compare_value = 1;
InterlockedCompareExchange(arg_0, atomic_compare_value, 1, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resulti32 tint_symbol_2 = atomic_result;
- const int old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resulti32 tint_symbol = atomic_result;
+ const int old_value_1 = tint_symbol.old_value;
const int x_18 = old_value_1;
const x__atomic_compare_exchange_resulti32 tint_symbol_3 = {x_18, (x_18 == 1)};
res = tint_symbol_3;
@@ -38,7 +38,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -53,7 +53,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
index fe0811a..228a3a7 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
@@ -16,8 +16,8 @@
int atomic_compare_value = 1;
InterlockedCompareExchange(arg_0, atomic_compare_value, 1, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resulti32 tint_symbol_2 = atomic_result;
- const int old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resulti32 tint_symbol = atomic_result;
+ const int old_value_1 = tint_symbol.old_value;
const int x_18 = old_value_1;
const x__atomic_compare_exchange_resulti32 tint_symbol_3 = {x_18, (x_18 == 1)};
res = tint_symbol_3;
@@ -38,7 +38,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -53,7 +53,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
index 89f85cc..3ba0e3f 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
@@ -16,8 +16,8 @@
uint atomic_compare_value = 1u;
InterlockedCompareExchange(arg_0, atomic_compare_value, 1u, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resultu32 tint_symbol_2 = atomic_result;
- const uint old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resultu32 tint_symbol = atomic_result;
+ const uint old_value_1 = tint_symbol.old_value;
const uint x_17 = old_value_1;
const x__atomic_compare_exchange_resultu32 tint_symbol_3 = {x_17, (x_17 == 1u)};
res = tint_symbol_3;
@@ -38,7 +38,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -53,7 +53,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
index 89f85cc..3ba0e3f 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
@@ -16,8 +16,8 @@
uint atomic_compare_value = 1u;
InterlockedCompareExchange(arg_0, atomic_compare_value, 1u, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resultu32 tint_symbol_2 = atomic_result;
- const uint old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resultu32 tint_symbol = atomic_result;
+ const uint old_value_1 = tint_symbol.old_value;
const uint x_17 = old_value_1;
const x__atomic_compare_exchange_resultu32 tint_symbol_3 = {x_17, (x_17 == 1u)};
res = tint_symbol_3;
@@ -38,7 +38,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -53,7 +53,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
index f969d03..0f21d8d 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.dxc.hlsl
@@ -22,8 +22,8 @@
int atomic_compare_value = x_23;
InterlockedCompareExchange(arg_0, atomic_compare_value, x_22, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resulti32 tint_symbol_2 = atomic_result;
- const int old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resulti32 tint_symbol = atomic_result;
+ const int old_value_1 = tint_symbol.old_value;
const int x_24 = old_value_1;
const x__atomic_compare_exchange_resulti32 tint_symbol_3 = {x_24, (x_24 == x_22)};
res = tint_symbol_3;
@@ -44,7 +44,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -59,7 +59,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
index f969d03..0f21d8d 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.fxc.hlsl
@@ -22,8 +22,8 @@
int atomic_compare_value = x_23;
InterlockedCompareExchange(arg_0, atomic_compare_value, x_22, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resulti32 tint_symbol_2 = atomic_result;
- const int old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resulti32 tint_symbol = atomic_result;
+ const int old_value_1 = tint_symbol.old_value;
const int x_24 = old_value_1;
const x__atomic_compare_exchange_resulti32 tint_symbol_3 = {x_24, (x_24 == x_22)};
res = tint_symbol_3;
@@ -44,7 +44,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -59,7 +59,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
index 99e867f..46c7526 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.dxc.hlsl
@@ -22,8 +22,8 @@
uint atomic_compare_value = x_22;
InterlockedCompareExchange(arg_0, atomic_compare_value, x_21, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resultu32 tint_symbol_2 = atomic_result;
- const uint old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resultu32 tint_symbol = atomic_result;
+ const uint old_value_1 = tint_symbol.old_value;
const uint x_23 = old_value_1;
const x__atomic_compare_exchange_resultu32 tint_symbol_3 = {x_23, (x_23 == x_21)};
res = tint_symbol_3;
@@ -44,7 +44,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -59,7 +59,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
index 99e867f..46c7526 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.fxc.hlsl
@@ -22,8 +22,8 @@
uint atomic_compare_value = x_22;
InterlockedCompareExchange(arg_0, atomic_compare_value, x_21, atomic_result.old_value);
atomic_result.exchanged = atomic_result.old_value == atomic_compare_value;
- const atomic_compare_exchange_resultu32 tint_symbol_2 = atomic_result;
- const uint old_value_1 = tint_symbol_2.old_value;
+ const atomic_compare_exchange_resultu32 tint_symbol = atomic_result;
+ const uint old_value_1 = tint_symbol.old_value;
const uint x_23 = old_value_1;
const x__atomic_compare_exchange_resultu32 tint_symbol_3 = {x_23, (x_23 == x_21)};
res = tint_symbol_3;
@@ -44,7 +44,7 @@
return;
}
-struct tint_symbol_1 {
+struct tint_symbol_2 {
uint local_invocation_index_1_param : SV_GroupIndex;
};
@@ -59,7 +59,7 @@
}
[numthreads(1, 1, 1)]
-void compute_main(tint_symbol_1 tint_symbol) {
- compute_main_inner_1(tint_symbol.local_invocation_index_1_param);
+void compute_main(tint_symbol_2 tint_symbol_1) {
+ compute_main_inner_1(tint_symbol_1.local_invocation_index_1_param);
return;
}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
index f358a09..8747181 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -72,16 +80,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -89,6 +103,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -124,16 +140,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -141,6 +163,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
index a5f0e0a..598afb2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -63,7 +71,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
@@ -100,16 +108,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -117,6 +131,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -149,7 +165,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
@@ -180,16 +196,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -197,6 +219,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -229,7 +253,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
index a2b7930..5629e71 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -63,7 +71,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
@@ -100,16 +108,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -117,6 +131,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -149,7 +165,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
@@ -180,16 +196,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -197,6 +219,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -229,7 +253,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index b12b3d8..4ff46db 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -72,7 +80,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
@@ -109,16 +117,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -126,6 +140,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -167,7 +183,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
@@ -198,16 +214,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -215,6 +237,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -256,7 +280,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
index 26bb61f..9324574 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared uint arg_0;
-
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
GroupMemoryBarrierWithGroupSync();
- const uint result = arg_0;
+ const uint result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared uint arg_0;
+
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
index 26bb61f..9324574 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared uint arg_0;
-
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
GroupMemoryBarrierWithGroupSync();
- const uint result = arg_0;
+ const uint result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared uint arg_0;
+
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
index 5b51b2d..061ebab 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared uint arg_0;
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
barrier();
- uint result = arg_0;
+ uint result = p;
barrier();
return result;
}
+shared uint arg_0;
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
index fe6d27e..0bd3512 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float arg_0;
-
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
GroupMemoryBarrierWithGroupSync();
- const float result = arg_0;
+ const float result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float arg_0;
+
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
index fe6d27e..0bd3512 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float arg_0;
-
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
GroupMemoryBarrierWithGroupSync();
- const float result = arg_0;
+ const float result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float arg_0;
+
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
index bfdeb87..dcde824 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared float arg_0;
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
barrier();
- float result = arg_0;
+ float result = p;
barrier();
return result;
}
+shared float arg_0;
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
index 87cf14c..5bce24b 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared int arg_0;
-
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = arg_0;
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int arg_0;
+
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
index 87cf14c..5bce24b 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared int arg_0;
-
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = arg_0;
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int arg_0;
+
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
index 31ae3f9..10874b5 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared int arg_0;
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
barrier();
- int result = arg_0;
+ int result = p;
barrier();
return result;
}
+shared int arg_0;
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
index d34a7c4..96fb735 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float16_t arg_0;
-
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
GroupMemoryBarrierWithGroupSync();
- const float16_t result = arg_0;
+ const float16_t result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float16_t arg_0;
+
void workgroupUniformLoad_e07d08() {
- float16_t res = tint_workgroupUniformLoad_arg_0();
+ float16_t res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
index 0b882bd..33a9a40 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
@@ -1,16 +1,16 @@
#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
-shared float16_t arg_0;
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
barrier();
- float16_t result = arg_0;
+ float16_t result = p;
barrier();
return result;
}
+shared float16_t arg_0;
void workgroupUniformLoad_e07d08() {
- float16_t res = tint_workgroupUniformLoad_arg_0();
+ float16_t res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
index f358a09..8747181 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -72,16 +80,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -89,6 +103,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -124,16 +140,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -141,6 +163,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
index 2cc4ccf..d38b454 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -63,7 +71,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
@@ -101,16 +109,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -118,6 +132,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -150,7 +166,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
@@ -182,16 +198,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -199,6 +221,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -231,7 +255,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_1bfdfb() {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
index a24d4fe..fd0f0b4 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -63,7 +71,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
@@ -101,16 +109,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -118,6 +132,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -150,7 +166,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
@@ -182,16 +198,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -199,6 +221,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -231,7 +255,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureLoad_8acf41() {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index 9824423..764d338 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -72,7 +80,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
@@ -110,16 +118,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -127,6 +141,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -168,7 +184,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
@@ -200,16 +216,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -217,6 +239,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
@@ -258,7 +282,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void textureSampleBaseClampToEdge_7c04e6() {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
index 26bb61f..9324574 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared uint arg_0;
-
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
GroupMemoryBarrierWithGroupSync();
- const uint result = arg_0;
+ const uint result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared uint arg_0;
+
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
index 26bb61f..9324574 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared uint arg_0;
-
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
GroupMemoryBarrierWithGroupSync();
- const uint result = arg_0;
+ const uint result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared uint arg_0;
+
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
index 5b51b2d..061ebab 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared uint arg_0;
-uint tint_workgroupUniformLoad_arg_0() {
+uint tint_workgroupUniformLoad(inout uint p) {
barrier();
- uint result = arg_0;
+ uint result = p;
barrier();
return result;
}
+shared uint arg_0;
void workgroupUniformLoad_37307c() {
- uint res = tint_workgroupUniformLoad_arg_0();
+ uint res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
index fe6d27e..0bd3512 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float arg_0;
-
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
GroupMemoryBarrierWithGroupSync();
- const float result = arg_0;
+ const float result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float arg_0;
+
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
index fe6d27e..0bd3512 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float arg_0;
-
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
GroupMemoryBarrierWithGroupSync();
- const float result = arg_0;
+ const float result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float arg_0;
+
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
index bfdeb87..dcde824 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared float arg_0;
-float tint_workgroupUniformLoad_arg_0() {
+float tint_workgroupUniformLoad(inout float p) {
barrier();
- float result = arg_0;
+ float result = p;
barrier();
return result;
}
+shared float arg_0;
void workgroupUniformLoad_7a857c() {
- float res = tint_workgroupUniformLoad_arg_0();
+ float res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
index 87cf14c..5bce24b 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared int arg_0;
-
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = arg_0;
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int arg_0;
+
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
index 87cf14c..5bce24b 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
@@ -1,14 +1,14 @@
-groupshared int arg_0;
-
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = arg_0;
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int arg_0;
+
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
index 31ae3f9..10874b5 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
@@ -1,15 +1,15 @@
#version 310 es
-shared int arg_0;
-int tint_workgroupUniformLoad_arg_0() {
+int tint_workgroupUniformLoad(inout int p) {
barrier();
- int result = arg_0;
+ int result = p;
barrier();
return result;
}
+shared int arg_0;
void workgroupUniformLoad_9d33de() {
- int res = tint_workgroupUniformLoad_arg_0();
+ int res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
index d34a7c4..96fb735 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
@@ -1,14 +1,14 @@
-groupshared float16_t arg_0;
-
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
GroupMemoryBarrierWithGroupSync();
- const float16_t result = arg_0;
+ const float16_t result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float16_t arg_0;
+
void workgroupUniformLoad_e07d08() {
- float16_t res = tint_workgroupUniformLoad_arg_0();
+ float16_t res = tint_workgroupUniformLoad(arg_0);
}
struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
index 0b882bd..33a9a40 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
@@ -1,16 +1,16 @@
#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
-shared float16_t arg_0;
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
barrier();
- float16_t result = arg_0;
+ float16_t result = p;
barrier();
return result;
}
+shared float16_t arg_0;
void workgroupUniformLoad_e07d08() {
- float16_t res = tint_workgroupUniformLoad_arg_0();
+ float16_t res = tint_workgroupUniformLoad(arg_0);
}
void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
index 6cbc9c0..02da464 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
@@ -14,16 +14,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -31,6 +37,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -67,7 +75,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void doTextureLoad() {
@@ -104,16 +112,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -121,6 +135,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -157,7 +173,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void doTextureLoad() {
@@ -188,16 +204,22 @@
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
mat3x2 coordTransformationMatrix;
+ uint pad_2;
+ uint pad_3;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
+ uint pad;
+ uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
@@ -205,6 +227,8 @@
vec2 coordTransformationMatrix_0;
vec2 coordTransformationMatrix_1;
vec2 coordTransformationMatrix_2;
+ uint pad_2;
+ uint pad_3;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
@@ -241,7 +265,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2));
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
}
void doTextureLoad() {
diff --git a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.dxc.hlsl
index a9b6ea5..d8a47b9 100644
--- a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.dxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[4];
-
-typedef int tint_workgroupUniformLoad_v_ret[4];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[4];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[4]) {
GroupMemoryBarrierWithGroupSync();
- const int result[4] = v;
+ const int result[4] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[4];
+
typedef int foo_ret[4];
foo_ret foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.fxc.hlsl
index a9b6ea5..d8a47b9 100644
--- a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.fxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[4];
-
-typedef int tint_workgroupUniformLoad_v_ret[4];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[4];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[4]) {
GroupMemoryBarrierWithGroupSync();
- const int result[4] = v;
+ const int result[4] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[4];
+
typedef int foo_ret[4];
foo_ret foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.glsl
index cda9b79..661c13b 100644
--- a/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/array.wgsl.expected.glsl
@@ -4,15 +4,15 @@
void unused_entry_point() {
return;
}
-shared int v[4];
-int[4] tint_workgroupUniformLoad_v() {
+int[4] tint_workgroupUniformLoad(inout int p[4]) {
barrier();
- int result[4] = v;
+ int result[4] = p;
barrier();
return result;
}
+shared int v[4];
int[4] foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.dxc.hlsl
index a42cbe5..1958f4a 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.dxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[128];
-
-typedef int tint_workgroupUniformLoad_v_ret[128];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[128];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[128]) {
GroupMemoryBarrierWithGroupSync();
- const int result[128] = v;
+ const int result[128] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[128];
+
int foo() {
- const int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ const int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.fxc.hlsl
index a42cbe5..1958f4a 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.fxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[128];
-
-typedef int tint_workgroupUniformLoad_v_ret[128];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[128];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[128]) {
GroupMemoryBarrierWithGroupSync();
- const int result[128] = v;
+ const int result[128] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[128];
+
int foo() {
- const int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ const int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.glsl
index 6e551e8..fa13387 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count.wgsl.expected.glsl
@@ -4,16 +4,16 @@
void unused_entry_point() {
return;
}
-shared int v[128];
-int[128] tint_workgroupUniformLoad_v() {
+int[128] tint_workgroupUniformLoad(inout int p[128]) {
barrier();
- int result[128] = v;
+ int result[128] = p;
barrier();
return result;
}
+shared int v[128];
int foo() {
- int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.dxc.hlsl
index a42cbe5..1958f4a 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.dxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[128];
-
-typedef int tint_workgroupUniformLoad_v_ret[128];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[128];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[128]) {
GroupMemoryBarrierWithGroupSync();
- const int result[128] = v;
+ const int result[128] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[128];
+
int foo() {
- const int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ const int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.fxc.hlsl
index a42cbe5..1958f4a 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.fxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared int v[128];
-
-typedef int tint_workgroupUniformLoad_v_ret[128];
-tint_workgroupUniformLoad_v_ret tint_workgroupUniformLoad_v() {
+typedef int tint_workgroupUniformLoad_ret[128];
+tint_workgroupUniformLoad_ret tint_workgroupUniformLoad(inout int p[128]) {
GroupMemoryBarrierWithGroupSync();
- const int result[128] = v;
+ const int result[128] = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[128];
+
int foo() {
- const int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ const int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.glsl
index 6e551e8..fa13387 100644
--- a/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/array_overridable_count_aliased.wgsl.expected.glsl
@@ -4,16 +4,16 @@
void unused_entry_point() {
return;
}
-shared int v[128];
-int[128] tint_workgroupUniformLoad_v() {
+int[128] tint_workgroupUniformLoad(inout int p[128]) {
barrier();
- int result[128] = v;
+ int result[128] = p;
barrier();
return result;
}
+shared int v[128];
int foo() {
- int tint_symbol[128] = tint_workgroupUniformLoad_v();
+ int tint_symbol[128] = tint_workgroupUniformLoad(v);
return tint_symbol[0];
}
diff --git a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.dxc.hlsl
index afb3e79..28f1e19 100644
--- a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.dxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared bool v;
-
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
GroupMemoryBarrierWithGroupSync();
- const bool result = v;
+ const bool result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared bool v;
+
bool foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.fxc.hlsl
index afb3e79..28f1e19 100644
--- a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.fxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared bool v;
-
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
GroupMemoryBarrierWithGroupSync();
- const bool result = v;
+ const bool result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared bool v;
+
bool foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.glsl
index 4962454..9793dba 100644
--- a/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/bool.wgsl.expected.glsl
@@ -4,15 +4,15 @@
void unused_entry_point() {
return;
}
-shared bool v;
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
barrier();
- bool result = v;
+ bool result = p;
barrier();
return result;
}
+shared bool v;
bool foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.dxc.hlsl
index ec23355..98df2c2 100644
--- a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.dxc.hlsl
@@ -3,30 +3,22 @@
return;
}
+int tint_workgroupUniformLoad(inout int p) {
+ GroupMemoryBarrierWithGroupSync();
+ const int result = p;
+ GroupMemoryBarrierWithGroupSync();
+ return result;
+}
+
groupshared int a;
-
-int tint_workgroupUniformLoad_a() {
- GroupMemoryBarrierWithGroupSync();
- const int result = a;
- GroupMemoryBarrierWithGroupSync();
- return result;
-}
-
groupshared int b;
-int tint_workgroupUniformLoad_b() {
- GroupMemoryBarrierWithGroupSync();
- const int result = b;
- GroupMemoryBarrierWithGroupSync();
- return result;
-}
-
void foo() {
{
int i = 0;
while (true) {
const int tint_symbol = i;
- const int tint_symbol_1 = tint_workgroupUniformLoad_a();
+ const int tint_symbol_1 = tint_workgroupUniformLoad(a);
if (!((tint_symbol < tint_symbol_1))) {
break;
}
@@ -34,7 +26,7 @@
}
{
const int tint_symbol_2 = i;
- const int tint_symbol_3 = tint_workgroupUniformLoad_b();
+ const int tint_symbol_3 = tint_workgroupUniformLoad(b);
i = (tint_symbol_2 + tint_symbol_3);
}
}
diff --git a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.fxc.hlsl
index ec23355..98df2c2 100644
--- a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.fxc.hlsl
@@ -3,30 +3,22 @@
return;
}
+int tint_workgroupUniformLoad(inout int p) {
+ GroupMemoryBarrierWithGroupSync();
+ const int result = p;
+ GroupMemoryBarrierWithGroupSync();
+ return result;
+}
+
groupshared int a;
-
-int tint_workgroupUniformLoad_a() {
- GroupMemoryBarrierWithGroupSync();
- const int result = a;
- GroupMemoryBarrierWithGroupSync();
- return result;
-}
-
groupshared int b;
-int tint_workgroupUniformLoad_b() {
- GroupMemoryBarrierWithGroupSync();
- const int result = b;
- GroupMemoryBarrierWithGroupSync();
- return result;
-}
-
void foo() {
{
int i = 0;
while (true) {
const int tint_symbol = i;
- const int tint_symbol_1 = tint_workgroupUniformLoad_a();
+ const int tint_symbol_1 = tint_workgroupUniformLoad(a);
if (!((tint_symbol < tint_symbol_1))) {
break;
}
@@ -34,7 +26,7 @@
}
{
const int tint_symbol_2 = i;
- const int tint_symbol_3 = tint_workgroupUniformLoad_b();
+ const int tint_symbol_3 = tint_workgroupUniformLoad(b);
i = (tint_symbol_2 + tint_symbol_3);
}
}
diff --git a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.glsl
index 09c4abe..97926d0 100644
--- a/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/for_loop.wgsl.expected.glsl
@@ -4,28 +4,21 @@
void unused_entry_point() {
return;
}
+int tint_workgroupUniformLoad(inout int p) {
+ barrier();
+ int result = p;
+ barrier();
+ return result;
+}
+
shared int a;
-int tint_workgroupUniformLoad_a() {
- barrier();
- int result = a;
- barrier();
- return result;
-}
-
shared int b;
-int tint_workgroupUniformLoad_b() {
- barrier();
- int result = b;
- barrier();
- return result;
-}
-
void foo() {
{
int i = 0;
while (true) {
int tint_symbol = i;
- int tint_symbol_1 = tint_workgroupUniformLoad_a();
+ int tint_symbol_1 = tint_workgroupUniformLoad(a);
if (!((tint_symbol < tint_symbol_1))) {
break;
}
@@ -33,7 +26,7 @@
}
{
int tint_symbol_2 = i;
- int tint_symbol_3 = tint_workgroupUniformLoad_b();
+ int tint_symbol_3 = tint_workgroupUniformLoad(b);
i = (tint_symbol_2 + tint_symbol_3);
}
}
diff --git a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.dxc.hlsl
index 48a589f..bfc2a25 100644
--- a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.dxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared bool v;
-
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
GroupMemoryBarrierWithGroupSync();
- const bool result = v;
+ const bool result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared bool v;
+
int foo() {
- if (tint_workgroupUniformLoad_v()) {
+ if (tint_workgroupUniformLoad(v)) {
return 42;
}
return 0;
diff --git a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.fxc.hlsl
index 48a589f..bfc2a25 100644
--- a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.fxc.hlsl
@@ -3,17 +3,17 @@
return;
}
-groupshared bool v;
-
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
GroupMemoryBarrierWithGroupSync();
- const bool result = v;
+ const bool result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared bool v;
+
int foo() {
- if (tint_workgroupUniformLoad_v()) {
+ if (tint_workgroupUniformLoad(v)) {
return 42;
}
return 0;
diff --git a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.glsl
index ad15d25..ef53245 100644
--- a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.glsl
@@ -4,16 +4,16 @@
void unused_entry_point() {
return;
}
-shared bool v;
-bool tint_workgroupUniformLoad_v() {
+bool tint_workgroupUniformLoad(inout bool p) {
barrier();
- bool result = v;
+ bool result = p;
barrier();
return result;
}
+shared bool v;
int foo() {
- if (tint_workgroupUniformLoad_v()) {
+ if (tint_workgroupUniformLoad(v)) {
return 42;
}
return 0;
diff --git a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.dxc.hlsl
index 1b22b46..053093e 100644
--- a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.dxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared float3x3 v;
-
-float3x3 tint_workgroupUniformLoad_v() {
+float3x3 tint_workgroupUniformLoad(inout float3x3 p) {
GroupMemoryBarrierWithGroupSync();
- const float3x3 result = v;
+ const float3x3 result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float3x3 v;
+
float3x3 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.fxc.hlsl
index 1b22b46..053093e 100644
--- a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.fxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared float3x3 v;
-
-float3x3 tint_workgroupUniformLoad_v() {
+float3x3 tint_workgroupUniformLoad(inout float3x3 p) {
GroupMemoryBarrierWithGroupSync();
- const float3x3 result = v;
+ const float3x3 result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float3x3 v;
+
float3x3 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.glsl
index ac70b34a..86ea506 100644
--- a/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/matrix.wgsl.expected.glsl
@@ -4,15 +4,15 @@
void unused_entry_point() {
return;
}
-shared mat3 v;
-mat3 tint_workgroupUniformLoad_v() {
+mat3 tint_workgroupUniformLoad(inout mat3 p) {
barrier();
- mat3 result = v;
+ mat3 result = p;
barrier();
return result;
}
+shared mat3 v;
mat3 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.dxc.hlsl
index eb3a52c..201beac 100644
--- a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.dxc.hlsl
@@ -12,15 +12,15 @@
Inner a[4];
};
-groupshared Outer v;
-
-Outer tint_workgroupUniformLoad_v() {
+Outer tint_workgroupUniformLoad(inout Outer p) {
GroupMemoryBarrierWithGroupSync();
- const Outer result = v;
+ const Outer result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared Outer v;
+
Outer foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.fxc.hlsl
index eb3a52c..201beac 100644
--- a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.fxc.hlsl
@@ -12,15 +12,15 @@
Inner a[4];
};
-groupshared Outer v;
-
-Outer tint_workgroupUniformLoad_v() {
+Outer tint_workgroupUniformLoad(inout Outer p) {
GroupMemoryBarrierWithGroupSync();
- const Outer result = v;
+ const Outer result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared Outer v;
+
Outer foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.glsl
index 7f9766a..203e90d 100644
--- a/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/structures.wgsl.expected.glsl
@@ -14,15 +14,15 @@
Inner a[4];
};
-shared Outer v;
-Outer tint_workgroupUniformLoad_v() {
+Outer tint_workgroupUniformLoad(inout Outer p) {
barrier();
- Outer result = v;
+ Outer result = p;
barrier();
return result;
}
+shared Outer v;
Outer foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.dxc.hlsl
index 80cd6df..77473c206 100644
--- a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.dxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared float4 v;
-
-float4 tint_workgroupUniformLoad_v() {
+float4 tint_workgroupUniformLoad(inout float4 p) {
GroupMemoryBarrierWithGroupSync();
- const float4 result = v;
+ const float4 result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float4 v;
+
float4 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.fxc.hlsl
index 80cd6df..77473c206 100644
--- a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.fxc.hlsl
@@ -3,15 +3,15 @@
return;
}
-groupshared float4 v;
-
-float4 tint_workgroupUniformLoad_v() {
+float4 tint_workgroupUniformLoad(inout float4 p) {
GroupMemoryBarrierWithGroupSync();
- const float4 result = v;
+ const float4 result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared float4 v;
+
float4 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.glsl
index f4dc643..76e29ed 100644
--- a/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/vec.wgsl.expected.glsl
@@ -4,15 +4,15 @@
void unused_entry_point() {
return;
}
-shared vec4 v;
-vec4 tint_workgroupUniformLoad_v() {
+vec4 tint_workgroupUniformLoad(inout vec4 p) {
barrier();
- vec4 result = v;
+ vec4 result = p;
barrier();
return result;
}
+shared vec4 v;
vec4 foo() {
- return tint_workgroupUniformLoad_v();
+ return tint_workgroupUniformLoad(v);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.dxc.hlsl b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.dxc.hlsl
index de20d9c..2d0fe18 100644
--- a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.dxc.hlsl
@@ -3,21 +3,20 @@
return;
}
-groupshared int v[4];
-
-int tint_workgroupUniformLoad_v_X(uint p[1]) {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = v[p[0]];
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[4];
+
int foo_v_X(uint p[1]) {
- const uint tint_symbol[1] = {p[0u]};
- return tint_workgroupUniformLoad_v_X(tint_symbol);
+ return tint_workgroupUniformLoad(v[p[0]]);
}
int bar() {
- const uint tint_symbol_1[1] = (uint[1])0;
- return foo_v_X(tint_symbol_1);
+ const uint tint_symbol[1] = (uint[1])0;
+ return foo_v_X(tint_symbol);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.fxc.hlsl b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.fxc.hlsl
index de20d9c..2d0fe18 100644
--- a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.fxc.hlsl
@@ -3,21 +3,20 @@
return;
}
-groupshared int v[4];
-
-int tint_workgroupUniformLoad_v_X(uint p[1]) {
+int tint_workgroupUniformLoad(inout int p) {
GroupMemoryBarrierWithGroupSync();
- const int result = v[p[0]];
+ const int result = p;
GroupMemoryBarrierWithGroupSync();
return result;
}
+groupshared int v[4];
+
int foo_v_X(uint p[1]) {
- const uint tint_symbol[1] = {p[0u]};
- return tint_workgroupUniformLoad_v_X(tint_symbol);
+ return tint_workgroupUniformLoad(v[p[0]]);
}
int bar() {
- const uint tint_symbol_1[1] = (uint[1])0;
- return foo_v_X(tint_symbol_1);
+ const uint tint_symbol[1] = (uint[1])0;
+ return foo_v_X(tint_symbol);
}
diff --git a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.glsl b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.glsl
index 7555463..aa2e549 100644
--- a/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.glsl
+++ b/test/tint/builtins/workgroupUniformLoad/via_param.wgsl.expected.glsl
@@ -4,21 +4,20 @@
void unused_entry_point() {
return;
}
-shared int v[4];
-int tint_workgroupUniformLoad_v_X(uint p[1]) {
+int tint_workgroupUniformLoad(inout int p) {
barrier();
- int result = v[p[0]];
+ int result = p;
barrier();
return result;
}
+shared int v[4];
int foo_v_X(uint p[1]) {
- uint tint_symbol[1] = uint[1](p[0u]);
- return tint_workgroupUniformLoad_v_X(tint_symbol);
+ return tint_workgroupUniformLoad(v[p[0]]);
}
int bar() {
- uint tint_symbol_1[1] = uint[1](0u);
- return foo_v_X(tint_symbol_1);
+ uint tint_symbol[1] = uint[1](0u);
+ return foo_v_X(tint_symbol);
}
diff --git a/test/tint/expressions/binary/mod/scalar-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod/scalar-scalar/i32.wgsl.expected.spvasm
index 89a507f..4a87507 100644
--- a/test/tint/expressions/binary/mod/scalar-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod/scalar-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,62 +10,49 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%1 = OpTypeFunction %int %int %int
+ %8 = OpConstantNull %int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %10 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
- %13 = OpConstantNull %int
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %29 = OpConstantNull %uint
- %true = OpConstantTrue %bool
+ %24 = OpConstantNull %uint
%void = OpTypeVoid
- %40 = OpTypeFunction %void
+ %33 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%tint_mod = OpFunction %int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%6 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %10
-%tint_return_value = OpVariable %_ptr_Function_int Function %13
- %15 = OpIEqual %bool %rhs %13
- %17 = OpIEqual %bool %lhs %int_n2147483648
- %19 = OpIEqual %bool %rhs %int_n1
- %20 = OpLogicalAnd %bool %17 %19
- %21 = OpLogicalOr %bool %15 %20
- %14 = OpSelect %int %21 %int_1 %rhs
- %26 = OpBitwiseOr %int %lhs %14
- %24 = OpBitcast %uint %26
- %28 = OpBitwiseAnd %uint %24 %uint_2147483648
- %30 = OpINotEqual %bool %28 %29
- OpSelectionMerge %31 None
- OpBranchConditional %30 %32 %33
- %32 = OpLabel
- OpStore %tint_return_flag %true
- %35 = OpSDiv %int %lhs %14
- %36 = OpIMul %int %35 %14
- %37 = OpISub %int %lhs %36
- OpStore %tint_return_value %37
- OpBranch %31
- %33 = OpLabel
- OpStore %tint_return_flag %true
- %38 = OpSRem %int %lhs %14
- OpStore %tint_return_value %38
- OpBranch %31
- %31 = OpLabel
- %39 = OpLoad %int %tint_return_value
- OpReturnValue %39
+ %9 = OpIEqual %bool %rhs %8
+ %12 = OpIEqual %bool %lhs %int_n2147483648
+ %14 = OpIEqual %bool %rhs %int_n1
+ %15 = OpLogicalAnd %bool %12 %14
+ %16 = OpLogicalOr %bool %9 %15
+ %7 = OpSelect %int %16 %int_1 %rhs
+ %21 = OpBitwiseOr %int %lhs %7
+ %19 = OpBitcast %uint %21
+ %23 = OpBitwiseAnd %uint %19 %uint_2147483648
+ %25 = OpINotEqual %bool %23 %24
+ OpSelectionMerge %26 None
+ OpBranchConditional %25 %27 %28
+ %27 = OpLabel
+ %29 = OpSDiv %int %lhs %7
+ %30 = OpIMul %int %29 %7
+ %31 = OpISub %int %lhs %30
+ OpReturnValue %31
+ %28 = OpLabel
+ %32 = OpSRem %int %lhs %7
+ OpReturnValue %32
+ %26 = OpLabel
+ OpReturnValue %8
OpFunctionEnd
- %f = OpFunction %void None %40
- %43 = OpLabel
- %45 = OpFunctionCall %int %tint_mod %int_1 %int_2
+ %f = OpFunction %void None %33
+ %36 = OpLabel
+ %38 = OpFunctionCall %int %tint_mod %int_1 %int_2
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod/scalar-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod/scalar-vec3/i32.wgsl.expected.spvasm
index 749734c..707d590 100644
--- a/test/tint/expressions/binary/mod/scalar-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod/scalar-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,74 +10,61 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %int %v3int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_4 = OpConstant %int 4
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %55 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+ %48 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %lhs %lhs %lhs
- %17 = OpIEqual %v3bool %rhs %14
- %21 = OpIEqual %v3bool %15 %20
- %24 = OpIEqual %v3bool %rhs %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %rhs
- %33 = OpBitwiseOr %v3int %15 %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %15 %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %15 %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %15 %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %lhs %lhs %lhs
+ %11 = OpIEqual %v3bool %rhs %10
+ %16 = OpIEqual %v3bool %8 %15
+ %19 = OpIEqual %v3bool %rhs %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %rhs
+ %28 = OpBitwiseOr %v3int %8 %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %8 %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %8 %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %8 %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %56 = OpFunctionCall %v3int %tint_mod %int_4 %55
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %49 = OpFunctionCall %v3int %tint_mod %int_4 %48
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod/vec3-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod/vec3-scalar/i32.wgsl.expected.spvasm
index 52fbedb..6b884aa 100644
--- a/test/tint/expressions/binary/mod/vec3-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod/vec3-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,74 +10,61 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+ %47 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%int_4 = OpConstant %int 4
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %rhs %rhs %rhs
- %17 = OpIEqual %v3bool %15 %14
- %21 = OpIEqual %v3bool %lhs %20
- %24 = OpIEqual %v3bool %15 %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %15
- %33 = OpBitwiseOr %v3int %lhs %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %lhs %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %lhs %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %lhs %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %rhs %rhs %rhs
+ %11 = OpIEqual %v3bool %8 %10
+ %16 = OpIEqual %v3bool %lhs %15
+ %19 = OpIEqual %v3bool %8 %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %8
+ %28 = OpBitwiseOr %v3int %lhs %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %lhs %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %lhs %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %lhs %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %56 = OpFunctionCall %v3int %tint_mod %54 %int_4
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %49 = OpFunctionCall %v3int %tint_mod %47 %int_4
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod/vec3-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod/vec3-vec3/i32.wgsl.expected.spvasm
index 92536c9..86a721b 100644
--- a/test/tint/expressions/binary/mod/vec3-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod/vec3-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,76 +10,63 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %v3int
+ %9 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %19 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %14 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %22 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %17 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %34 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %36 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %29 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %31 = OpConstantNull %v3uint
%void = OpTypeVoid
- %47 = OpTypeFunction %void
+ %40 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %53 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+ %46 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%int_4 = OpConstant %int 4
%int_5 = OpConstant %int 5
%int_6 = OpConstant %int 6
- %57 = OpConstantComposite %v3int %int_4 %int_5 %int_6
+ %50 = OpConstantComposite %v3int %int_4 %int_5 %int_6
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %16 = OpIEqual %v3bool %rhs %14
- %20 = OpIEqual %v3bool %lhs %19
- %23 = OpIEqual %v3bool %rhs %22
- %24 = OpLogicalAnd %v3bool %20 %23
- %25 = OpLogicalOr %v3bool %16 %24
- %15 = OpSelect %v3int %25 %27 %rhs
- %32 = OpBitwiseOr %v3int %lhs %15
- %29 = OpBitcast %v3uint %32
- %35 = OpBitwiseAnd %v3uint %29 %34
- %37 = OpINotEqual %v3bool %35 %36
- %28 = OpAny %bool %37
- OpSelectionMerge %38 None
- OpBranchConditional %28 %39 %40
- %39 = OpLabel
- OpStore %tint_return_flag %true
- %42 = OpSDiv %v3int %lhs %15
- %43 = OpIMul %v3int %42 %15
- %44 = OpISub %v3int %lhs %43
- OpStore %tint_return_value %44
- OpBranch %38
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %45 = OpSRem %v3int %lhs %15
- OpStore %tint_return_value %45
- OpBranch %38
- %38 = OpLabel
- %46 = OpLoad %v3int %tint_return_value
- OpReturnValue %46
+ %10 = OpIEqual %v3bool %rhs %9
+ %15 = OpIEqual %v3bool %lhs %14
+ %18 = OpIEqual %v3bool %rhs %17
+ %19 = OpLogicalAnd %v3bool %15 %18
+ %20 = OpLogicalOr %v3bool %10 %19
+ %8 = OpSelect %v3int %20 %22 %rhs
+ %27 = OpBitwiseOr %v3int %lhs %8
+ %24 = OpBitcast %v3uint %27
+ %30 = OpBitwiseAnd %v3uint %24 %29
+ %32 = OpINotEqual %v3bool %30 %31
+ %23 = OpAny %bool %32
+ OpSelectionMerge %33 None
+ OpBranchConditional %23 %34 %35
+ %34 = OpLabel
+ %36 = OpSDiv %v3int %lhs %8
+ %37 = OpIMul %v3int %36 %8
+ %38 = OpISub %v3int %lhs %37
+ OpReturnValue %38
+ %35 = OpLabel
+ %39 = OpSRem %v3int %lhs %8
+ OpReturnValue %39
+ %33 = OpLabel
+ OpReturnValue %9
OpFunctionEnd
- %f = OpFunction %void None %47
- %50 = OpLabel
- %58 = OpFunctionCall %v3int %tint_mod %53 %57
+ %f = OpFunction %void None %40
+ %43 = OpLabel
+ %51 = OpFunctionCall %v3int %tint_mod %46 %50
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-scalar/i32.wgsl.expected.spvasm
index 5963a80..02476d0 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,61 +10,48 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%1 = OpTypeFunction %int %int %int
+ %8 = OpConstantNull %int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %10 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
- %13 = OpConstantNull %int
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %29 = OpConstantNull %uint
- %true = OpConstantTrue %bool
+ %24 = OpConstantNull %uint
%void = OpTypeVoid
- %40 = OpTypeFunction %void
+ %33 = OpTypeFunction %void
%tint_mod = OpFunction %int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%6 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %10
-%tint_return_value = OpVariable %_ptr_Function_int Function %13
- %15 = OpIEqual %bool %rhs %13
- %17 = OpIEqual %bool %lhs %int_n2147483648
- %19 = OpIEqual %bool %rhs %int_n1
- %20 = OpLogicalAnd %bool %17 %19
- %21 = OpLogicalOr %bool %15 %20
- %14 = OpSelect %int %21 %int_1 %rhs
- %26 = OpBitwiseOr %int %lhs %14
- %24 = OpBitcast %uint %26
- %28 = OpBitwiseAnd %uint %24 %uint_2147483648
- %30 = OpINotEqual %bool %28 %29
- OpSelectionMerge %31 None
- OpBranchConditional %30 %32 %33
- %32 = OpLabel
- OpStore %tint_return_flag %true
- %35 = OpSDiv %int %lhs %14
- %36 = OpIMul %int %35 %14
- %37 = OpISub %int %lhs %36
- OpStore %tint_return_value %37
- OpBranch %31
- %33 = OpLabel
- OpStore %tint_return_flag %true
- %38 = OpSRem %int %lhs %14
- OpStore %tint_return_value %38
- OpBranch %31
- %31 = OpLabel
- %39 = OpLoad %int %tint_return_value
- OpReturnValue %39
+ %9 = OpIEqual %bool %rhs %8
+ %12 = OpIEqual %bool %lhs %int_n2147483648
+ %14 = OpIEqual %bool %rhs %int_n1
+ %15 = OpLogicalAnd %bool %12 %14
+ %16 = OpLogicalOr %bool %9 %15
+ %7 = OpSelect %int %16 %int_1 %rhs
+ %21 = OpBitwiseOr %int %lhs %7
+ %19 = OpBitcast %uint %21
+ %23 = OpBitwiseAnd %uint %19 %uint_2147483648
+ %25 = OpINotEqual %bool %23 %24
+ OpSelectionMerge %26 None
+ OpBranchConditional %25 %27 %28
+ %27 = OpLabel
+ %29 = OpSDiv %int %lhs %7
+ %30 = OpIMul %int %29 %7
+ %31 = OpISub %int %lhs %30
+ OpReturnValue %31
+ %28 = OpLabel
+ %32 = OpSRem %int %lhs %7
+ OpReturnValue %32
+ %26 = OpLabel
+ OpReturnValue %8
OpFunctionEnd
- %f = OpFunction %void None %40
- %43 = OpLabel
- %44 = OpFunctionCall %int %tint_mod %int_1 %13
+ %f = OpFunction %void None %33
+ %36 = OpLabel
+ %37 = OpFunctionCall %int %tint_mod %int_1 %8
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm
index 11dd73e8..7f90f81 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,74 +10,61 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %int %v3int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_4 = OpConstant %int 4
- %53 = OpConstantNull %int
+ %46 = OpConstantNull %int
%int_2 = OpConstant %int 2
- %55 = OpConstantComposite %v3int %53 %int_2 %53
+ %48 = OpConstantComposite %v3int %46 %int_2 %46
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %lhs %lhs %lhs
- %17 = OpIEqual %v3bool %rhs %14
- %21 = OpIEqual %v3bool %15 %20
- %24 = OpIEqual %v3bool %rhs %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %rhs
- %33 = OpBitwiseOr %v3int %15 %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %15 %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %15 %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %15 %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %lhs %lhs %lhs
+ %11 = OpIEqual %v3bool %rhs %10
+ %16 = OpIEqual %v3bool %8 %15
+ %19 = OpIEqual %v3bool %rhs %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %rhs
+ %28 = OpBitwiseOr %v3int %8 %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %8 %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %8 %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %8 %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %56 = OpFunctionCall %v3int %tint_mod %int_4 %55
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %49 = OpFunctionCall %v3int %tint_mod %int_4 %48
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-scalar/i32.wgsl.expected.spvasm
index e88004d..ce0bc86 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,74 +10,61 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %55 = OpConstantNull %int
+ %47 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+ %48 = OpConstantNull %int
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %rhs %rhs %rhs
- %17 = OpIEqual %v3bool %15 %14
- %21 = OpIEqual %v3bool %lhs %20
- %24 = OpIEqual %v3bool %15 %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %15
- %33 = OpBitwiseOr %v3int %lhs %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %lhs %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %lhs %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %lhs %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %rhs %rhs %rhs
+ %11 = OpIEqual %v3bool %8 %10
+ %16 = OpIEqual %v3bool %lhs %15
+ %19 = OpIEqual %v3bool %8 %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %8
+ %28 = OpBitwiseOr %v3int %lhs %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %lhs %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %lhs %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %lhs %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %56 = OpFunctionCall %v3int %tint_mod %54 %55
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %49 = OpFunctionCall %v3int %tint_mod %47 %48
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm
index 30bd04a..9265dc2 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,75 +10,62 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %v3int
+ %9 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %19 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %14 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %22 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %17 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %34 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %36 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %29 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %31 = OpConstantNull %v3uint
%void = OpTypeVoid
- %47 = OpTypeFunction %void
+ %40 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %53 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %54 = OpConstantNull %int
+ %46 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+ %47 = OpConstantNull %int
%int_5 = OpConstant %int 5
- %56 = OpConstantComposite %v3int %54 %int_5 %54
+ %49 = OpConstantComposite %v3int %47 %int_5 %47
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %16 = OpIEqual %v3bool %rhs %14
- %20 = OpIEqual %v3bool %lhs %19
- %23 = OpIEqual %v3bool %rhs %22
- %24 = OpLogicalAnd %v3bool %20 %23
- %25 = OpLogicalOr %v3bool %16 %24
- %15 = OpSelect %v3int %25 %27 %rhs
- %32 = OpBitwiseOr %v3int %lhs %15
- %29 = OpBitcast %v3uint %32
- %35 = OpBitwiseAnd %v3uint %29 %34
- %37 = OpINotEqual %v3bool %35 %36
- %28 = OpAny %bool %37
- OpSelectionMerge %38 None
- OpBranchConditional %28 %39 %40
- %39 = OpLabel
- OpStore %tint_return_flag %true
- %42 = OpSDiv %v3int %lhs %15
- %43 = OpIMul %v3int %42 %15
- %44 = OpISub %v3int %lhs %43
- OpStore %tint_return_value %44
- OpBranch %38
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %45 = OpSRem %v3int %lhs %15
- OpStore %tint_return_value %45
- OpBranch %38
- %38 = OpLabel
- %46 = OpLoad %v3int %tint_return_value
- OpReturnValue %46
+ %10 = OpIEqual %v3bool %rhs %9
+ %15 = OpIEqual %v3bool %lhs %14
+ %18 = OpIEqual %v3bool %rhs %17
+ %19 = OpLogicalAnd %v3bool %15 %18
+ %20 = OpLogicalOr %v3bool %10 %19
+ %8 = OpSelect %v3int %20 %22 %rhs
+ %27 = OpBitwiseOr %v3int %lhs %8
+ %24 = OpBitcast %v3uint %27
+ %30 = OpBitwiseAnd %v3uint %24 %29
+ %32 = OpINotEqual %v3bool %30 %31
+ %23 = OpAny %bool %32
+ OpSelectionMerge %33 None
+ OpBranchConditional %23 %34 %35
+ %34 = OpLabel
+ %36 = OpSDiv %v3int %lhs %8
+ %37 = OpIMul %v3int %36 %8
+ %38 = OpISub %v3int %lhs %37
+ OpReturnValue %38
+ %35 = OpLabel
+ %39 = OpSRem %v3int %lhs %8
+ OpReturnValue %39
+ %33 = OpLabel
+ OpReturnValue %9
OpFunctionEnd
- %f = OpFunction %void None %47
- %50 = OpLabel
- %57 = OpFunctionCall %v3int %tint_mod %53 %56
+ %f = OpFunction %void None %40
+ %43 = OpLabel
+ %50 = OpFunctionCall %v3int %tint_mod %46 %49
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-scalar/i32.wgsl.expected.spvasm
index e634964..815a185 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 45
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,71 +10,59 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%1 = OpTypeFunction %int %int %int
+ %8 = OpConstantNull %int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %10 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
- %13 = OpConstantNull %int
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %29 = OpConstantNull %uint
- %true = OpConstantTrue %bool
+ %24 = OpConstantNull %uint
%void = OpTypeVoid
- %40 = OpTypeFunction %void
+ %33 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
%tint_mod = OpFunction %int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%6 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %10
-%tint_return_value = OpVariable %_ptr_Function_int Function %13
- %15 = OpIEqual %bool %rhs %13
- %17 = OpIEqual %bool %lhs %int_n2147483648
- %19 = OpIEqual %bool %rhs %int_n1
- %20 = OpLogicalAnd %bool %17 %19
- %21 = OpLogicalOr %bool %15 %20
- %14 = OpSelect %int %21 %int_1 %rhs
- %26 = OpBitwiseOr %int %lhs %14
- %24 = OpBitcast %uint %26
- %28 = OpBitwiseAnd %uint %24 %uint_2147483648
- %30 = OpINotEqual %bool %28 %29
- OpSelectionMerge %31 None
- OpBranchConditional %30 %32 %33
- %32 = OpLabel
- OpStore %tint_return_flag %true
- %35 = OpSDiv %int %lhs %14
- %36 = OpIMul %int %35 %14
- %37 = OpISub %int %lhs %36
- OpStore %tint_return_value %37
- OpBranch %31
- %33 = OpLabel
- OpStore %tint_return_flag %true
- %38 = OpSRem %int %lhs %14
- OpStore %tint_return_value %38
- OpBranch %31
- %31 = OpLabel
- %39 = OpLoad %int %tint_return_value
- OpReturnValue %39
+ %9 = OpIEqual %bool %rhs %8
+ %12 = OpIEqual %bool %lhs %int_n2147483648
+ %14 = OpIEqual %bool %rhs %int_n1
+ %15 = OpLogicalAnd %bool %12 %14
+ %16 = OpLogicalOr %bool %9 %15
+ %7 = OpSelect %int %16 %int_1 %rhs
+ %21 = OpBitwiseOr %int %lhs %7
+ %19 = OpBitcast %uint %21
+ %23 = OpBitwiseAnd %uint %19 %uint_2147483648
+ %25 = OpINotEqual %bool %23 %24
+ OpSelectionMerge %26 None
+ OpBranchConditional %25 %27 %28
+ %27 = OpLabel
+ %29 = OpSDiv %int %lhs %7
+ %30 = OpIMul %int %29 %7
+ %31 = OpISub %int %lhs %30
+ OpReturnValue %31
+ %28 = OpLabel
+ %32 = OpSRem %int %lhs %7
+ OpReturnValue %32
+ %26 = OpLabel
+ OpReturnValue %8
OpFunctionEnd
- %f = OpFunction %void None %40
- %43 = OpLabel
- %a = OpVariable %_ptr_Function_int Function %13
- %b = OpVariable %_ptr_Function_int Function %13
+ %f = OpFunction %void None %33
+ %36 = OpLabel
+ %a = OpVariable %_ptr_Function_int Function %8
+ %b = OpVariable %_ptr_Function_int Function %8
OpStore %a %int_1
- OpStore %b %13
- %47 = OpLoad %int %a
- %48 = OpLoad %int %b
- %49 = OpLoad %int %b
- %50 = OpIAdd %int %48 %49
- %46 = OpFunctionCall %int %tint_mod %47 %50
+ OpStore %b %8
+ %41 = OpLoad %int %a
+ %42 = OpLoad %int %b
+ %43 = OpLoad %int %b
+ %44 = OpIAdd %int %42 %43
+ %40 = OpFunctionCall %int %tint_mod %41 %44
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm
index 18b6fdd..a79e7b3 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 58
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,85 +10,73 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %int %v3int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_4 = OpConstant %int 4
%_ptr_Function_int = OpTypePointer Function %int
- %55 = OpConstantNull %int
+ %48 = OpConstantNull %int
%int_2 = OpConstant %int 2
- %57 = OpConstantComposite %v3int %55 %int_2 %55
+ %50 = OpConstantComposite %v3int %48 %int_2 %48
+%_ptr_Function_v3int = OpTypePointer Function %v3int
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %lhs %lhs %lhs
- %17 = OpIEqual %v3bool %rhs %14
- %21 = OpIEqual %v3bool %15 %20
- %24 = OpIEqual %v3bool %rhs %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %rhs
- %33 = OpBitwiseOr %v3int %15 %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %15 %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %15 %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %15 %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %lhs %lhs %lhs
+ %11 = OpIEqual %v3bool %rhs %10
+ %16 = OpIEqual %v3bool %8 %15
+ %19 = OpIEqual %v3bool %rhs %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %rhs
+ %28 = OpBitwiseOr %v3int %8 %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %8 %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %8 %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %8 %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %a = OpVariable %_ptr_Function_int Function %55
- %b = OpVariable %_ptr_Function_v3int Function %14
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %a = OpVariable %_ptr_Function_int Function %48
+ %b = OpVariable %_ptr_Function_v3int Function %10
OpStore %a %int_4
- OpStore %b %57
- %60 = OpLoad %int %a
- %61 = OpLoad %v3int %b
- %62 = OpLoad %v3int %b
- %63 = OpIAdd %v3int %61 %62
- %59 = OpFunctionCall %v3int %tint_mod %60 %63
+ OpStore %b %50
+ %54 = OpLoad %int %a
+ %55 = OpLoad %v3int %b
+ %56 = OpLoad %v3int %b
+ %57 = OpIAdd %v3int %55 %56
+ %53 = OpFunctionCall %v3int %tint_mod %54 %57
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-scalar/i32.wgsl.expected.spvasm
index 80e55ae..3673126 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 58
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,85 +10,73 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %56 = OpConstantNull %int
+ %47 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %50 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %rhs %rhs %rhs
- %17 = OpIEqual %v3bool %15 %14
- %21 = OpIEqual %v3bool %lhs %20
- %24 = OpIEqual %v3bool %15 %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %15
- %33 = OpBitwiseOr %v3int %lhs %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %lhs %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %lhs %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %lhs %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %rhs %rhs %rhs
+ %11 = OpIEqual %v3bool %8 %10
+ %16 = OpIEqual %v3bool %lhs %15
+ %19 = OpIEqual %v3bool %8 %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %8
+ %28 = OpBitwiseOr %v3int %lhs %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %lhs %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %lhs %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %lhs %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %a = OpVariable %_ptr_Function_v3int Function %14
- %b = OpVariable %_ptr_Function_int Function %56
- OpStore %a %54
- OpStore %b %56
- %60 = OpLoad %v3int %a
- %61 = OpLoad %int %b
- %62 = OpLoad %int %b
- %63 = OpIAdd %int %61 %62
- %59 = OpFunctionCall %v3int %tint_mod %60 %63
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %a = OpVariable %_ptr_Function_v3int Function %10
+ %b = OpVariable %_ptr_Function_int Function %50
+ OpStore %a %47
+ OpStore %b %50
+ %54 = OpLoad %v3int %a
+ %55 = OpLoad %int %b
+ %56 = OpLoad %int %b
+ %57 = OpIAdd %int %55 %56
+ %53 = OpFunctionCall %v3int %tint_mod %54 %57
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm
index 1c69618..b1590cf 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 58
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,85 +10,73 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %v3int
+ %9 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %19 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %14 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %22 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %17 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %34 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %36 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %29 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %31 = OpConstantNull %v3uint
%void = OpTypeVoid
- %47 = OpTypeFunction %void
+ %40 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %53 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %55 = OpConstantNull %int
+ %46 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %49 = OpConstantNull %int
%int_5 = OpConstant %int 5
- %57 = OpConstantComposite %v3int %55 %int_5 %55
+ %51 = OpConstantComposite %v3int %49 %int_5 %49
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %16 = OpIEqual %v3bool %rhs %14
- %20 = OpIEqual %v3bool %lhs %19
- %23 = OpIEqual %v3bool %rhs %22
- %24 = OpLogicalAnd %v3bool %20 %23
- %25 = OpLogicalOr %v3bool %16 %24
- %15 = OpSelect %v3int %25 %27 %rhs
- %32 = OpBitwiseOr %v3int %lhs %15
- %29 = OpBitcast %v3uint %32
- %35 = OpBitwiseAnd %v3uint %29 %34
- %37 = OpINotEqual %v3bool %35 %36
- %28 = OpAny %bool %37
- OpSelectionMerge %38 None
- OpBranchConditional %28 %39 %40
- %39 = OpLabel
- OpStore %tint_return_flag %true
- %42 = OpSDiv %v3int %lhs %15
- %43 = OpIMul %v3int %42 %15
- %44 = OpISub %v3int %lhs %43
- OpStore %tint_return_value %44
- OpBranch %38
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %45 = OpSRem %v3int %lhs %15
- OpStore %tint_return_value %45
- OpBranch %38
- %38 = OpLabel
- %46 = OpLoad %v3int %tint_return_value
- OpReturnValue %46
+ %10 = OpIEqual %v3bool %rhs %9
+ %15 = OpIEqual %v3bool %lhs %14
+ %18 = OpIEqual %v3bool %rhs %17
+ %19 = OpLogicalAnd %v3bool %15 %18
+ %20 = OpLogicalOr %v3bool %10 %19
+ %8 = OpSelect %v3int %20 %22 %rhs
+ %27 = OpBitwiseOr %v3int %lhs %8
+ %24 = OpBitcast %v3uint %27
+ %30 = OpBitwiseAnd %v3uint %24 %29
+ %32 = OpINotEqual %v3bool %30 %31
+ %23 = OpAny %bool %32
+ OpSelectionMerge %33 None
+ OpBranchConditional %23 %34 %35
+ %34 = OpLabel
+ %36 = OpSDiv %v3int %lhs %8
+ %37 = OpIMul %v3int %36 %8
+ %38 = OpISub %v3int %lhs %37
+ OpReturnValue %38
+ %35 = OpLabel
+ %39 = OpSRem %v3int %lhs %8
+ OpReturnValue %39
+ %33 = OpLabel
+ OpReturnValue %9
OpFunctionEnd
- %f = OpFunction %void None %47
- %50 = OpLabel
- %a = OpVariable %_ptr_Function_v3int Function %14
- %b = OpVariable %_ptr_Function_v3int Function %14
- OpStore %a %53
- OpStore %b %57
- %60 = OpLoad %v3int %a
- %61 = OpLoad %v3int %b
- %62 = OpLoad %v3int %b
- %63 = OpIAdd %v3int %61 %62
- %59 = OpFunctionCall %v3int %tint_mod %60 %63
+ %f = OpFunction %void None %40
+ %43 = OpLabel
+ %a = OpVariable %_ptr_Function_v3int Function %9
+ %b = OpVariable %_ptr_Function_v3int Function %9
+ OpStore %a %46
+ OpStore %b %51
+ %54 = OpLoad %v3int %a
+ %55 = OpLoad %v3int %b
+ %56 = OpLoad %v3int %b
+ %57 = OpIAdd %v3int %55 %56
+ %53 = OpFunctionCall %v3int %tint_mod %54 %57
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-scalar/i32.wgsl.expected.spvasm
index deb7e72..f552543 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,69 +10,57 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%1 = OpTypeFunction %int %int %int
+ %8 = OpConstantNull %int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %10 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
- %13 = OpConstantNull %int
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %29 = OpConstantNull %uint
- %true = OpConstantTrue %bool
+ %24 = OpConstantNull %uint
%void = OpTypeVoid
- %40 = OpTypeFunction %void
+ %33 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
%tint_mod = OpFunction %int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%6 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %10
-%tint_return_value = OpVariable %_ptr_Function_int Function %13
- %15 = OpIEqual %bool %rhs %13
- %17 = OpIEqual %bool %lhs %int_n2147483648
- %19 = OpIEqual %bool %rhs %int_n1
- %20 = OpLogicalAnd %bool %17 %19
- %21 = OpLogicalOr %bool %15 %20
- %14 = OpSelect %int %21 %int_1 %rhs
- %26 = OpBitwiseOr %int %lhs %14
- %24 = OpBitcast %uint %26
- %28 = OpBitwiseAnd %uint %24 %uint_2147483648
- %30 = OpINotEqual %bool %28 %29
- OpSelectionMerge %31 None
- OpBranchConditional %30 %32 %33
- %32 = OpLabel
- OpStore %tint_return_flag %true
- %35 = OpSDiv %int %lhs %14
- %36 = OpIMul %int %35 %14
- %37 = OpISub %int %lhs %36
- OpStore %tint_return_value %37
- OpBranch %31
- %33 = OpLabel
- OpStore %tint_return_flag %true
- %38 = OpSRem %int %lhs %14
- OpStore %tint_return_value %38
- OpBranch %31
- %31 = OpLabel
- %39 = OpLoad %int %tint_return_value
- OpReturnValue %39
+ %9 = OpIEqual %bool %rhs %8
+ %12 = OpIEqual %bool %lhs %int_n2147483648
+ %14 = OpIEqual %bool %rhs %int_n1
+ %15 = OpLogicalAnd %bool %12 %14
+ %16 = OpLogicalOr %bool %9 %15
+ %7 = OpSelect %int %16 %int_1 %rhs
+ %21 = OpBitwiseOr %int %lhs %7
+ %19 = OpBitcast %uint %21
+ %23 = OpBitwiseAnd %uint %19 %uint_2147483648
+ %25 = OpINotEqual %bool %23 %24
+ OpSelectionMerge %26 None
+ OpBranchConditional %25 %27 %28
+ %27 = OpLabel
+ %29 = OpSDiv %int %lhs %7
+ %30 = OpIMul %int %29 %7
+ %31 = OpISub %int %lhs %30
+ OpReturnValue %31
+ %28 = OpLabel
+ %32 = OpSRem %int %lhs %7
+ OpReturnValue %32
+ %26 = OpLabel
+ OpReturnValue %8
OpFunctionEnd
- %f = OpFunction %void None %40
- %43 = OpLabel
- %a = OpVariable %_ptr_Function_int Function %13
- %b = OpVariable %_ptr_Function_int Function %13
+ %f = OpFunction %void None %33
+ %36 = OpLabel
+ %a = OpVariable %_ptr_Function_int Function %8
+ %b = OpVariable %_ptr_Function_int Function %8
OpStore %a %int_1
- OpStore %b %13
- %47 = OpLoad %int %a
- %48 = OpLoad %int %b
- %46 = OpFunctionCall %int %tint_mod %47 %48
+ OpStore %b %8
+ %41 = OpLoad %int %a
+ %42 = OpLoad %int %b
+ %40 = OpFunctionCall %int %tint_mod %41 %42
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm
index b386e2b..4990c23 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 56
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,83 +10,71 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %int %v3int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_4 = OpConstant %int 4
%_ptr_Function_int = OpTypePointer Function %int
- %55 = OpConstantNull %int
+ %48 = OpConstantNull %int
%int_2 = OpConstant %int 2
- %57 = OpConstantComposite %v3int %55 %int_2 %55
+ %50 = OpConstantComposite %v3int %48 %int_2 %48
+%_ptr_Function_v3int = OpTypePointer Function %v3int
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %lhs %lhs %lhs
- %17 = OpIEqual %v3bool %rhs %14
- %21 = OpIEqual %v3bool %15 %20
- %24 = OpIEqual %v3bool %rhs %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %rhs
- %33 = OpBitwiseOr %v3int %15 %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %15 %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %15 %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %15 %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %lhs %lhs %lhs
+ %11 = OpIEqual %v3bool %rhs %10
+ %16 = OpIEqual %v3bool %8 %15
+ %19 = OpIEqual %v3bool %rhs %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %rhs
+ %28 = OpBitwiseOr %v3int %8 %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %8 %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %8 %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %8 %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %a = OpVariable %_ptr_Function_int Function %55
- %b = OpVariable %_ptr_Function_v3int Function %14
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %a = OpVariable %_ptr_Function_int Function %48
+ %b = OpVariable %_ptr_Function_v3int Function %10
OpStore %a %int_4
- OpStore %b %57
- %60 = OpLoad %int %a
- %61 = OpLoad %v3int %b
- %59 = OpFunctionCall %v3int %tint_mod %60 %61
+ OpStore %b %50
+ %54 = OpLoad %int %a
+ %55 = OpLoad %v3int %b
+ %53 = OpFunctionCall %v3int %tint_mod %54 %55
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-scalar/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-scalar/i32.wgsl.expected.spvasm
index 3e128f9..9e99fc3 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-scalar/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-scalar/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 56
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,83 +10,71 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %int
+ %10 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %20 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %15 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %23 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %18 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %35 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %37 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %30 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %32 = OpConstantNull %v3uint
%void = OpTypeVoid
- %48 = OpTypeFunction %void
+ %41 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %56 = OpConstantNull %int
+ %47 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %50 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %15 = OpCompositeConstruct %v3int %rhs %rhs %rhs
- %17 = OpIEqual %v3bool %15 %14
- %21 = OpIEqual %v3bool %lhs %20
- %24 = OpIEqual %v3bool %15 %23
- %25 = OpLogicalAnd %v3bool %21 %24
- %26 = OpLogicalOr %v3bool %17 %25
- %16 = OpSelect %v3int %26 %28 %15
- %33 = OpBitwiseOr %v3int %lhs %16
- %30 = OpBitcast %v3uint %33
- %36 = OpBitwiseAnd %v3uint %30 %35
- %38 = OpINotEqual %v3bool %36 %37
- %29 = OpAny %bool %38
- OpSelectionMerge %39 None
- OpBranchConditional %29 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %v3int %lhs %16
- %44 = OpIMul %v3int %43 %16
- %45 = OpISub %v3int %lhs %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %v3int %lhs %16
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %v3int %tint_return_value
- OpReturnValue %47
+ %8 = OpCompositeConstruct %v3int %rhs %rhs %rhs
+ %11 = OpIEqual %v3bool %8 %10
+ %16 = OpIEqual %v3bool %lhs %15
+ %19 = OpIEqual %v3bool %8 %18
+ %20 = OpLogicalAnd %v3bool %16 %19
+ %21 = OpLogicalOr %v3bool %11 %20
+ %9 = OpSelect %v3int %21 %23 %8
+ %28 = OpBitwiseOr %v3int %lhs %9
+ %25 = OpBitcast %v3uint %28
+ %31 = OpBitwiseAnd %v3uint %25 %30
+ %33 = OpINotEqual %v3bool %31 %32
+ %24 = OpAny %bool %33
+ OpSelectionMerge %34 None
+ OpBranchConditional %24 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %v3int %lhs %9
+ %38 = OpIMul %v3int %37 %9
+ %39 = OpISub %v3int %lhs %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %v3int %lhs %9
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %10
OpFunctionEnd
- %f = OpFunction %void None %48
- %51 = OpLabel
- %a = OpVariable %_ptr_Function_v3int Function %14
- %b = OpVariable %_ptr_Function_int Function %56
- OpStore %a %54
- OpStore %b %56
- %60 = OpLoad %v3int %a
- %61 = OpLoad %int %b
- %59 = OpFunctionCall %v3int %tint_mod %60 %61
+ %f = OpFunction %void None %41
+ %44 = OpLabel
+ %a = OpVariable %_ptr_Function_v3int Function %10
+ %b = OpVariable %_ptr_Function_int Function %50
+ OpStore %a %47
+ OpStore %b %50
+ %54 = OpLoad %v3int %a
+ %55 = OpLoad %int %b
+ %53 = OpFunctionCall %v3int %tint_mod %54 %55
OpReturn
OpFunctionEnd
diff --git a/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm b/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm
index ebca6fa..7b469f1 100644
--- a/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm
+++ b/test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 56
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -10,83 +10,71 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %f "f"
OpName %a "a"
OpName %b "b"
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%1 = OpTypeFunction %v3int %v3int %v3int
+ %9 = OpConstantNull %v3int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %11 = OpConstantNull %bool
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %14 = OpConstantNull %v3int
%v3bool = OpTypeVector %bool 3
%int_n2147483648 = OpConstant %int -2147483648
- %19 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %14 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %22 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
+ %17 = OpConstantComposite %v3int %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_2147483648 = OpConstant %uint 2147483648
- %34 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
- %36 = OpConstantNull %v3uint
- %true = OpConstantTrue %bool
+ %29 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %31 = OpConstantNull %v3uint
%void = OpTypeVoid
- %47 = OpTypeFunction %void
+ %40 = OpTypeFunction %void
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
- %53 = OpConstantComposite %v3int %int_1 %int_2 %int_3
- %55 = OpConstantNull %int
+ %46 = OpConstantComposite %v3int %int_1 %int_2 %int_3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %49 = OpConstantNull %int
%int_5 = OpConstant %int 5
- %57 = OpConstantComposite %v3int %55 %int_5 %55
+ %51 = OpConstantComposite %v3int %49 %int_5 %49
%tint_mod = OpFunction %v3int None %1
%lhs = OpFunctionParameter %v3int
%rhs = OpFunctionParameter %v3int
%7 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %11
-%tint_return_value = OpVariable %_ptr_Function_v3int Function %14
- %16 = OpIEqual %v3bool %rhs %14
- %20 = OpIEqual %v3bool %lhs %19
- %23 = OpIEqual %v3bool %rhs %22
- %24 = OpLogicalAnd %v3bool %20 %23
- %25 = OpLogicalOr %v3bool %16 %24
- %15 = OpSelect %v3int %25 %27 %rhs
- %32 = OpBitwiseOr %v3int %lhs %15
- %29 = OpBitcast %v3uint %32
- %35 = OpBitwiseAnd %v3uint %29 %34
- %37 = OpINotEqual %v3bool %35 %36
- %28 = OpAny %bool %37
- OpSelectionMerge %38 None
- OpBranchConditional %28 %39 %40
- %39 = OpLabel
- OpStore %tint_return_flag %true
- %42 = OpSDiv %v3int %lhs %15
- %43 = OpIMul %v3int %42 %15
- %44 = OpISub %v3int %lhs %43
- OpStore %tint_return_value %44
- OpBranch %38
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %45 = OpSRem %v3int %lhs %15
- OpStore %tint_return_value %45
- OpBranch %38
- %38 = OpLabel
- %46 = OpLoad %v3int %tint_return_value
- OpReturnValue %46
+ %10 = OpIEqual %v3bool %rhs %9
+ %15 = OpIEqual %v3bool %lhs %14
+ %18 = OpIEqual %v3bool %rhs %17
+ %19 = OpLogicalAnd %v3bool %15 %18
+ %20 = OpLogicalOr %v3bool %10 %19
+ %8 = OpSelect %v3int %20 %22 %rhs
+ %27 = OpBitwiseOr %v3int %lhs %8
+ %24 = OpBitcast %v3uint %27
+ %30 = OpBitwiseAnd %v3uint %24 %29
+ %32 = OpINotEqual %v3bool %30 %31
+ %23 = OpAny %bool %32
+ OpSelectionMerge %33 None
+ OpBranchConditional %23 %34 %35
+ %34 = OpLabel
+ %36 = OpSDiv %v3int %lhs %8
+ %37 = OpIMul %v3int %36 %8
+ %38 = OpISub %v3int %lhs %37
+ OpReturnValue %38
+ %35 = OpLabel
+ %39 = OpSRem %v3int %lhs %8
+ OpReturnValue %39
+ %33 = OpLabel
+ OpReturnValue %9
OpFunctionEnd
- %f = OpFunction %void None %47
- %50 = OpLabel
- %a = OpVariable %_ptr_Function_v3int Function %14
- %b = OpVariable %_ptr_Function_v3int Function %14
- OpStore %a %53
- OpStore %b %57
- %60 = OpLoad %v3int %a
- %61 = OpLoad %v3int %b
- %59 = OpFunctionCall %v3int %tint_mod %60 %61
+ %f = OpFunction %void None %40
+ %43 = OpLabel
+ %a = OpVariable %_ptr_Function_v3int Function %9
+ %b = OpVariable %_ptr_Function_v3int Function %9
+ OpStore %a %46
+ OpStore %b %51
+ %54 = OpLoad %v3int %a
+ %55 = OpLoad %v3int %b
+ %53 = OpFunctionCall %v3int %tint_mod %54 %55
OpReturn
OpFunctionEnd
diff --git a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
index 38e8b07..1b5ca94 100644
--- a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
+++ b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
@@ -16,13 +16,13 @@
{
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
const uint i_1 = idx;
- const str tint_symbol_3 = (str)0;
- S[i_1] = tint_symbol_3;
+ const str tint_symbol_2 = (str)0;
+ S[i_1] = tint_symbol_2;
}
}
GroupMemoryBarrierWithGroupSync();
- const uint tint_symbol_2[1] = {2u};
- const str r = func_S_X(tint_symbol_2);
+ const uint tint_symbol_3[1] = {2u};
+ const str r = func_S_X(tint_symbol_3);
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
index 38e8b07..1b5ca94 100644
--- a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
+++ b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
@@ -16,13 +16,13 @@
{
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
const uint i_1 = idx;
- const str tint_symbol_3 = (str)0;
- S[i_1] = tint_symbol_3;
+ const str tint_symbol_2 = (str)0;
+ S[i_1] = tint_symbol_2;
}
}
GroupMemoryBarrierWithGroupSync();
- const uint tint_symbol_2[1] = {2u};
- const str r = func_S_X(tint_symbol_2);
+ const uint tint_symbol_3[1] = {2u};
+ const str r = func_S_X(tint_symbol_3);
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
index 36be9e2..592ab89 100644
--- a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
+++ b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.dxc.hlsl
@@ -5,8 +5,8 @@
groupshared str S[4];
void func_S_X(uint pointer[1]) {
- const str tint_symbol_2 = (str)0;
- S[pointer[0]] = tint_symbol_2;
+ const str tint_symbol_4 = (str)0;
+ S[pointer[0]] = tint_symbol_4;
}
struct tint_symbol_1 {
@@ -17,8 +17,8 @@
{
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
const uint i_1 = idx;
- const str tint_symbol_4 = (str)0;
- S[i_1] = tint_symbol_4;
+ const str tint_symbol_2 = (str)0;
+ S[i_1] = tint_symbol_2;
}
}
GroupMemoryBarrierWithGroupSync();
diff --git a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
index 36be9e2..592ab89 100644
--- a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
+++ b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.fxc.hlsl
@@ -5,8 +5,8 @@
groupshared str S[4];
void func_S_X(uint pointer[1]) {
- const str tint_symbol_2 = (str)0;
- S[pointer[0]] = tint_symbol_2;
+ const str tint_symbol_4 = (str)0;
+ S[pointer[0]] = tint_symbol_4;
}
struct tint_symbol_1 {
@@ -17,8 +17,8 @@
{
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
const uint i_1 = idx;
- const str tint_symbol_4 = (str)0;
- S[i_1] = tint_symbol_4;
+ const str tint_symbol_2 = (str)0;
+ S[i_1] = tint_symbol_2;
}
}
GroupMemoryBarrierWithGroupSync();
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 7520035..bc419c0 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
@@ -19,15 +19,15 @@
};
void func(threadgroup str* const pointer) {
- str const tint_symbol_1 = str{};
- *(pointer) = tint_symbol_1;
+ str const tint_symbol_2 = str{};
+ *(pointer) = tint_symbol_2;
}
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array<str, 4>* const tint_symbol_3) {
for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) {
uint const i_1 = idx;
- str const tint_symbol_2 = str{};
- (*(tint_symbol_3))[i_1] = tint_symbol_2;
+ str const tint_symbol_1 = str{};
+ (*(tint_symbol_3))[i_1] = tint_symbol_1;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
func(&((*(tint_symbol_3))[2]));
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
index b276950..b3bb46b 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.dxc.hlsl
@@ -10,25 +10,25 @@
return bool(f);
}
-struct tint_symbol_1 {
+struct tint_symbol_6 {
uint VertexIndex : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_7 {
float4 value : SV_Position;
};
float4 main_inner(uint VertexIndex) {
- const float4 tint_symbol_3 = (0.0f).xxxx;
- const float4 tint_symbol_4 = (1.0f).xxxx;
- const int tint_symbol_5 = vec4f();
- const float tint_symbol_6 = vec2f(tint_symbol_5);
- const bool tint_symbol_7 = vec2i(tint_symbol_6);
- return (tint_symbol_7 ? tint_symbol_4 : tint_symbol_3);
+ const float4 tint_symbol = (0.0f).xxxx;
+ const float4 tint_symbol_1 = (1.0f).xxxx;
+ const int tint_symbol_2 = vec4f();
+ const float tint_symbol_3 = vec2f(tint_symbol_2);
+ const bool tint_symbol_4 = vec2i(tint_symbol_3);
+ return (tint_symbol_4 ? tint_symbol_1 : tint_symbol);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- const float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_7 main(tint_symbol_6 tint_symbol_5) {
+ const float4 inner_result = main_inner(tint_symbol_5.VertexIndex);
+ tint_symbol_7 wrapper_result = (tint_symbol_7)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
index b276950..b3bb46b 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.fxc.hlsl
@@ -10,25 +10,25 @@
return bool(f);
}
-struct tint_symbol_1 {
+struct tint_symbol_6 {
uint VertexIndex : SV_VertexID;
};
-struct tint_symbol_2 {
+struct tint_symbol_7 {
float4 value : SV_Position;
};
float4 main_inner(uint VertexIndex) {
- const float4 tint_symbol_3 = (0.0f).xxxx;
- const float4 tint_symbol_4 = (1.0f).xxxx;
- const int tint_symbol_5 = vec4f();
- const float tint_symbol_6 = vec2f(tint_symbol_5);
- const bool tint_symbol_7 = vec2i(tint_symbol_6);
- return (tint_symbol_7 ? tint_symbol_4 : tint_symbol_3);
+ const float4 tint_symbol = (0.0f).xxxx;
+ const float4 tint_symbol_1 = (1.0f).xxxx;
+ const int tint_symbol_2 = vec4f();
+ const float tint_symbol_3 = vec2f(tint_symbol_2);
+ const bool tint_symbol_4 = vec2i(tint_symbol_3);
+ return (tint_symbol_4 ? tint_symbol_1 : tint_symbol);
}
-tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- const float4 inner_result = main_inner(tint_symbol.VertexIndex);
- tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+tint_symbol_7 main(tint_symbol_6 tint_symbol_5) {
+ const float4 inner_result = main_inner(tint_symbol_5.VertexIndex);
+ tint_symbol_7 wrapper_result = (tint_symbol_7)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
index 69aef23..00ff172 100644
--- a/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
+++ b/test/tint/shadowing/short_names/renamer/function.wgsl.expected.msl
@@ -13,22 +13,22 @@
return bool(f);
}
-struct tint_symbol_1 {
+struct tint_symbol_6 {
float4 value [[position]];
};
float4 tint_symbol_inner(uint VertexIndex) {
- float4 const tint_symbol_2 = float4(0.0f);
- float4 const tint_symbol_3 = float4(1.0f);
- int const tint_symbol_4 = vec4f();
- float const tint_symbol_5 = vec2f(tint_symbol_4);
- bool const tint_symbol_6 = vec2i(tint_symbol_5);
- return select(tint_symbol_2, tint_symbol_3, tint_symbol_6);
+ float4 const tint_symbol_1 = float4(0.0f);
+ float4 const tint_symbol_2 = float4(1.0f);
+ int const tint_symbol_3 = vec4f();
+ float const tint_symbol_4 = vec2f(tint_symbol_3);
+ bool const tint_symbol_5 = vec2i(tint_symbol_4);
+ return select(tint_symbol_1, tint_symbol_2, tint_symbol_5);
}
-vertex tint_symbol_1 tint_symbol(uint VertexIndex [[vertex_id]]) {
+vertex tint_symbol_6 tint_symbol(uint VertexIndex [[vertex_id]]) {
float4 const inner_result = tint_symbol_inner(VertexIndex);
- tint_symbol_1 wrapper_result = {};
+ tint_symbol_6 wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
diff --git a/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.spvasm b/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.spvasm
index 6764152..c7ab06b 100644
--- a/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 83
+; Bound: 76
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,8 +16,6 @@
OpName %tint_mod "tint_mod"
OpName %lhs_0 "lhs"
OpName %rhs_0 "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %foo "foo"
OpName %maybe_zero "maybe_zero"
%int = OpTypeInt 32 1
@@ -35,14 +33,10 @@
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
-%_ptr_Function_bool = OpTypePointer Function %bool
- %35 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %50 = OpConstantNull %uint
- %true = OpConstantTrue %bool
- %61 = OpTypeFunction %void %int
+ %45 = OpConstantNull %uint
+ %54 = OpTypeFunction %void %int
%unused_entry_point = OpFunction %void None %9
%12 = OpLabel
OpReturn
@@ -64,64 +58,57 @@
%lhs_0 = OpFunctionParameter %int
%rhs_0 = OpFunctionParameter %int
%32 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %35
-%tint_return_value = OpVariable %_ptr_Function_int Function %4
- %39 = OpIEqual %bool %rhs_0 %4
- %40 = OpIEqual %bool %lhs_0 %int_n2147483648
- %41 = OpIEqual %bool %rhs_0 %int_n1
- %42 = OpLogicalAnd %bool %40 %41
- %43 = OpLogicalOr %bool %39 %42
- %38 = OpSelect %int %43 %int_1 %rhs_0
- %47 = OpBitwiseOr %int %lhs_0 %38
- %45 = OpBitcast %uint %47
- %49 = OpBitwiseAnd %uint %45 %uint_2147483648
- %51 = OpINotEqual %bool %49 %50
- OpSelectionMerge %52 None
- OpBranchConditional %51 %53 %54
- %53 = OpLabel
- OpStore %tint_return_flag %true
- %56 = OpSDiv %int %lhs_0 %38
- %57 = OpIMul %int %56 %38
- %58 = OpISub %int %lhs_0 %57
- OpStore %tint_return_value %58
- OpBranch %52
- %54 = OpLabel
- OpStore %tint_return_flag %true
- %59 = OpSRem %int %lhs_0 %38
- OpStore %tint_return_value %59
- OpBranch %52
- %52 = OpLabel
- %60 = OpLoad %int %tint_return_value
- OpReturnValue %60
+ %34 = OpIEqual %bool %rhs_0 %4
+ %35 = OpIEqual %bool %lhs_0 %int_n2147483648
+ %36 = OpIEqual %bool %rhs_0 %int_n1
+ %37 = OpLogicalAnd %bool %35 %36
+ %38 = OpLogicalOr %bool %34 %37
+ %33 = OpSelect %int %38 %int_1 %rhs_0
+ %42 = OpBitwiseOr %int %lhs_0 %33
+ %40 = OpBitcast %uint %42
+ %44 = OpBitwiseAnd %uint %40 %uint_2147483648
+ %46 = OpINotEqual %bool %44 %45
+ OpSelectionMerge %47 None
+ OpBranchConditional %46 %48 %49
+ %48 = OpLabel
+ %50 = OpSDiv %int %lhs_0 %33
+ %51 = OpIMul %int %50 %33
+ %52 = OpISub %int %lhs_0 %51
+ OpReturnValue %52
+ %49 = OpLabel
+ %53 = OpSRem %int %lhs_0 %33
+ OpReturnValue %53
+ %47 = OpLabel
+ OpReturnValue %4
OpFunctionEnd
- %foo = OpFunction %void None %61
+ %foo = OpFunction %void None %54
%maybe_zero = OpFunctionParameter %int
- %64 = OpLabel
- %66 = OpLoad %int %a
- %65 = OpFunctionCall %int %tint_div %66 %4
- OpStore %a %65
- %68 = OpLoad %int %a
- %67 = OpFunctionCall %int %tint_mod %68 %4
- OpStore %a %67
- %70 = OpLoad %int %a
- %69 = OpFunctionCall %int %tint_div %70 %maybe_zero
- OpStore %a %69
- %72 = OpLoad %int %a
- %71 = OpFunctionCall %int %tint_mod %72 %maybe_zero
- OpStore %a %71
+ %57 = OpLabel
+ %59 = OpLoad %int %a
+ %58 = OpFunctionCall %int %tint_div %59 %4
+ OpStore %a %58
+ %61 = OpLoad %int %a
+ %60 = OpFunctionCall %int %tint_mod %61 %4
+ OpStore %a %60
+ %63 = OpLoad %int %a
+ %62 = OpFunctionCall %int %tint_div %63 %maybe_zero
+ OpStore %a %62
+ %65 = OpLoad %int %a
+ %64 = OpFunctionCall %int %tint_mod %65 %maybe_zero
+ OpStore %a %64
+ %66 = OpLoad %float %b
+ %67 = OpFDiv %float %66 %8
+ OpStore %b %67
+ %68 = OpLoad %float %b
+ %69 = OpFRem %float %68 %8
+ OpStore %b %69
+ %70 = OpLoad %float %b
+ %71 = OpConvertSToF %float %maybe_zero
+ %72 = OpFDiv %float %70 %71
+ OpStore %b %72
%73 = OpLoad %float %b
- %74 = OpFDiv %float %73 %8
- OpStore %b %74
- %75 = OpLoad %float %b
- %76 = OpFRem %float %75 %8
- OpStore %b %76
- %77 = OpLoad %float %b
- %78 = OpConvertSToF %float %maybe_zero
- %79 = OpFDiv %float %77 %78
- OpStore %b %79
- %80 = OpLoad %float %b
- %81 = OpConvertSToF %float %maybe_zero
- %82 = OpFRem %float %80 %81
- OpStore %b %82
+ %74 = OpConvertSToF %float %maybe_zero
+ %75 = OpFRem %float %73 %74
+ OpStore %b %75
OpReturn
OpFunctionEnd
diff --git a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.dxc.hlsl
index 9616780..503f0e7 100644
--- a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.dxc.hlsl
+++ b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.dxc.hlsl
@@ -10,6 +10,5 @@
}
void foo() {
- const int tint_symbol = tint_div(asint(v.Load(0u)), 2);
- v.Store(0u, asuint(tint_symbol));
+ v.Store(0u, asuint(tint_div(asint(v.Load(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.fxc.hlsl
index 9616780..503f0e7 100644
--- a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.fxc.hlsl
+++ b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.fxc.hlsl
@@ -10,6 +10,5 @@
}
void foo() {
- const int tint_symbol = tint_div(asint(v.Load(0u)), 2);
- v.Store(0u, asuint(tint_symbol));
+ v.Store(0u, asuint(tint_div(asint(v.Load(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.glsl b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.glsl
index 822f89b..81ef9d0 100644
--- a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.glsl
+++ b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.glsl
@@ -17,7 +17,6 @@
}
void foo() {
- int tint_symbol = tint_div(v.inner.a, 2);
- v.inner.a = tint_symbol;
+ v.inner.a = tint_div(v.inner.a, 2);
}
diff --git a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.msl b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.msl
index c839ac0..03a9f2c 100644
--- a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.msl
@@ -9,8 +9,7 @@
return (lhs / select(rhs, 1, bool((rhs == 0) | bool((lhs == (-2147483647 - 1)) & (rhs == -1)))));
}
-void foo(device S* const tint_symbol_1) {
- int const tint_symbol = tint_div((*(tint_symbol_1)).a, 2);
- (*(tint_symbol_1)).a = tint_symbol;
+void foo(device S* const tint_symbol) {
+ (*(tint_symbol)).a = tint_div((*(tint_symbol)).a, 2);
}
diff --git a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.spvasm b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.spvasm
index e1c28b2..00b456a 100644
--- a/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/scalar/divide.wgsl.expected.spvasm
@@ -58,10 +58,10 @@
OpFunctionEnd
%foo = OpFunction %void None %6
%28 = OpLabel
- %33 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
- %34 = OpLoad %int %33
- %29 = OpFunctionCall %int %tint_div %34 %int_2
- %36 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
- OpStore %36 %29
+ %32 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
+ %34 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
+ %35 = OpLoad %int %34
+ %33 = OpFunctionCall %int %tint_div %35 %int_2
+ OpStore %32 %33
OpReturn
OpFunctionEnd
diff --git a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.dxc.hlsl
index 40a0419..a51a03f 100644
--- a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.dxc.hlsl
+++ b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.dxc.hlsl
@@ -15,6 +15,5 @@
}
void foo() {
- const int tint_symbol = tint_mod(asint(v.Load(0u)), 2);
- v.Store(0u, asuint(tint_symbol));
+ v.Store(0u, asuint(tint_mod(asint(v.Load(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.fxc.hlsl
index 40a0419..a51a03f 100644
--- a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.fxc.hlsl
+++ b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.fxc.hlsl
@@ -15,6 +15,5 @@
}
void foo() {
- const int tint_symbol = tint_mod(asint(v.Load(0u)), 2);
- v.Store(0u, asuint(tint_symbol));
+ v.Store(0u, asuint(tint_mod(asint(v.Load(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.glsl b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.glsl
index 1b27070..1ebe67e 100644
--- a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.glsl
+++ b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.glsl
@@ -22,7 +22,6 @@
}
void foo() {
- int tint_symbol = tint_mod(v.inner.a, 2);
- v.inner.a = tint_symbol;
+ v.inner.a = tint_mod(v.inner.a, 2);
}
diff --git a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.msl b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.msl
index 42772ee..1241632 100644
--- a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.msl
@@ -14,8 +14,7 @@
}
}
-void foo(device S* const tint_symbol_1) {
- int const tint_symbol = tint_mod((*(tint_symbol_1)).a, 2);
- (*(tint_symbol_1)).a = tint_symbol;
+void foo(device S* const tint_symbol) {
+ (*(tint_symbol)).a = tint_mod((*(tint_symbol)).a, 2);
}
diff --git a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.spvasm b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.spvasm
index 5df8f97..3bbb8ba 100644
--- a/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/scalar/modulo.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,8 +16,6 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %foo "foo"
OpDecorate %v_block Block
OpMemberDecorate %v_block 0 Offset 0
@@ -32,18 +30,14 @@
%void = OpTypeVoid
%6 = OpTypeFunction %void
%10 = OpTypeFunction %int %int %int
+ %16 = OpConstantNull %int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %18 = OpConstantNull %bool
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
- %37 = OpConstantNull %uint
- %true = OpConstantTrue %bool
+ %32 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_2 = OpConstant %int 2
@@ -55,42 +49,35 @@
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%14 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %18
-%tint_return_value = OpVariable %_ptr_Function_int Function %21
- %23 = OpIEqual %bool %rhs %21
- %25 = OpIEqual %bool %lhs %int_n2147483648
- %27 = OpIEqual %bool %rhs %int_n1
- %28 = OpLogicalAnd %bool %25 %27
- %29 = OpLogicalOr %bool %23 %28
- %22 = OpSelect %int %29 %int_1 %rhs
- %34 = OpBitwiseOr %int %lhs %22
- %32 = OpBitcast %uint %34
- %36 = OpBitwiseAnd %uint %32 %uint_2147483648
- %38 = OpINotEqual %bool %36 %37
- OpSelectionMerge %39 None
- OpBranchConditional %38 %40 %41
- %40 = OpLabel
- OpStore %tint_return_flag %true
- %43 = OpSDiv %int %lhs %22
- %44 = OpIMul %int %43 %22
- %45 = OpISub %int %lhs %44
- OpStore %tint_return_value %45
- OpBranch %39
- %41 = OpLabel
- OpStore %tint_return_flag %true
- %46 = OpSRem %int %lhs %22
- OpStore %tint_return_value %46
- OpBranch %39
- %39 = OpLabel
- %47 = OpLoad %int %tint_return_value
- OpReturnValue %47
+ %17 = OpIEqual %bool %rhs %16
+ %20 = OpIEqual %bool %lhs %int_n2147483648
+ %22 = OpIEqual %bool %rhs %int_n1
+ %23 = OpLogicalAnd %bool %20 %22
+ %24 = OpLogicalOr %bool %17 %23
+ %15 = OpSelect %int %24 %int_1 %rhs
+ %29 = OpBitwiseOr %int %lhs %15
+ %27 = OpBitcast %uint %29
+ %31 = OpBitwiseAnd %uint %27 %uint_2147483648
+ %33 = OpINotEqual %bool %31 %32
+ OpSelectionMerge %34 None
+ OpBranchConditional %33 %35 %36
+ %35 = OpLabel
+ %37 = OpSDiv %int %lhs %15
+ %38 = OpIMul %int %37 %15
+ %39 = OpISub %int %lhs %38
+ OpReturnValue %39
+ %36 = OpLabel
+ %40 = OpSRem %int %lhs %15
+ OpReturnValue %40
+ %34 = OpLabel
+ OpReturnValue %16
OpFunctionEnd
%foo = OpFunction %void None %6
- %49 = OpLabel
- %53 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
- %54 = OpLoad %int %53
- %50 = OpFunctionCall %int %tint_mod %54 %int_2
- %56 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
- OpStore %56 %50
+ %42 = OpLabel
+ %45 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
+ %47 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
+ %48 = OpLoad %int %47
+ %46 = OpFunctionCall %int %tint_mod %48 %int_2
+ OpStore %45 %46
OpReturn
OpFunctionEnd
diff --git a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.dxc.hlsl
index c2ffedc..1c1e04c 100644
--- a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.dxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.dxc.hlsl
@@ -10,6 +10,5 @@
}
void foo() {
- const int4 tint_symbol = tint_div(asint(v.Load4(0u)), (2).xxxx);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_div(asint(v.Load4(0u)), (2).xxxx)));
}
diff --git a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.fxc.hlsl
index c2ffedc..1c1e04c 100644
--- a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.fxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.fxc.hlsl
@@ -10,6 +10,5 @@
}
void foo() {
- const int4 tint_symbol = tint_div(asint(v.Load4(0u)), (2).xxxx);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_div(asint(v.Load4(0u)), (2).xxxx)));
}
diff --git a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.glsl b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.glsl
index daea9b2..1c33d31 100644
--- a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.glsl
+++ b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.glsl
@@ -17,7 +17,6 @@
}
void foo() {
- ivec4 tint_symbol = tint_div(v.inner.a, ivec4(2));
- v.inner.a = tint_symbol;
+ v.inner.a = tint_div(v.inner.a, ivec4(2));
}
diff --git a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.msl b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.msl
index f0dd095..db0e4ff 100644
--- a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.msl
@@ -9,8 +9,7 @@
return (lhs / select(rhs, int4(1), ((rhs == int4(0)) | ((lhs == int4((-2147483647 - 1))) & (rhs == int4(-1))))));
}
-void foo(device S* const tint_symbol_1) {
- int4 const tint_symbol = tint_div((*(tint_symbol_1)).a, int4(2));
- (*(tint_symbol_1)).a = tint_symbol;
+void foo(device S* const tint_symbol) {
+ (*(tint_symbol)).a = tint_div((*(tint_symbol)).a, int4(2));
}
diff --git a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.spvasm b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.spvasm
index cfca72a..f4ac117 100644
--- a/test/tint/statements/compound_assign/vector/divide.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/vector/divide.wgsl.expected.spvasm
@@ -44,7 +44,7 @@
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
%int_2 = OpConstant %int 2
- %41 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
+ %42 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%unused_entry_point = OpFunction %void None %7
%10 = OpLabel
OpReturn
@@ -64,10 +64,10 @@
OpFunctionEnd
%foo = OpFunction %void None %7
%33 = OpLabel
- %38 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- %39 = OpLoad %v4int %38
- %34 = OpFunctionCall %v4int %tint_div %39 %41
- %42 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- OpStore %42 %34
+ %37 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %39 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %40 = OpLoad %v4int %39
+ %38 = OpFunctionCall %v4int %tint_div %40 %42
+ OpStore %37 %38
OpReturn
OpFunctionEnd
diff --git a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.dxc.hlsl
index ea80753..fd35f96 100644
--- a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.dxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.dxc.hlsl
@@ -16,6 +16,5 @@
}
void foo() {
- const int4 tint_symbol = tint_mod(asint(v.Load4(0u)), 2);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_mod(asint(v.Load4(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.fxc.hlsl
index ea80753..fd35f96 100644
--- a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.fxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.fxc.hlsl
@@ -16,6 +16,5 @@
}
void foo() {
- const int4 tint_symbol = tint_mod(asint(v.Load4(0u)), 2);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_mod(asint(v.Load4(0u)), 2)));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.glsl b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.glsl
index b650cfb..da6ab72 100644
--- a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.glsl
+++ b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.glsl
@@ -23,7 +23,6 @@
}
void foo() {
- ivec4 tint_symbol = tint_mod(v.inner.a, 2);
- v.inner.a = tint_symbol;
+ v.inner.a = tint_mod(v.inner.a, 2);
}
diff --git a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.msl b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.msl
index e0a82eb..afe37d6 100644
--- a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.msl
@@ -15,8 +15,7 @@
}
}
-void foo(device S* const tint_symbol_1) {
- int4 const tint_symbol = tint_mod((*(tint_symbol_1)).a, 2);
- (*(tint_symbol_1)).a = tint_symbol;
+void foo(device S* const tint_symbol) {
+ (*(tint_symbol)).a = tint_mod((*(tint_symbol)).a, 2);
}
diff --git a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.spvasm b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.spvasm
index 52b59dd..c3a7acd 100644
--- a/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/vector/modulo-scalar.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 58
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,8 +16,6 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %foo "foo"
OpDecorate %v_block Block
OpMemberDecorate %v_block 0 Offset 0
@@ -33,24 +31,20 @@
%void = OpTypeVoid
%7 = OpTypeFunction %void
%11 = OpTypeFunction %v4int %v4int %int
+ %18 = OpConstantNull %v4int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %19 = OpConstantNull %bool
-%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
%v4bool = OpTypeVector %bool 4
%int_n2147483648 = OpConstant %int -2147483648
- %28 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %23 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %31 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
+ %26 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %36 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+ %31 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%uint_2147483648 = OpConstant %uint 2147483648
- %43 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
- %45 = OpConstantNull %v4uint
- %true = OpConstantTrue %bool
+ %38 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %40 = OpConstantNull %v4uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
%int_2 = OpConstant %int 2
@@ -62,44 +56,37 @@
%lhs = OpFunctionParameter %v4int
%rhs = OpFunctionParameter %int
%15 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %19
-%tint_return_value = OpVariable %_ptr_Function_v4int Function %22
- %23 = OpCompositeConstruct %v4int %rhs %rhs %rhs %rhs
- %25 = OpIEqual %v4bool %23 %22
- %29 = OpIEqual %v4bool %lhs %28
- %32 = OpIEqual %v4bool %23 %31
- %33 = OpLogicalAnd %v4bool %29 %32
- %34 = OpLogicalOr %v4bool %25 %33
- %24 = OpSelect %v4int %34 %36 %23
- %41 = OpBitwiseOr %v4int %lhs %24
- %38 = OpBitcast %v4uint %41
- %44 = OpBitwiseAnd %v4uint %38 %43
- %46 = OpINotEqual %v4bool %44 %45
- %37 = OpAny %bool %46
- OpSelectionMerge %47 None
- OpBranchConditional %37 %48 %49
- %48 = OpLabel
- OpStore %tint_return_flag %true
- %51 = OpSDiv %v4int %lhs %24
- %52 = OpIMul %v4int %51 %24
- %53 = OpISub %v4int %lhs %52
- OpStore %tint_return_value %53
- OpBranch %47
- %49 = OpLabel
- OpStore %tint_return_flag %true
- %54 = OpSRem %v4int %lhs %24
- OpStore %tint_return_value %54
- OpBranch %47
- %47 = OpLabel
- %55 = OpLoad %v4int %tint_return_value
- OpReturnValue %55
+ %16 = OpCompositeConstruct %v4int %rhs %rhs %rhs %rhs
+ %19 = OpIEqual %v4bool %16 %18
+ %24 = OpIEqual %v4bool %lhs %23
+ %27 = OpIEqual %v4bool %16 %26
+ %28 = OpLogicalAnd %v4bool %24 %27
+ %29 = OpLogicalOr %v4bool %19 %28
+ %17 = OpSelect %v4int %29 %31 %16
+ %36 = OpBitwiseOr %v4int %lhs %17
+ %33 = OpBitcast %v4uint %36
+ %39 = OpBitwiseAnd %v4uint %33 %38
+ %41 = OpINotEqual %v4bool %39 %40
+ %32 = OpAny %bool %41
+ OpSelectionMerge %42 None
+ OpBranchConditional %32 %43 %44
+ %43 = OpLabel
+ %45 = OpSDiv %v4int %lhs %17
+ %46 = OpIMul %v4int %45 %17
+ %47 = OpISub %v4int %lhs %46
+ OpReturnValue %47
+ %44 = OpLabel
+ %48 = OpSRem %v4int %lhs %17
+ OpReturnValue %48
+ %42 = OpLabel
+ OpReturnValue %18
OpFunctionEnd
%foo = OpFunction %void None %7
- %57 = OpLabel
- %61 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- %62 = OpLoad %v4int %61
- %58 = OpFunctionCall %v4int %tint_mod %62 %int_2
- %64 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- OpStore %64 %58
+ %50 = OpLabel
+ %53 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %55 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %56 = OpLoad %v4int %55
+ %54 = OpFunctionCall %v4int %tint_mod %56 %int_2
+ OpStore %53 %54
OpReturn
OpFunctionEnd
diff --git a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.dxc.hlsl
index 051500d..4d6414d 100644
--- a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.dxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.dxc.hlsl
@@ -15,6 +15,5 @@
}
void foo() {
- const int4 tint_symbol = tint_mod(asint(v.Load4(0u)), (2).xxxx);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_mod(asint(v.Load4(0u)), (2).xxxx)));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.fxc.hlsl
index 051500d..4d6414d 100644
--- a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.fxc.hlsl
+++ b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.fxc.hlsl
@@ -15,6 +15,5 @@
}
void foo() {
- const int4 tint_symbol = tint_mod(asint(v.Load4(0u)), (2).xxxx);
- v.Store4(0u, asuint(tint_symbol));
+ v.Store4(0u, asuint(tint_mod(asint(v.Load4(0u)), (2).xxxx)));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.glsl b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.glsl
index b7ed4cc..a4bd3e6 100644
--- a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.glsl
+++ b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.glsl
@@ -22,7 +22,6 @@
}
void foo() {
- ivec4 tint_symbol = tint_mod(v.inner.a, ivec4(2));
- v.inner.a = tint_symbol;
+ v.inner.a = tint_mod(v.inner.a, ivec4(2));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.msl b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.msl
index fc61333..16b6968 100644
--- a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.msl
+++ b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.msl
@@ -14,8 +14,7 @@
}
}
-void foo(device S* const tint_symbol_1) {
- int4 const tint_symbol = tint_mod((*(tint_symbol_1)).a, int4(2));
- (*(tint_symbol_1)).a = tint_symbol;
+void foo(device S* const tint_symbol) {
+ (*(tint_symbol)).a = tint_mod((*(tint_symbol)).a, int4(2));
}
diff --git a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.spvasm b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.spvasm
index 3ac6525..180eebd 100644
--- a/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.spvasm
+++ b/test/tint/statements/compound_assign/vector/modulo.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 58
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,8 +16,6 @@
OpName %tint_mod "tint_mod"
OpName %lhs "lhs"
OpName %rhs "rhs"
- OpName %tint_return_flag "tint_return_flag"
- OpName %tint_return_value "tint_return_value"
OpName %foo "foo"
OpDecorate %v_block Block
OpMemberDecorate %v_block 0 Offset 0
@@ -33,28 +31,24 @@
%void = OpTypeVoid
%7 = OpTypeFunction %void
%11 = OpTypeFunction %v4int %v4int %v4int
+ %17 = OpConstantNull %v4int
%bool = OpTypeBool
-%_ptr_Function_bool = OpTypePointer Function %bool
- %19 = OpConstantNull %bool
-%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
%v4bool = OpTypeVector %bool 4
%int_n2147483648 = OpConstant %int -2147483648
- %27 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
+ %22 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
%int_n1 = OpConstant %int -1
- %30 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
+ %25 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
%int_1 = OpConstant %int 1
- %35 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+ %30 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%uint_2147483648 = OpConstant %uint 2147483648
- %42 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
- %44 = OpConstantNull %v4uint
- %true = OpConstantTrue %bool
+ %37 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
+ %39 = OpConstantNull %v4uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
%int_2 = OpConstant %int 2
- %63 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
+ %57 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%unused_entry_point = OpFunction %void None %7
%10 = OpLabel
OpReturn
@@ -63,43 +57,36 @@
%lhs = OpFunctionParameter %v4int
%rhs = OpFunctionParameter %v4int
%15 = OpLabel
-%tint_return_flag = OpVariable %_ptr_Function_bool Function %19
-%tint_return_value = OpVariable %_ptr_Function_v4int Function %22
- %24 = OpIEqual %v4bool %rhs %22
- %28 = OpIEqual %v4bool %lhs %27
- %31 = OpIEqual %v4bool %rhs %30
- %32 = OpLogicalAnd %v4bool %28 %31
- %33 = OpLogicalOr %v4bool %24 %32
- %23 = OpSelect %v4int %33 %35 %rhs
- %40 = OpBitwiseOr %v4int %lhs %23
- %37 = OpBitcast %v4uint %40
- %43 = OpBitwiseAnd %v4uint %37 %42
- %45 = OpINotEqual %v4bool %43 %44
- %36 = OpAny %bool %45
- OpSelectionMerge %46 None
- OpBranchConditional %36 %47 %48
- %47 = OpLabel
- OpStore %tint_return_flag %true
- %50 = OpSDiv %v4int %lhs %23
- %51 = OpIMul %v4int %50 %23
- %52 = OpISub %v4int %lhs %51
- OpStore %tint_return_value %52
- OpBranch %46
- %48 = OpLabel
- OpStore %tint_return_flag %true
- %53 = OpSRem %v4int %lhs %23
- OpStore %tint_return_value %53
- OpBranch %46
- %46 = OpLabel
- %54 = OpLoad %v4int %tint_return_value
- OpReturnValue %54
+ %18 = OpIEqual %v4bool %rhs %17
+ %23 = OpIEqual %v4bool %lhs %22
+ %26 = OpIEqual %v4bool %rhs %25
+ %27 = OpLogicalAnd %v4bool %23 %26
+ %28 = OpLogicalOr %v4bool %18 %27
+ %16 = OpSelect %v4int %28 %30 %rhs
+ %35 = OpBitwiseOr %v4int %lhs %16
+ %32 = OpBitcast %v4uint %35
+ %38 = OpBitwiseAnd %v4uint %32 %37
+ %40 = OpINotEqual %v4bool %38 %39
+ %31 = OpAny %bool %40
+ OpSelectionMerge %41 None
+ OpBranchConditional %31 %42 %43
+ %42 = OpLabel
+ %44 = OpSDiv %v4int %lhs %16
+ %45 = OpIMul %v4int %44 %16
+ %46 = OpISub %v4int %lhs %45
+ OpReturnValue %46
+ %43 = OpLabel
+ %47 = OpSRem %v4int %lhs %16
+ OpReturnValue %47
+ %41 = OpLabel
+ OpReturnValue %17
OpFunctionEnd
%foo = OpFunction %void None %7
- %56 = OpLabel
- %60 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- %61 = OpLoad %v4int %60
- %57 = OpFunctionCall %v4int %tint_mod %61 %63
- %64 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
- OpStore %64 %57
+ %49 = OpLabel
+ %52 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %54 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
+ %55 = OpLoad %v4int %54
+ %53 = OpFunctionCall %v4int %tint_mod %55 %57
+ OpStore %52 %53
OpReturn
OpFunctionEnd
diff --git a/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
index f2bb297..b01d061 100644
--- a/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
@@ -1,42 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 10
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint GLCompute %main "main" %local_invocation_index_1
+ OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
- OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %v "v"
- OpName %main_inner "main_inner"
- OpName %local_invocation_index "local_invocation_index"
OpName %main "main"
- OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
- %uint = OpTypeInt 32 0
-%_ptr_Input_uint = OpTypePointer Input %uint
-%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%mat2v3float = OpTypeMatrix %v3float 2
%_ptr_Workgroup_mat2v3float = OpTypePointer Workgroup %mat2v3float
%v = OpVariable %_ptr_Workgroup_mat2v3float Workgroup
%void = OpTypeVoid
- %9 = OpTypeFunction %void %uint
- %14 = OpConstantNull %mat2v3float
- %uint_2 = OpConstant %uint 2
- %uint_264 = OpConstant %uint 264
- %18 = OpTypeFunction %void
- %main_inner = OpFunction %void None %9
-%local_invocation_index = OpFunctionParameter %uint
- %13 = OpLabel
- OpStore %v %14
- OpControlBarrier %uint_2 %uint_2 %uint_264
- OpReturn
- OpFunctionEnd
- %main = OpFunction %void None %18
- %20 = OpLabel
- %22 = OpLoad %uint %local_invocation_index_1
- %21 = OpFunctionCall %void %main_inner %22
+ %6 = OpTypeFunction %void
+ %main = OpFunction %void None %6
+ %9 = OpLabel
OpReturn
OpFunctionEnd
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl b/test/tint/var/initialization/workgroup/scalar.wgsl
index f99bf74..cf9a851 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl
@@ -2,5 +2,5 @@
@compute @workgroup_size(1)
fn main() {
- _ = v;
+ let i = v;
}
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.dxc.hlsl b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.dxc.hlsl
index 43e8f60..d9bc441 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.dxc.hlsl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.dxc.hlsl
@@ -9,6 +9,7 @@
v = 0;
}
GroupMemoryBarrierWithGroupSync();
+ const int i = v;
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.fxc.hlsl b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.fxc.hlsl
index 43e8f60..d9bc441 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.fxc.hlsl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.fxc.hlsl
@@ -9,6 +9,7 @@
v = 0;
}
GroupMemoryBarrierWithGroupSync();
+ const int i = v;
}
[numthreads(1, 1, 1)]
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.glsl b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.glsl
index e455a2b..33c7291 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.glsl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.glsl
@@ -6,6 +6,7 @@
v = 0;
}
barrier();
+ int i = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.msl b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.msl
index 3829fc7..ae61ccf 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.msl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.msl
@@ -6,6 +6,7 @@
*(tint_symbol_1) = 0;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
+ int const i = *(tint_symbol_1);
}
kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
index 34298e8..dfb0ec0 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 21
+; Bound: 22
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -24,17 +24,18 @@
%12 = OpConstantNull %int
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
- %16 = OpTypeFunction %void
+ %17 = OpTypeFunction %void
%main_inner = OpFunction %void None %7
%local_invocation_index = OpFunctionParameter %uint
%11 = OpLabel
OpStore %v %12
OpControlBarrier %uint_2 %uint_2 %uint_264
+ %16 = OpLoad %int %v
OpReturn
OpFunctionEnd
- %main = OpFunction %void None %16
- %18 = OpLabel
- %20 = OpLoad %uint %local_invocation_index_1
- %19 = OpFunctionCall %void %main_inner %20
+ %main = OpFunction %void None %17
+ %19 = OpLabel
+ %21 = OpLoad %uint %local_invocation_index_1
+ %20 = OpFunctionCall %void %main_inner %21
OpReturn
OpFunctionEnd
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.wgsl b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.wgsl
index 98978d0..af228f1 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.wgsl
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.wgsl
@@ -2,5 +2,5 @@
@compute @workgroup_size(1)
fn main() {
- _ = v;
+ let i = v;
}
diff --git a/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
index 3c74230..fd31974 100644
--- a/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
@@ -1,47 +1,27 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 10
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint GLCompute %main "main" %local_invocation_index_1
+ OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
- OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %S "S"
OpMemberName %S 0 "a"
OpMemberName %S 1 "b"
OpName %v "v"
- OpName %main_inner "main_inner"
- OpName %local_invocation_index "local_invocation_index"
OpName %main "main"
- OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
- %uint = OpTypeInt 32 0
-%_ptr_Input_uint = OpTypePointer Input %uint
-%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%float = OpTypeFloat 32
%S = OpTypeStruct %int %float
%_ptr_Workgroup_S = OpTypePointer Workgroup %S
%v = OpVariable %_ptr_Workgroup_S Workgroup
%void = OpTypeVoid
- %9 = OpTypeFunction %void %uint
- %14 = OpConstantNull %S
- %uint_2 = OpConstant %uint 2
- %uint_264 = OpConstant %uint 264
- %18 = OpTypeFunction %void
- %main_inner = OpFunction %void None %9
-%local_invocation_index = OpFunctionParameter %uint
- %13 = OpLabel
- OpStore %v %14
- OpControlBarrier %uint_2 %uint_2 %uint_264
- OpReturn
- OpFunctionEnd
- %main = OpFunction %void None %18
- %20 = OpLabel
- %22 = OpLoad %uint %local_invocation_index_1
- %21 = OpFunctionCall %void %main_inner %22
+ %6 = OpTypeFunction %void
+ %main = OpFunction %void None %6
+ %9 = OpLabel
OpReturn
OpFunctionEnd
diff --git a/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
index 4ac8187..7eb221a 100644
--- a/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
@@ -1,41 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 22
+; Bound: 9
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint GLCompute %main "main" %local_invocation_index_1
+ OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
- OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %v "v"
- OpName %main_inner "main_inner"
- OpName %local_invocation_index "local_invocation_index"
OpName %main "main"
- OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
- %uint = OpTypeInt 32 0
-%_ptr_Input_uint = OpTypePointer Input %uint
-%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Workgroup_v3int = OpTypePointer Workgroup %v3int
%v = OpVariable %_ptr_Workgroup_v3int Workgroup
%void = OpTypeVoid
- %8 = OpTypeFunction %void %uint
- %13 = OpConstantNull %v3int
- %uint_2 = OpConstant %uint 2
- %uint_264 = OpConstant %uint 264
- %17 = OpTypeFunction %void
- %main_inner = OpFunction %void None %8
-%local_invocation_index = OpFunctionParameter %uint
- %12 = OpLabel
- OpStore %v %13
- OpControlBarrier %uint_2 %uint_2 %uint_264
- OpReturn
- OpFunctionEnd
- %main = OpFunction %void None %17
- %19 = OpLabel
- %21 = OpLoad %uint %local_invocation_index_1
- %20 = OpFunctionCall %void %main_inner %21
+ %5 = OpTypeFunction %void
+ %main = OpFunction %void None %5
+ %8 = OpLabel
OpReturn
OpFunctionEnd