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

@@ -247,9 +247,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_3 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_3;
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
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

@@ -27,7 +27,7 @@ void makeTreeNode_struct_BST_i1_i1_i11_i1_(thread BST* const tree, thread int* c
return;
}
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_4) {
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_3) {
int baseIndex = 0;
BST param = {};
int param_1 = 0;
@@ -44,25 +44,25 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
}
int const x_179 = *(data_1);
int const x_180 = baseIndex;
int const x_182 = (*(tint_symbol_4)).arr[x_180].data;
int const x_182 = (*(tint_symbol_3)).arr[x_180].data;
if ((x_179 <= x_182)) {
int const x_187 = baseIndex;
int const x_189 = (*(tint_symbol_4)).arr[x_187].leftIndex;
int const x_189 = (*(tint_symbol_3)).arr[x_187].leftIndex;
if ((x_189 == -1)) {
int const x_194 = baseIndex;
int const x_195 = *(treeIndex);
(*(tint_symbol_4)).arr[x_194].leftIndex = x_195;
(*(tint_symbol_3)).arr[x_194].leftIndex = x_195;
float const x_198 = x_16.injectionSwitch.x;
float const x_200 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
int const x_204 = *(treeIndex);
BST const x_206 = (*(tint_symbol_4)).arr[x_204];
BST const x_206 = (*(tint_symbol_3)).arr[x_204];
param = x_206;
int const x_207 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
BST const x_209 = param;
(*(tint_symbol_4)).arr[x_204] = x_209;
(*(tint_symbol_3)).arr[x_204] = x_209;
}
float const x_212 = x_16.injectionSwitch.x;
float const x_214 = x_16.injectionSwitch.y;
@@ -71,7 +71,7 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
}
} else {
int const x_218 = baseIndex;
int const x_220 = (*(tint_symbol_4)).arr[x_218].leftIndex;
int const x_220 = (*(tint_symbol_3)).arr[x_218].leftIndex;
baseIndex = x_220;
continue;
}
@@ -80,30 +80,30 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
float const x_224 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
int const x_229 = baseIndex;
int const x_231 = (*(tint_symbol_4)).arr[x_229].rightIndex;
int const x_231 = (*(tint_symbol_3)).arr[x_229].rightIndex;
x_170 = x_231;
} else {
int const x_232 = baseIndex;
int const x_234 = (*(tint_symbol_4)).arr[x_232].rightIndex;
int const x_234 = (*(tint_symbol_3)).arr[x_232].rightIndex;
x_170 = x_234;
}
int const x_235 = x_170;
if ((x_235 == -1)) {
int const x_240 = baseIndex;
int const x_241 = *(treeIndex);
(*(tint_symbol_4)).arr[x_240].rightIndex = x_241;
(*(tint_symbol_3)).arr[x_240].rightIndex = x_241;
int const x_243 = *(treeIndex);
BST const x_245 = (*(tint_symbol_4)).arr[x_243];
BST const x_245 = (*(tint_symbol_3)).arr[x_243];
param_2 = x_245;
int const x_246 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
BST const x_248 = param_2;
(*(tint_symbol_4)).arr[x_243] = x_248;
(*(tint_symbol_3)).arr[x_243] = x_248;
return;
} else {
int const x_250 = baseIndex;
int const x_252 = (*(tint_symbol_4)).arr[x_250].rightIndex;
int const x_252 = (*(tint_symbol_3)).arr[x_250].rightIndex;
baseIndex = x_252;
continue;
}
@@ -118,7 +118,7 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
return;
}
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_5) {
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_4) {
int index = 0;
BST currentNode = {};
int x_261 = 0;
@@ -130,7 +130,7 @@ int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_s
break;
}
int const x_269 = index;
BST const x_271 = (*(tint_symbol_5)).arr[x_269];
BST const x_271 = (*(tint_symbol_4)).arr[x_269];
currentNode = x_271;
int const x_273 = currentNode.data;
int const x_274 = *(target);
@@ -153,7 +153,7 @@ int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_s
return -1;
}
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6, thread float4* const tint_symbol_7) {
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_5, thread float4* const tint_symbol_6) {
int treeIndex_1 = 0;
BST param_4 = {};
int param_5 = 0;
@@ -180,66 +180,66 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
BST const x_91 = (*(tint_symbol_6)).arr[0];
BST const x_91 = (*(tint_symbol_5)).arr[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
BST const x_93 = param_4;
(*(tint_symbol_6)).arr[0] = x_93;
(*(tint_symbol_5)).arr[0] = x_93;
int const x_95 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_95) + as_type<uint>(1)));
int const x_97 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_6);
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_5);
int const x_99 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_99) + as_type<uint>(1)));
int const x_101 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_6);
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_5);
int const x_103 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
int const x_105 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_6);
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_5);
int const x_107 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_107) + as_type<uint>(1)));
int const x_109 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_6);
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_5);
int const x_111 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_111) + as_type<uint>(1)));
int const x_113 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_6);
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_5);
int const x_115 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_115) + as_type<uint>(1)));
int const x_117 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_6);
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_5);
int const x_119 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(1)));
int const x_121 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_6);
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_5);
int const x_123 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_123) + as_type<uint>(1)));
int const x_125 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_6);
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_5);
int const x_127 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_127) + as_type<uint>(1)));
int const x_129 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_6);
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_5);
count = 0;
i = 0;
while (true) {
@@ -250,7 +250,7 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
}
int const x_138 = i;
param_24 = x_138;
int const x_139 = search_i1_(&(param_24), tint_symbol_6);
int const x_139 = search_i1_(&(param_24), tint_symbol_5);
result = x_139;
int const x_140 = i;
switch(x_140) {
@@ -288,19 +288,25 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
}
int const x_159 = count;
if ((x_159 == 20)) {
*(tint_symbol_7) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_7) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_6) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_8 = {};
thread float4 tint_symbol_9 = 0.0f;
main_1(x_16, &(tint_symbol_8), &(tint_symbol_9));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_9};
tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_3;
main_out tint_symbol_inner(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_7, thread float4* const tint_symbol_8) {
main_1(x_16, tint_symbol_7, tint_symbol_8);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_8)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_9 = {};
thread float4 tint_symbol_10 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_16, &(tint_symbol_9), &(tint_symbol_10));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -247,9 +247,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_3 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_3;
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
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

@@ -27,7 +27,7 @@ void makeTreeNode_struct_BST_i1_i1_i11_i1_(thread BST* const tree, thread int* c
return;
}
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_4) {
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_3) {
int baseIndex = 0;
BST param = {};
int param_1 = 0;
@@ -44,25 +44,25 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
}
int const x_179 = *(data_1);
int const x_180 = baseIndex;
int const x_182 = (*(tint_symbol_4)).arr[x_180].data;
int const x_182 = (*(tint_symbol_3)).arr[x_180].data;
if ((x_179 <= x_182)) {
int const x_187 = baseIndex;
int const x_189 = (*(tint_symbol_4)).arr[x_187].leftIndex;
int const x_189 = (*(tint_symbol_3)).arr[x_187].leftIndex;
if ((x_189 == -1)) {
int const x_194 = baseIndex;
int const x_195 = *(treeIndex);
(*(tint_symbol_4)).arr[x_194].leftIndex = x_195;
(*(tint_symbol_3)).arr[x_194].leftIndex = x_195;
float const x_198 = x_16.injectionSwitch.x;
float const x_200 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
int const x_204 = *(treeIndex);
BST const x_206 = (*(tint_symbol_4)).arr[x_204];
BST const x_206 = (*(tint_symbol_3)).arr[x_204];
param = x_206;
int const x_207 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
BST const x_209 = param;
(*(tint_symbol_4)).arr[x_204] = x_209;
(*(tint_symbol_3)).arr[x_204] = x_209;
}
float const x_212 = x_16.injectionSwitch.x;
float const x_214 = x_16.injectionSwitch.y;
@@ -71,7 +71,7 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
}
} else {
int const x_218 = baseIndex;
int const x_220 = (*(tint_symbol_4)).arr[x_218].leftIndex;
int const x_220 = (*(tint_symbol_3)).arr[x_218].leftIndex;
baseIndex = x_220;
continue;
}
@@ -80,30 +80,30 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
float const x_224 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
int const x_229 = baseIndex;
int const x_231 = (*(tint_symbol_4)).arr[x_229].rightIndex;
int const x_231 = (*(tint_symbol_3)).arr[x_229].rightIndex;
x_170 = x_231;
} else {
int const x_232 = baseIndex;
int const x_234 = (*(tint_symbol_4)).arr[x_232].rightIndex;
int const x_234 = (*(tint_symbol_3)).arr[x_232].rightIndex;
x_170 = x_234;
}
int const x_235 = x_170;
if ((x_235 == -1)) {
int const x_240 = baseIndex;
int const x_241 = *(treeIndex);
(*(tint_symbol_4)).arr[x_240].rightIndex = x_241;
(*(tint_symbol_3)).arr[x_240].rightIndex = x_241;
int const x_243 = *(treeIndex);
BST const x_245 = (*(tint_symbol_4)).arr[x_243];
BST const x_245 = (*(tint_symbol_3)).arr[x_243];
param_2 = x_245;
int const x_246 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
BST const x_248 = param_2;
(*(tint_symbol_4)).arr[x_243] = x_248;
(*(tint_symbol_3)).arr[x_243] = x_248;
return;
} else {
int const x_250 = baseIndex;
int const x_252 = (*(tint_symbol_4)).arr[x_250].rightIndex;
int const x_252 = (*(tint_symbol_3)).arr[x_250].rightIndex;
baseIndex = x_252;
continue;
}
@@ -118,7 +118,7 @@ void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int*
return;
}
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_5) {
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_4) {
int index = 0;
BST currentNode = {};
int x_261 = 0;
@@ -130,7 +130,7 @@ int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_s
break;
}
int const x_269 = index;
BST const x_271 = (*(tint_symbol_5)).arr[x_269];
BST const x_271 = (*(tint_symbol_4)).arr[x_269];
currentNode = x_271;
int const x_273 = currentNode.data;
int const x_274 = *(target);
@@ -153,7 +153,7 @@ int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_s
return -1;
}
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6, thread float4* const tint_symbol_7) {
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_5, thread float4* const tint_symbol_6) {
int treeIndex_1 = 0;
BST param_4 = {};
int param_5 = 0;
@@ -180,66 +180,66 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
BST const x_91 = (*(tint_symbol_6)).arr[0];
BST const x_91 = (*(tint_symbol_5)).arr[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
BST const x_93 = param_4;
(*(tint_symbol_6)).arr[0] = x_93;
(*(tint_symbol_5)).arr[0] = x_93;
int const x_95 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_95) + as_type<uint>(1)));
int const x_97 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_6);
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_5);
int const x_99 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_99) + as_type<uint>(1)));
int const x_101 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_6);
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_5);
int const x_103 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
int const x_105 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_6);
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_5);
int const x_107 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_107) + as_type<uint>(1)));
int const x_109 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_6);
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_5);
int const x_111 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_111) + as_type<uint>(1)));
int const x_113 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_6);
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_5);
int const x_115 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_115) + as_type<uint>(1)));
int const x_117 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_6);
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_5);
int const x_119 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(1)));
int const x_121 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_6);
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_5);
int const x_123 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_123) + as_type<uint>(1)));
int const x_125 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_6);
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_5);
int const x_127 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_127) + as_type<uint>(1)));
int const x_129 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_6);
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_5);
count = 0;
i = 0;
while (true) {
@@ -250,7 +250,7 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
}
int const x_138 = i;
param_24 = x_138;
int const x_139 = search_i1_(&(param_24), tint_symbol_6);
int const x_139 = search_i1_(&(param_24), tint_symbol_5);
result = x_139;
int const x_140 = i;
switch(x_140) {
@@ -288,19 +288,25 @@ void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_6,
}
int const x_159 = count;
if ((x_159 == 20)) {
*(tint_symbol_7) = float4(1.0f, 0.0f, 0.0f, 1.0f);
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_7) = float4(0.0f, 0.0f, 1.0f, 1.0f);
*(tint_symbol_6) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_8 = {};
thread float4 tint_symbol_9 = 0.0f;
main_1(x_16, &(tint_symbol_8), &(tint_symbol_9));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_9};
tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_3;
main_out tint_symbol_inner(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_7, thread float4* const tint_symbol_8) {
main_1(x_16, tint_symbol_7, tint_symbol_8);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_8)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_9 = {};
thread float4 tint_symbol_10 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_16, &(tint_symbol_9), &(tint_symbol_10));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}