transform/shader_io: Generate a wrapper function

This is a major reworking of this transform. The old transform code
was getting unwieldy, with part of the complication coming from the
handling of multiple return statements. By generating a wrapper
function instead, we can avoid a lot of this complexity.

The original entry point function is stripped of all shader IO
attributes (as well as `stage` and `workgroup_size`), but the body is
left unmodified. A new entry point wrapper function is introduced
which calls the original function, packing/unpacking the shader inputs
as necessary, and propagates the result to the corresponding shader
outputs.

The new code has been refactored to use a state object with the
different parts of the transform split into separate functions, which
makes it much more manageable.

Fixed: tint:1076
Bug: tint:920
Change-Id: I3490a0ea7a3509a4e198ce730e476516649d8d96
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60521
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-08-04 22:15:28 +00:00
committed by Tint LUCI CQ
parent 3e92e9f8ba
commit a5d73ce965
3866 changed files with 49323 additions and 26508 deletions

View File

@@ -14,8 +14,8 @@ void main_1() {
int x_353_phi = 0;
int x_356_phi = 0;
int x_358_phi = 0;
const BST tint_symbol_2 = {9, -1, -1};
tree[0] = tint_symbol_2;
const BST tint_symbol_1 = {9, -1, -1};
tree[0] = tint_symbol_1;
switch(0u) {
default: {
x_58_phi = 0;
@@ -36,8 +36,8 @@ void main_1() {
const int x_79 = tree[x_78_save].leftIndex;
if ((x_79 == -1)) {
tree[x_78_save].leftIndex = 1;
const BST tint_symbol_3 = {5, -1, -1};
tree[1] = tint_symbol_3;
const BST tint_symbol_2 = {5, -1, -1};
tree[1] = tint_symbol_2;
x_86_phi = true;
break;
} else {
@@ -55,8 +55,8 @@ void main_1() {
const int x_71 = tree[x_70_save].rightIndex;
if ((x_71 == -1)) {
tree[x_70_save].rightIndex = 1;
const BST tint_symbol_4 = {5, -1, -1};
tree[1] = tint_symbol_4;
const BST tint_symbol_3 = {5, -1, -1};
tree[1] = tint_symbol_3;
x_86_phi = true;
break;
} else {
@@ -104,8 +104,8 @@ void main_1() {
const int x_112 = tree[x_111_save].leftIndex;
if ((x_112 == -1)) {
tree[x_111_save].leftIndex = 2;
const BST tint_symbol_5 = {12, -1, -1};
tree[2] = tint_symbol_5;
const BST tint_symbol_4 = {12, -1, -1};
tree[2] = tint_symbol_4;
x_119_phi = true;
break;
} else {
@@ -123,8 +123,8 @@ void main_1() {
const int x_104 = tree[x_103_save].rightIndex;
if ((x_104 == -1)) {
tree[x_103_save].rightIndex = 2;
const BST tint_symbol_6 = {12, -1, -1};
tree[2] = tint_symbol_6;
const BST tint_symbol_5 = {12, -1, -1};
tree[2] = tint_symbol_5;
x_119_phi = true;
break;
} else {
@@ -172,8 +172,8 @@ void main_1() {
const int x_145 = tree[x_144_save].leftIndex;
if ((x_145 == -1)) {
tree[x_144_save].leftIndex = 3;
const BST tint_symbol_7 = {15, -1, -1};
tree[3] = tint_symbol_7;
const BST tint_symbol_6 = {15, -1, -1};
tree[3] = tint_symbol_6;
x_152_phi = true;
break;
} else {
@@ -191,8 +191,8 @@ void main_1() {
const int x_137 = tree[x_136_save].rightIndex;
if ((x_137 == -1)) {
tree[x_136_save].rightIndex = 3;
const BST tint_symbol_8 = {15, -1, -1};
tree[3] = tint_symbol_8;
const BST tint_symbol_7 = {15, -1, -1};
tree[3] = tint_symbol_7;
x_152_phi = true;
break;
} else {
@@ -240,8 +240,8 @@ void main_1() {
const int x_178 = tree[x_177_save].leftIndex;
if ((x_178 == -1)) {
tree[x_177_save].leftIndex = 4;
const BST tint_symbol_9 = {7, -1, -1};
tree[4] = tint_symbol_9;
const BST tint_symbol_8 = {7, -1, -1};
tree[4] = tint_symbol_8;
x_185_phi = true;
break;
} else {
@@ -259,8 +259,8 @@ void main_1() {
const int x_170 = tree[x_169_save].rightIndex;
if ((x_170 == -1)) {
tree[x_169_save].rightIndex = 4;
const BST tint_symbol_10 = {7, -1, -1};
tree[4] = tint_symbol_10;
const BST tint_symbol_9 = {7, -1, -1};
tree[4] = tint_symbol_9;
x_185_phi = true;
break;
} else {
@@ -308,8 +308,8 @@ void main_1() {
const int x_211 = tree[x_210_save].leftIndex;
if ((x_211 == -1)) {
tree[x_210_save].leftIndex = 5;
const BST tint_symbol_11 = {8, -1, -1};
tree[5] = tint_symbol_11;
const BST tint_symbol_10 = {8, -1, -1};
tree[5] = tint_symbol_10;
x_218_phi = true;
break;
} else {
@@ -327,8 +327,8 @@ void main_1() {
const int x_203 = tree[x_202_save].rightIndex;
if ((x_203 == -1)) {
tree[x_202_save].rightIndex = 5;
const BST tint_symbol_12 = {8, -1, -1};
tree[5] = tint_symbol_12;
const BST tint_symbol_11 = {8, -1, -1};
tree[5] = tint_symbol_11;
x_218_phi = true;
break;
} else {
@@ -376,8 +376,8 @@ void main_1() {
const int x_244 = tree[x_243_save].leftIndex;
if ((x_244 == -1)) {
tree[x_243_save].leftIndex = 6;
const BST tint_symbol_13 = {2, -1, -1};
tree[6] = tint_symbol_13;
const BST tint_symbol_12 = {2, -1, -1};
tree[6] = tint_symbol_12;
x_251_phi = true;
break;
} else {
@@ -395,8 +395,8 @@ void main_1() {
const int x_236 = tree[x_235_save].rightIndex;
if ((x_236 == -1)) {
tree[x_235_save].rightIndex = 6;
const BST tint_symbol_14 = {2, -1, -1};
tree[6] = tint_symbol_14;
const BST tint_symbol_13 = {2, -1, -1};
tree[6] = tint_symbol_13;
x_251_phi = true;
break;
} else {
@@ -444,8 +444,8 @@ void main_1() {
const int x_277 = tree[x_276_save].leftIndex;
if ((x_277 == -1)) {
tree[x_276_save].leftIndex = 7;
const BST tint_symbol_15 = {6, -1, -1};
tree[7] = tint_symbol_15;
const BST tint_symbol_14 = {6, -1, -1};
tree[7] = tint_symbol_14;
x_284_phi = true;
break;
} else {
@@ -463,8 +463,8 @@ void main_1() {
const int x_269 = tree[x_268_save].rightIndex;
if ((x_269 == -1)) {
tree[x_268_save].rightIndex = 7;
const BST tint_symbol_16 = {6, -1, -1};
tree[7] = tint_symbol_16;
const BST tint_symbol_15 = {6, -1, -1};
tree[7] = tint_symbol_15;
x_284_phi = true;
break;
} else {
@@ -512,8 +512,8 @@ void main_1() {
const int x_310 = tree[x_309_save].leftIndex;
if ((x_310 == -1)) {
tree[x_309_save].leftIndex = 8;
const BST tint_symbol_17 = {17, -1, -1};
tree[8] = tint_symbol_17;
const BST tint_symbol_16 = {17, -1, -1};
tree[8] = tint_symbol_16;
x_317_phi = true;
break;
} else {
@@ -531,8 +531,8 @@ void main_1() {
const int x_302 = tree[x_301_save].rightIndex;
if ((x_302 == -1)) {
tree[x_301_save].rightIndex = 8;
const BST tint_symbol_18 = {17, -1, -1};
tree[8] = tint_symbol_18;
const BST tint_symbol_17 = {17, -1, -1};
tree[8] = tint_symbol_17;
x_317_phi = true;
break;
} else {
@@ -580,8 +580,8 @@ void main_1() {
const int x_343 = tree[x_342_save].leftIndex;
if ((x_343 == -1)) {
tree[x_342_save].leftIndex = 9;
const BST tint_symbol_19 = {13, -1, -1};
tree[9] = tint_symbol_19;
const BST tint_symbol_18 = {13, -1, -1};
tree[9] = tint_symbol_18;
x_350_phi = true;
break;
} else {
@@ -599,8 +599,8 @@ void main_1() {
const int x_335 = tree[x_334_save].rightIndex;
if ((x_335 == -1)) {
tree[x_334_save].rightIndex = 9;
const BST tint_symbol_20 = {13, -1, -1};
tree[9] = tint_symbol_20;
const BST tint_symbol_19 = {13, -1, -1};
tree[9] = tint_symbol_19;
x_350_phi = true;
break;
} else {
@@ -740,9 +740,15 @@ struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol main() {
main_out main_inner() {
main_1();
const main_out tint_symbol_1 = {x_GLF_color};
const tint_symbol tint_symbol_21 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_21;
const main_out tint_symbol_20 = {x_GLF_color};
return tint_symbol_20;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -16,7 +16,7 @@ struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(thread float4* const tint_symbol_23) {
void main_1(thread float4* const tint_symbol_22) {
tint_array_wrapper tree = {};
int x_356 = 0;
int x_58_phi = 0;
@@ -24,8 +24,8 @@ void main_1(thread float4* const tint_symbol_23) {
int x_353_phi = 0;
int x_356_phi = 0;
int x_358_phi = 0;
BST const tint_symbol_3 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_3;
BST const tint_symbol_2 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_2;
switch(0u) {
default: {
x_58_phi = 0;
@@ -46,8 +46,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_79 = tree.arr[x_78_save].leftIndex;
if ((x_79 == -1)) {
tree.arr[x_78_save].leftIndex = 1;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
BST const tint_symbol_3 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_3;
x_86_phi = true;
break;
} else {
@@ -65,8 +65,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_71 = tree.arr[x_70_save].rightIndex;
if ((x_71 == -1)) {
tree.arr[x_70_save].rightIndex = 1;
BST const tint_symbol_5 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_5;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
x_86_phi = true;
break;
} else {
@@ -115,8 +115,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_112 = tree.arr[x_111_save].leftIndex;
if ((x_112 == -1)) {
tree.arr[x_111_save].leftIndex = 2;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
BST const tint_symbol_5 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_5;
x_119_phi = true;
break;
} else {
@@ -134,8 +134,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_104 = tree.arr[x_103_save].rightIndex;
if ((x_104 == -1)) {
tree.arr[x_103_save].rightIndex = 2;
BST const tint_symbol_7 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_7;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
x_119_phi = true;
break;
} else {
@@ -184,8 +184,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_145 = tree.arr[x_144_save].leftIndex;
if ((x_145 == -1)) {
tree.arr[x_144_save].leftIndex = 3;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
BST const tint_symbol_7 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_7;
x_152_phi = true;
break;
} else {
@@ -203,8 +203,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_137 = tree.arr[x_136_save].rightIndex;
if ((x_137 == -1)) {
tree.arr[x_136_save].rightIndex = 3;
BST const tint_symbol_9 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_9;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
x_152_phi = true;
break;
} else {
@@ -253,8 +253,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_178 = tree.arr[x_177_save].leftIndex;
if ((x_178 == -1)) {
tree.arr[x_177_save].leftIndex = 4;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
BST const tint_symbol_9 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_9;
x_185_phi = true;
break;
} else {
@@ -272,8 +272,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_170 = tree.arr[x_169_save].rightIndex;
if ((x_170 == -1)) {
tree.arr[x_169_save].rightIndex = 4;
BST const tint_symbol_11 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_11;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
x_185_phi = true;
break;
} else {
@@ -322,8 +322,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_211 = tree.arr[x_210_save].leftIndex;
if ((x_211 == -1)) {
tree.arr[x_210_save].leftIndex = 5;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
BST const tint_symbol_11 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_11;
x_218_phi = true;
break;
} else {
@@ -341,8 +341,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_203 = tree.arr[x_202_save].rightIndex;
if ((x_203 == -1)) {
tree.arr[x_202_save].rightIndex = 5;
BST const tint_symbol_13 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_13;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
x_218_phi = true;
break;
} else {
@@ -391,8 +391,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_244 = tree.arr[x_243_save].leftIndex;
if ((x_244 == -1)) {
tree.arr[x_243_save].leftIndex = 6;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
BST const tint_symbol_13 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_13;
x_251_phi = true;
break;
} else {
@@ -410,8 +410,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_236 = tree.arr[x_235_save].rightIndex;
if ((x_236 == -1)) {
tree.arr[x_235_save].rightIndex = 6;
BST const tint_symbol_15 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_15;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
x_251_phi = true;
break;
} else {
@@ -460,8 +460,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_277 = tree.arr[x_276_save].leftIndex;
if ((x_277 == -1)) {
tree.arr[x_276_save].leftIndex = 7;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
BST const tint_symbol_15 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_15;
x_284_phi = true;
break;
} else {
@@ -479,8 +479,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_269 = tree.arr[x_268_save].rightIndex;
if ((x_269 == -1)) {
tree.arr[x_268_save].rightIndex = 7;
BST const tint_symbol_17 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_17;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
x_284_phi = true;
break;
} else {
@@ -529,8 +529,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_310 = tree.arr[x_309_save].leftIndex;
if ((x_310 == -1)) {
tree.arr[x_309_save].leftIndex = 8;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
BST const tint_symbol_17 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_17;
x_317_phi = true;
break;
} else {
@@ -548,8 +548,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_302 = tree.arr[x_301_save].rightIndex;
if ((x_302 == -1)) {
tree.arr[x_301_save].rightIndex = 8;
BST const tint_symbol_19 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_19;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
x_317_phi = true;
break;
} else {
@@ -598,8 +598,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_343 = tree.arr[x_342_save].leftIndex;
if ((x_343 == -1)) {
tree.arr[x_342_save].leftIndex = 9;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
BST const tint_symbol_19 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_19;
x_350_phi = true;
break;
} else {
@@ -617,8 +617,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_335 = tree.arr[x_334_save].rightIndex;
if ((x_335 == -1)) {
tree.arr[x_334_save].rightIndex = 9;
BST const tint_symbol_21 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_21;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
x_350_phi = true;
break;
} else {
@@ -745,18 +745,24 @@ void main_1(thread float4* const tint_symbol_23) {
}
}
if ((x_356 == as_type<int>(20))) {
*(tint_symbol_23) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_22) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_23) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_22) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol() {
thread float4 tint_symbol_24 = 0.0f;
main_1(&(tint_symbol_24));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_24};
tint_symbol_1 const tint_symbol_22 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_22;
main_out tint_symbol_inner(thread float4* const tint_symbol_23) {
main_1(tint_symbol_23);
main_out const tint_symbol_21 = {.x_GLF_color_1=*(tint_symbol_23)};
return tint_symbol_21;
}
fragment tint_symbol_1 tint_symbol() {
thread float4 tint_symbol_24 = 0.0f;
main_out const inner_result = tint_symbol_inner(&(tint_symbol_24));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -14,8 +14,8 @@ void main_1() {
int x_353_phi = 0;
int x_356_phi = 0;
int x_358_phi = 0;
const BST tint_symbol_2 = {9, -1, -1};
tree[0] = tint_symbol_2;
const BST tint_symbol_1 = {9, -1, -1};
tree[0] = tint_symbol_1;
switch(0u) {
default: {
x_58_phi = 0;
@@ -36,8 +36,8 @@ void main_1() {
const int x_79 = tree[x_78_save].leftIndex;
if ((x_79 == -1)) {
tree[x_78_save].leftIndex = 1;
const BST tint_symbol_3 = {5, -1, -1};
tree[1] = tint_symbol_3;
const BST tint_symbol_2 = {5, -1, -1};
tree[1] = tint_symbol_2;
x_86_phi = true;
break;
} else {
@@ -55,8 +55,8 @@ void main_1() {
const int x_71 = tree[x_70_save].rightIndex;
if ((x_71 == -1)) {
tree[x_70_save].rightIndex = 1;
const BST tint_symbol_4 = {5, -1, -1};
tree[1] = tint_symbol_4;
const BST tint_symbol_3 = {5, -1, -1};
tree[1] = tint_symbol_3;
x_86_phi = true;
break;
} else {
@@ -104,8 +104,8 @@ void main_1() {
const int x_112 = tree[x_111_save].leftIndex;
if ((x_112 == -1)) {
tree[x_111_save].leftIndex = 2;
const BST tint_symbol_5 = {12, -1, -1};
tree[2] = tint_symbol_5;
const BST tint_symbol_4 = {12, -1, -1};
tree[2] = tint_symbol_4;
x_119_phi = true;
break;
} else {
@@ -123,8 +123,8 @@ void main_1() {
const int x_104 = tree[x_103_save].rightIndex;
if ((x_104 == -1)) {
tree[x_103_save].rightIndex = 2;
const BST tint_symbol_6 = {12, -1, -1};
tree[2] = tint_symbol_6;
const BST tint_symbol_5 = {12, -1, -1};
tree[2] = tint_symbol_5;
x_119_phi = true;
break;
} else {
@@ -172,8 +172,8 @@ void main_1() {
const int x_145 = tree[x_144_save].leftIndex;
if ((x_145 == -1)) {
tree[x_144_save].leftIndex = 3;
const BST tint_symbol_7 = {15, -1, -1};
tree[3] = tint_symbol_7;
const BST tint_symbol_6 = {15, -1, -1};
tree[3] = tint_symbol_6;
x_152_phi = true;
break;
} else {
@@ -191,8 +191,8 @@ void main_1() {
const int x_137 = tree[x_136_save].rightIndex;
if ((x_137 == -1)) {
tree[x_136_save].rightIndex = 3;
const BST tint_symbol_8 = {15, -1, -1};
tree[3] = tint_symbol_8;
const BST tint_symbol_7 = {15, -1, -1};
tree[3] = tint_symbol_7;
x_152_phi = true;
break;
} else {
@@ -240,8 +240,8 @@ void main_1() {
const int x_178 = tree[x_177_save].leftIndex;
if ((x_178 == -1)) {
tree[x_177_save].leftIndex = 4;
const BST tint_symbol_9 = {7, -1, -1};
tree[4] = tint_symbol_9;
const BST tint_symbol_8 = {7, -1, -1};
tree[4] = tint_symbol_8;
x_185_phi = true;
break;
} else {
@@ -259,8 +259,8 @@ void main_1() {
const int x_170 = tree[x_169_save].rightIndex;
if ((x_170 == -1)) {
tree[x_169_save].rightIndex = 4;
const BST tint_symbol_10 = {7, -1, -1};
tree[4] = tint_symbol_10;
const BST tint_symbol_9 = {7, -1, -1};
tree[4] = tint_symbol_9;
x_185_phi = true;
break;
} else {
@@ -308,8 +308,8 @@ void main_1() {
const int x_211 = tree[x_210_save].leftIndex;
if ((x_211 == -1)) {
tree[x_210_save].leftIndex = 5;
const BST tint_symbol_11 = {8, -1, -1};
tree[5] = tint_symbol_11;
const BST tint_symbol_10 = {8, -1, -1};
tree[5] = tint_symbol_10;
x_218_phi = true;
break;
} else {
@@ -327,8 +327,8 @@ void main_1() {
const int x_203 = tree[x_202_save].rightIndex;
if ((x_203 == -1)) {
tree[x_202_save].rightIndex = 5;
const BST tint_symbol_12 = {8, -1, -1};
tree[5] = tint_symbol_12;
const BST tint_symbol_11 = {8, -1, -1};
tree[5] = tint_symbol_11;
x_218_phi = true;
break;
} else {
@@ -376,8 +376,8 @@ void main_1() {
const int x_244 = tree[x_243_save].leftIndex;
if ((x_244 == -1)) {
tree[x_243_save].leftIndex = 6;
const BST tint_symbol_13 = {2, -1, -1};
tree[6] = tint_symbol_13;
const BST tint_symbol_12 = {2, -1, -1};
tree[6] = tint_symbol_12;
x_251_phi = true;
break;
} else {
@@ -395,8 +395,8 @@ void main_1() {
const int x_236 = tree[x_235_save].rightIndex;
if ((x_236 == -1)) {
tree[x_235_save].rightIndex = 6;
const BST tint_symbol_14 = {2, -1, -1};
tree[6] = tint_symbol_14;
const BST tint_symbol_13 = {2, -1, -1};
tree[6] = tint_symbol_13;
x_251_phi = true;
break;
} else {
@@ -444,8 +444,8 @@ void main_1() {
const int x_277 = tree[x_276_save].leftIndex;
if ((x_277 == -1)) {
tree[x_276_save].leftIndex = 7;
const BST tint_symbol_15 = {6, -1, -1};
tree[7] = tint_symbol_15;
const BST tint_symbol_14 = {6, -1, -1};
tree[7] = tint_symbol_14;
x_284_phi = true;
break;
} else {
@@ -463,8 +463,8 @@ void main_1() {
const int x_269 = tree[x_268_save].rightIndex;
if ((x_269 == -1)) {
tree[x_268_save].rightIndex = 7;
const BST tint_symbol_16 = {6, -1, -1};
tree[7] = tint_symbol_16;
const BST tint_symbol_15 = {6, -1, -1};
tree[7] = tint_symbol_15;
x_284_phi = true;
break;
} else {
@@ -512,8 +512,8 @@ void main_1() {
const int x_310 = tree[x_309_save].leftIndex;
if ((x_310 == -1)) {
tree[x_309_save].leftIndex = 8;
const BST tint_symbol_17 = {17, -1, -1};
tree[8] = tint_symbol_17;
const BST tint_symbol_16 = {17, -1, -1};
tree[8] = tint_symbol_16;
x_317_phi = true;
break;
} else {
@@ -531,8 +531,8 @@ void main_1() {
const int x_302 = tree[x_301_save].rightIndex;
if ((x_302 == -1)) {
tree[x_301_save].rightIndex = 8;
const BST tint_symbol_18 = {17, -1, -1};
tree[8] = tint_symbol_18;
const BST tint_symbol_17 = {17, -1, -1};
tree[8] = tint_symbol_17;
x_317_phi = true;
break;
} else {
@@ -580,8 +580,8 @@ void main_1() {
const int x_343 = tree[x_342_save].leftIndex;
if ((x_343 == -1)) {
tree[x_342_save].leftIndex = 9;
const BST tint_symbol_19 = {13, -1, -1};
tree[9] = tint_symbol_19;
const BST tint_symbol_18 = {13, -1, -1};
tree[9] = tint_symbol_18;
x_350_phi = true;
break;
} else {
@@ -599,8 +599,8 @@ void main_1() {
const int x_335 = tree[x_334_save].rightIndex;
if ((x_335 == -1)) {
tree[x_334_save].rightIndex = 9;
const BST tint_symbol_20 = {13, -1, -1};
tree[9] = tint_symbol_20;
const BST tint_symbol_19 = {13, -1, -1};
tree[9] = tint_symbol_19;
x_350_phi = true;
break;
} else {
@@ -740,9 +740,15 @@ struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol main() {
main_out main_inner() {
main_1();
const main_out tint_symbol_1 = {x_GLF_color};
const tint_symbol tint_symbol_21 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_21;
const main_out tint_symbol_20 = {x_GLF_color};
return tint_symbol_20;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -16,7 +16,7 @@ struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(thread float4* const tint_symbol_23) {
void main_1(thread float4* const tint_symbol_22) {
tint_array_wrapper tree = {};
int x_356 = 0;
int x_58_phi = 0;
@@ -24,8 +24,8 @@ void main_1(thread float4* const tint_symbol_23) {
int x_353_phi = 0;
int x_356_phi = 0;
int x_358_phi = 0;
BST const tint_symbol_3 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_3;
BST const tint_symbol_2 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_2;
switch(0u) {
default: {
x_58_phi = 0;
@@ -46,8 +46,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_79 = tree.arr[x_78_save].leftIndex;
if ((x_79 == -1)) {
tree.arr[x_78_save].leftIndex = 1;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
BST const tint_symbol_3 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_3;
x_86_phi = true;
break;
} else {
@@ -65,8 +65,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_71 = tree.arr[x_70_save].rightIndex;
if ((x_71 == -1)) {
tree.arr[x_70_save].rightIndex = 1;
BST const tint_symbol_5 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_5;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
x_86_phi = true;
break;
} else {
@@ -115,8 +115,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_112 = tree.arr[x_111_save].leftIndex;
if ((x_112 == -1)) {
tree.arr[x_111_save].leftIndex = 2;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
BST const tint_symbol_5 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_5;
x_119_phi = true;
break;
} else {
@@ -134,8 +134,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_104 = tree.arr[x_103_save].rightIndex;
if ((x_104 == -1)) {
tree.arr[x_103_save].rightIndex = 2;
BST const tint_symbol_7 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_7;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
x_119_phi = true;
break;
} else {
@@ -184,8 +184,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_145 = tree.arr[x_144_save].leftIndex;
if ((x_145 == -1)) {
tree.arr[x_144_save].leftIndex = 3;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
BST const tint_symbol_7 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_7;
x_152_phi = true;
break;
} else {
@@ -203,8 +203,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_137 = tree.arr[x_136_save].rightIndex;
if ((x_137 == -1)) {
tree.arr[x_136_save].rightIndex = 3;
BST const tint_symbol_9 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_9;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
x_152_phi = true;
break;
} else {
@@ -253,8 +253,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_178 = tree.arr[x_177_save].leftIndex;
if ((x_178 == -1)) {
tree.arr[x_177_save].leftIndex = 4;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
BST const tint_symbol_9 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_9;
x_185_phi = true;
break;
} else {
@@ -272,8 +272,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_170 = tree.arr[x_169_save].rightIndex;
if ((x_170 == -1)) {
tree.arr[x_169_save].rightIndex = 4;
BST const tint_symbol_11 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_11;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
x_185_phi = true;
break;
} else {
@@ -322,8 +322,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_211 = tree.arr[x_210_save].leftIndex;
if ((x_211 == -1)) {
tree.arr[x_210_save].leftIndex = 5;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
BST const tint_symbol_11 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_11;
x_218_phi = true;
break;
} else {
@@ -341,8 +341,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_203 = tree.arr[x_202_save].rightIndex;
if ((x_203 == -1)) {
tree.arr[x_202_save].rightIndex = 5;
BST const tint_symbol_13 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_13;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
x_218_phi = true;
break;
} else {
@@ -391,8 +391,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_244 = tree.arr[x_243_save].leftIndex;
if ((x_244 == -1)) {
tree.arr[x_243_save].leftIndex = 6;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
BST const tint_symbol_13 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_13;
x_251_phi = true;
break;
} else {
@@ -410,8 +410,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_236 = tree.arr[x_235_save].rightIndex;
if ((x_236 == -1)) {
tree.arr[x_235_save].rightIndex = 6;
BST const tint_symbol_15 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_15;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
x_251_phi = true;
break;
} else {
@@ -460,8 +460,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_277 = tree.arr[x_276_save].leftIndex;
if ((x_277 == -1)) {
tree.arr[x_276_save].leftIndex = 7;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
BST const tint_symbol_15 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_15;
x_284_phi = true;
break;
} else {
@@ -479,8 +479,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_269 = tree.arr[x_268_save].rightIndex;
if ((x_269 == -1)) {
tree.arr[x_268_save].rightIndex = 7;
BST const tint_symbol_17 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_17;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
x_284_phi = true;
break;
} else {
@@ -529,8 +529,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_310 = tree.arr[x_309_save].leftIndex;
if ((x_310 == -1)) {
tree.arr[x_309_save].leftIndex = 8;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
BST const tint_symbol_17 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_17;
x_317_phi = true;
break;
} else {
@@ -548,8 +548,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_302 = tree.arr[x_301_save].rightIndex;
if ((x_302 == -1)) {
tree.arr[x_301_save].rightIndex = 8;
BST const tint_symbol_19 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_19;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
x_317_phi = true;
break;
} else {
@@ -598,8 +598,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_343 = tree.arr[x_342_save].leftIndex;
if ((x_343 == -1)) {
tree.arr[x_342_save].leftIndex = 9;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
BST const tint_symbol_19 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_19;
x_350_phi = true;
break;
} else {
@@ -617,8 +617,8 @@ void main_1(thread float4* const tint_symbol_23) {
int const x_335 = tree.arr[x_334_save].rightIndex;
if ((x_335 == -1)) {
tree.arr[x_334_save].rightIndex = 9;
BST const tint_symbol_21 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_21;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
x_350_phi = true;
break;
} else {
@@ -745,18 +745,24 @@ void main_1(thread float4* const tint_symbol_23) {
}
}
if ((x_356 == as_type<int>(20))) {
*(tint_symbol_23) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_22) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_23) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_22) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol() {
thread float4 tint_symbol_24 = 0.0f;
main_1(&(tint_symbol_24));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_24};
tint_symbol_1 const tint_symbol_22 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_22;
main_out tint_symbol_inner(thread float4* const tint_symbol_23) {
main_1(tint_symbol_23);
main_out const tint_symbol_21 = {.x_GLF_color_1=*(tint_symbol_23)};
return tint_symbol_21;
}
fragment tint_symbol_1 tint_symbol() {
thread float4 tint_symbol_24 = 0.0f;
main_out const inner_result = tint_symbol_inner(&(tint_symbol_24));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -15,11 +15,11 @@ struct tint_array_wrapper {
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread float4* const tint_symbol_25) {
void main_1(constant buf0& x_8, thread float4* const tint_symbol_22, thread float4* const tint_symbol_23) {
tint_array_wrapper tree = {};
bool x_67 = false;
bool x_114 = false;
@@ -31,8 +31,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int x_569_phi = 0;
int x_572_phi = 0;
int x_574_phi = 0;
BST const tint_symbol_4 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_4;
BST const tint_symbol_2 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_2;
switch(0u) {
default: {
x_67_phi = false;
@@ -66,8 +66,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_89_save].leftIndex = 1;
BST const tint_symbol_5 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_5;
BST const tint_symbol_3 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_3;
while (true) {
x_114_phi = x_67;
if ((0 < int(x_97))) {
@@ -99,8 +99,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_82 = tree.arr[x_81_save].rightIndex;
if ((x_82 == -1)) {
tree.arr[x_81_save].rightIndex = 1;
BST const tint_symbol_6 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_6;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
x_116_phi = true;
break;
} else {
@@ -139,7 +139,7 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int x_120 = 0;
bool x_134_phi = false;
int const x_119 = x_119_phi;
float const x_125 = (*(tint_symbol_24)).y;
float const x_125 = (*(tint_symbol_22)).y;
bool const x_126 = (x_125 < 0.0f);
x_134_phi = x_126;
if (!(x_126)) {
@@ -190,8 +190,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_161_save].leftIndex = 2;
BST const tint_symbol_7 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_7;
BST const tint_symbol_5 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_5;
while (true) {
x_186_phi = x_139;
if ((0 < int(x_169))) {
@@ -223,8 +223,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_154 = tree.arr[x_153_save].rightIndex;
if ((x_154 == -1)) {
tree.arr[x_153_save].rightIndex = 2;
BST const tint_symbol_8 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_8;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
x_188_phi = true;
break;
} else {
@@ -300,8 +300,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_215_save].leftIndex = 3;
BST const tint_symbol_9 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_9;
BST const tint_symbol_7 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_7;
while (true) {
x_240_phi = x_193;
if ((0 < int(x_223))) {
@@ -333,8 +333,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_208 = tree.arr[x_207_save].rightIndex;
if ((x_208 == -1)) {
tree.arr[x_207_save].rightIndex = 3;
BST const tint_symbol_10 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_10;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
x_242_phi = true;
break;
} else {
@@ -405,8 +405,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_269_save].leftIndex = 4;
BST const tint_symbol_11 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_11;
BST const tint_symbol_9 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_9;
while (true) {
x_294_phi = x_247;
if ((0 < int(x_277))) {
@@ -438,8 +438,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_262 = tree.arr[x_261_save].rightIndex;
if ((x_262 == -1)) {
tree.arr[x_261_save].rightIndex = 4;
BST const tint_symbol_12 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_12;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
x_296_phi = true;
break;
} else {
@@ -510,8 +510,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_323_save].leftIndex = 5;
BST const tint_symbol_13 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_13;
BST const tint_symbol_11 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_11;
while (true) {
x_348_phi = x_301;
if ((0 < int(x_331))) {
@@ -543,8 +543,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_316 = tree.arr[x_315_save].rightIndex;
if ((x_316 == -1)) {
tree.arr[x_315_save].rightIndex = 5;
BST const tint_symbol_14 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_14;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
x_350_phi = true;
break;
} else {
@@ -615,8 +615,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_377_save].leftIndex = 6;
BST const tint_symbol_15 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_15;
BST const tint_symbol_13 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_13;
while (true) {
x_402_phi = x_355;
if ((0 < int(x_385))) {
@@ -648,8 +648,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_370 = tree.arr[x_369_save].rightIndex;
if ((x_370 == -1)) {
tree.arr[x_369_save].rightIndex = 6;
BST const tint_symbol_16 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_16;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
x_404_phi = true;
break;
} else {
@@ -720,8 +720,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_431_save].leftIndex = 7;
BST const tint_symbol_17 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_17;
BST const tint_symbol_15 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_15;
while (true) {
x_456_phi = x_409;
if ((0 < int(x_439))) {
@@ -753,8 +753,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_424 = tree.arr[x_423_save].rightIndex;
if ((x_424 == -1)) {
tree.arr[x_423_save].rightIndex = 7;
BST const tint_symbol_18 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_18;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
x_458_phi = true;
break;
} else {
@@ -825,8 +825,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_485_save].leftIndex = 8;
BST const tint_symbol_19 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_19;
BST const tint_symbol_17 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_17;
while (true) {
x_510_phi = x_463;
if ((0 < int(x_493))) {
@@ -858,8 +858,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_478 = tree.arr[x_477_save].rightIndex;
if ((x_478 == -1)) {
tree.arr[x_477_save].rightIndex = 8;
BST const tint_symbol_20 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_20;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
x_512_phi = true;
break;
} else {
@@ -930,8 +930,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_539_save].leftIndex = 9;
BST const tint_symbol_21 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_21;
BST const tint_symbol_19 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_19;
while (true) {
x_564_phi = x_517;
if ((0 < int(x_547))) {
@@ -963,8 +963,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_532 = tree.arr[x_531_save].rightIndex;
if ((x_532 == -1)) {
tree.arr[x_531_save].rightIndex = 9;
BST const tint_symbol_22 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_22;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
x_566_phi = true;
break;
} else {
@@ -1097,20 +1097,26 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
}
}
if ((x_572 == as_type<int>(20))) {
*(tint_symbol_25) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_23) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_25) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_23) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_26 = 0.0f;
thread float4 tint_symbol_27 = 0.0f;
tint_symbol_26 = gl_FragCoord_param;
main_1(x_8, &(tint_symbol_26), &(tint_symbol_27));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_27};
tint_symbol_2 const tint_symbol_23 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_23;
main_out tint_symbol_inner(constant buf0& x_8, float4 gl_FragCoord_param, thread float4* const tint_symbol_24, thread float4* const tint_symbol_25) {
*(tint_symbol_24) = gl_FragCoord_param;
main_1(x_8, tint_symbol_24, tint_symbol_25);
main_out const tint_symbol_21 = {.x_GLF_color_1=*(tint_symbol_25)};
return tint_symbol_21;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_26 = 0.0f;
thread float4 tint_symbol_27 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_8, gl_FragCoord_param, &(tint_symbol_26), &(tint_symbol_27));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -15,11 +15,11 @@ struct tint_array_wrapper {
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread float4* const tint_symbol_25) {
void main_1(constant buf0& x_8, thread float4* const tint_symbol_22, thread float4* const tint_symbol_23) {
tint_array_wrapper tree = {};
bool x_67 = false;
bool x_114 = false;
@@ -31,8 +31,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int x_569_phi = 0;
int x_572_phi = 0;
int x_574_phi = 0;
BST const tint_symbol_4 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_4;
BST const tint_symbol_2 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_2;
switch(0u) {
default: {
x_67_phi = false;
@@ -66,8 +66,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_89_save].leftIndex = 1;
BST const tint_symbol_5 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_5;
BST const tint_symbol_3 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_3;
while (true) {
x_114_phi = x_67;
if ((0 < int(x_97))) {
@@ -99,8 +99,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_82 = tree.arr[x_81_save].rightIndex;
if ((x_82 == -1)) {
tree.arr[x_81_save].rightIndex = 1;
BST const tint_symbol_6 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_6;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
x_116_phi = true;
break;
} else {
@@ -139,7 +139,7 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int x_120 = 0;
bool x_134_phi = false;
int const x_119 = x_119_phi;
float const x_125 = (*(tint_symbol_24)).y;
float const x_125 = (*(tint_symbol_22)).y;
bool const x_126 = (x_125 < 0.0f);
x_134_phi = x_126;
if (!(x_126)) {
@@ -190,8 +190,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_161_save].leftIndex = 2;
BST const tint_symbol_7 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_7;
BST const tint_symbol_5 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_5;
while (true) {
x_186_phi = x_139;
if ((0 < int(x_169))) {
@@ -223,8 +223,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_154 = tree.arr[x_153_save].rightIndex;
if ((x_154 == -1)) {
tree.arr[x_153_save].rightIndex = 2;
BST const tint_symbol_8 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_8;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
x_188_phi = true;
break;
} else {
@@ -300,8 +300,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_215_save].leftIndex = 3;
BST const tint_symbol_9 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_9;
BST const tint_symbol_7 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_7;
while (true) {
x_240_phi = x_193;
if ((0 < int(x_223))) {
@@ -333,8 +333,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_208 = tree.arr[x_207_save].rightIndex;
if ((x_208 == -1)) {
tree.arr[x_207_save].rightIndex = 3;
BST const tint_symbol_10 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_10;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
x_242_phi = true;
break;
} else {
@@ -405,8 +405,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_269_save].leftIndex = 4;
BST const tint_symbol_11 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_11;
BST const tint_symbol_9 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_9;
while (true) {
x_294_phi = x_247;
if ((0 < int(x_277))) {
@@ -438,8 +438,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_262 = tree.arr[x_261_save].rightIndex;
if ((x_262 == -1)) {
tree.arr[x_261_save].rightIndex = 4;
BST const tint_symbol_12 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_12;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
x_296_phi = true;
break;
} else {
@@ -510,8 +510,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_323_save].leftIndex = 5;
BST const tint_symbol_13 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_13;
BST const tint_symbol_11 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_11;
while (true) {
x_348_phi = x_301;
if ((0 < int(x_331))) {
@@ -543,8 +543,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_316 = tree.arr[x_315_save].rightIndex;
if ((x_316 == -1)) {
tree.arr[x_315_save].rightIndex = 5;
BST const tint_symbol_14 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_14;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
x_350_phi = true;
break;
} else {
@@ -615,8 +615,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_377_save].leftIndex = 6;
BST const tint_symbol_15 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_15;
BST const tint_symbol_13 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_13;
while (true) {
x_402_phi = x_355;
if ((0 < int(x_385))) {
@@ -648,8 +648,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_370 = tree.arr[x_369_save].rightIndex;
if ((x_370 == -1)) {
tree.arr[x_369_save].rightIndex = 6;
BST const tint_symbol_16 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_16;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
x_404_phi = true;
break;
} else {
@@ -720,8 +720,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_431_save].leftIndex = 7;
BST const tint_symbol_17 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_17;
BST const tint_symbol_15 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_15;
while (true) {
x_456_phi = x_409;
if ((0 < int(x_439))) {
@@ -753,8 +753,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_424 = tree.arr[x_423_save].rightIndex;
if ((x_424 == -1)) {
tree.arr[x_423_save].rightIndex = 7;
BST const tint_symbol_18 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_18;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
x_458_phi = true;
break;
} else {
@@ -825,8 +825,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_485_save].leftIndex = 8;
BST const tint_symbol_19 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_19;
BST const tint_symbol_17 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_17;
while (true) {
x_510_phi = x_463;
if ((0 < int(x_493))) {
@@ -858,8 +858,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_478 = tree.arr[x_477_save].rightIndex;
if ((x_478 == -1)) {
tree.arr[x_477_save].rightIndex = 8;
BST const tint_symbol_20 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_20;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
x_512_phi = true;
break;
} else {
@@ -930,8 +930,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
return;
}
tree.arr[x_539_save].leftIndex = 9;
BST const tint_symbol_21 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_21;
BST const tint_symbol_19 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_19;
while (true) {
x_564_phi = x_517;
if ((0 < int(x_547))) {
@@ -963,8 +963,8 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
int const x_532 = tree.arr[x_531_save].rightIndex;
if ((x_532 == -1)) {
tree.arr[x_531_save].rightIndex = 9;
BST const tint_symbol_22 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_22;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
x_566_phi = true;
break;
} else {
@@ -1097,20 +1097,26 @@ void main_1(constant buf0& x_8, thread float4* const tint_symbol_24, thread floa
}
}
if ((x_572 == as_type<int>(20))) {
*(tint_symbol_25) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_23) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_25) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_23) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_26 = 0.0f;
thread float4 tint_symbol_27 = 0.0f;
tint_symbol_26 = gl_FragCoord_param;
main_1(x_8, &(tint_symbol_26), &(tint_symbol_27));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_27};
tint_symbol_2 const tint_symbol_23 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_23;
main_out tint_symbol_inner(constant buf0& x_8, float4 gl_FragCoord_param, thread float4* const tint_symbol_24, thread float4* const tint_symbol_25) {
*(tint_symbol_24) = gl_FragCoord_param;
main_1(x_8, tint_symbol_24, tint_symbol_25);
main_out const tint_symbol_21 = {.x_GLF_color_1=*(tint_symbol_25)};
return tint_symbol_21;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_26 = 0.0f;
thread float4 tint_symbol_27 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_8, gl_FragCoord_param, &(tint_symbol_26), &(tint_symbol_27));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}