2021-07-23 13:10:12 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
struct buf1 {
|
2021-08-23 21:45:23 +00:00
|
|
|
/* 0x0000 */ float2 injectionSwitch;
|
2021-07-23 13:10:12 +00:00
|
|
|
};
|
|
|
|
struct buf2 {
|
2021-08-23 21:45:23 +00:00
|
|
|
/* 0x0000 */ float2 resolution;
|
2021-07-23 13:10:12 +00:00
|
|
|
};
|
|
|
|
struct doesNotMatter {
|
|
|
|
/* 0x0000 */ int x_compute_data[1];
|
|
|
|
};
|
|
|
|
struct tint_array_wrapper {
|
|
|
|
float arr[1];
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main_1(constant buf1& x_10, constant buf2& x_13, device doesNotMatter& x_15, thread uint3* const tint_symbol_1) {
|
2021-07-23 13:10:12 +00:00
|
|
|
tint_array_wrapper A = {};
|
|
|
|
int i = 0;
|
|
|
|
float4 value = 0.0f;
|
|
|
|
int m = 0;
|
|
|
|
int l = 0;
|
|
|
|
int n = 0;
|
|
|
|
A.arr[0] = 0.0f;
|
|
|
|
i = 0;
|
|
|
|
while (true) {
|
|
|
|
int const x_60 = i;
|
|
|
|
if ((x_60 < 50)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_63 = i;
|
|
|
|
if ((x_63 > 0)) {
|
|
|
|
float const x_68 = A.arr[0];
|
|
|
|
float const x_70 = A.arr[0];
|
|
|
|
A.arr[0] = (x_70 + x_68);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int const x_73 = i;
|
2021-07-30 18:59:06 +00:00
|
|
|
i = as_type<int>((as_type<uint>(x_73) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
while (true) {
|
2021-08-04 22:15:28 +00:00
|
|
|
uint const x_80 = (*(tint_symbol_1)).x;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((x_80 < 100u)) {
|
|
|
|
value = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
m = 0;
|
|
|
|
while (true) {
|
|
|
|
int const x_89 = m;
|
|
|
|
if ((x_89 < 1)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
l = 0;
|
|
|
|
while (true) {
|
|
|
|
int const x_96 = l;
|
|
|
|
if ((x_96 < 1)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
float const x_100 = x_10.injectionSwitch.x;
|
|
|
|
float const x_102 = x_10.injectionSwitch.y;
|
|
|
|
if ((x_100 > x_102)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int const x_106 = l;
|
2021-07-30 18:59:06 +00:00
|
|
|
l = as_type<int>((as_type<uint>(x_106) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int const x_108 = m;
|
2021-07-30 18:59:06 +00:00
|
|
|
m = as_type<int>((as_type<uint>(x_108) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
n = 0;
|
|
|
|
while (true) {
|
|
|
|
int const x_114 = n;
|
|
|
|
if ((x_114 < 1)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
float const x_118 = x_10.injectionSwitch.x;
|
|
|
|
float const x_120 = x_10.injectionSwitch.y;
|
|
|
|
if ((x_118 > x_120)) {
|
|
|
|
threadgroup_barrier(mem_flags::mem_threadgroup);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int const x_124 = n;
|
2021-07-30 18:59:06 +00:00
|
|
|
n = as_type<int>((as_type<uint>(x_124) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
uint const x_127 = (*(tint_symbol_1)).x;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((x_127 < 120u)) {
|
|
|
|
float const x_133 = A.arr[0];
|
|
|
|
float const x_135 = x_13.resolution.x;
|
|
|
|
float const x_138 = A.arr[0];
|
|
|
|
float const x_140 = x_13.resolution.y;
|
|
|
|
value = float4((x_133 / x_135), (x_138 / x_140), 0.0f, 1.0f);
|
|
|
|
} else {
|
|
|
|
float const x_144 = x_10.injectionSwitch.x;
|
|
|
|
float const x_146 = x_10.injectionSwitch.y;
|
|
|
|
if ((x_144 > x_146)) {
|
|
|
|
{
|
|
|
|
if (false) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
if (false) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
float const x_151 = value.x;
|
|
|
|
x_15.x_compute_data[0] = int(x_151);
|
|
|
|
float const x_155 = value.y;
|
|
|
|
x_15.x_compute_data[1] = int(x_155);
|
|
|
|
float const x_159 = value.z;
|
|
|
|
x_15.x_compute_data[2] = int(x_159);
|
|
|
|
float const x_163 = value.w;
|
|
|
|
x_15.x_compute_data[3] = int(x_163);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void tint_symbol_inner(constant buf1& x_10, constant buf2& x_13, device doesNotMatter& x_15, uint3 gl_GlobalInvocationID_param, thread uint3* const tint_symbol_2) {
|
|
|
|
*(tint_symbol_2) = gl_GlobalInvocationID_param;
|
|
|
|
main_1(x_10, x_13, x_15, tint_symbol_2);
|
|
|
|
}
|
|
|
|
|
2021-08-12 19:47:20 +00:00
|
|
|
kernel void tint_symbol(uint3 gl_GlobalInvocationID_param [[thread_position_in_grid]], constant buf1& x_10 [[buffer(0)]], constant buf2& x_13 [[buffer(1)]], device doesNotMatter& x_15 [[buffer(2)]]) {
|
2021-07-23 13:10:12 +00:00
|
|
|
thread uint3 tint_symbol_3 = 0u;
|
2021-08-04 22:15:28 +00:00
|
|
|
tint_symbol_inner(x_10, x_13, x_15, gl_GlobalInvocationID_param, &(tint_symbol_3));
|
2021-07-23 13:10:12 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|