blob: d048adaa02169aeea5eb6175e3e3180769ef34af [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
int pointInTriangle_vf2_vf2_vf2_vf2_(thread float2* const p, thread float2* const a, thread float2* const b, thread float2* const c) {
float x_66 = 0.0f;
float x_67 = 0.0f;
float x_68 = 0.0f;
float2 param = 0.0f;
float2 param_1 = 0.0f;
float2 param_2 = 0.0f;
float2 param_3 = 0.0f;
float2 param_4 = 0.0f;
float2 param_5 = 0.0f;
bool x_135 = false;
bool x_172 = false;
bool x_136_phi = false;
bool x_173_phi = false;
float const x_70 = (*(p)).x;
float const x_72 = (*(a)).x;
float const x_75 = (*(p)).y;
float const x_77 = (*(a)).y;
float const x_81 = (*(b)).x;
float const x_82 = (*(a)).x;
float const x_85 = (*(b)).y;
float const x_86 = (*(a)).y;
param = float2((x_70 - x_72), (x_75 - x_77));
param_1 = float2((x_81 - x_82), (x_85 - x_86));
float const x_90 = param.x;
float const x_92 = param_1.y;
float const x_95 = param_1.x;
float const x_97 = param.y;
float const x_99 = ((x_90 * x_92) - (x_95 * x_97));
x_68 = x_99;
float const x_100 = (*(p)).x;
float const x_101 = (*(b)).x;
float const x_103 = (*(p)).y;
float const x_104 = (*(b)).y;
float const x_108 = (*(c)).x;
float const x_109 = (*(b)).x;
float const x_112 = (*(c)).y;
float const x_113 = (*(b)).y;
param_2 = float2((x_100 - x_101), (x_103 - x_104));
param_3 = float2((x_108 - x_109), (x_112 - x_113));
float const x_117 = param_2.x;
float const x_119 = param_3.y;
float const x_122 = param_3.x;
float const x_124 = param_2.y;
float const x_126 = ((x_117 * x_119) - (x_122 * x_124));
x_67 = x_126;
bool const x_127 = (x_99 < 0.0f);
bool const x_129 = (x_127 && (x_126 < 0.0f));
x_136_phi = x_129;
if (!(x_129)) {
x_135 = ((x_99 >= 0.0f) && (x_126 >= 0.0f));
x_136_phi = x_135;
}
bool const x_136 = x_136_phi;
if (!(x_136)) {
return 0;
}
float const x_140 = (*(p)).x;
float const x_141 = (*(c)).x;
float const x_143 = (*(p)).y;
float const x_144 = (*(c)).y;
float const x_147 = (*(a)).x;
float const x_148 = (*(c)).x;
float const x_150 = (*(a)).y;
float const x_151 = (*(c)).y;
param_4 = float2((x_140 - x_141), (x_143 - x_144));
param_5 = float2((x_147 - x_148), (x_150 - x_151));
float const x_155 = param_4.x;
float const x_157 = param_5.y;
float const x_160 = param_5.x;
float const x_162 = param_4.y;
float const x_164 = ((x_155 * x_157) - (x_160 * x_162));
x_66 = x_164;
bool const x_166 = (x_127 && (x_164 < 0.0f));
x_173_phi = x_166;
if (!(x_166)) {
x_172 = ((x_99 >= 0.0f) && (x_164 >= 0.0f));
x_173_phi = x_172;
}
bool const x_173 = x_173_phi;
if (!(x_173)) {
return 0;
}
return 1;
}
void main_1(constant buf0& x_17, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) {
float2 param_6 = 0.0f;
float2 param_7 = 0.0f;
float2 param_8 = 0.0f;
float2 param_9 = 0.0f;
float4 const x_55 = *(tint_symbol_3);
float2 const x_58 = x_17.resolution;
param_6 = (float2(x_55.x, x_55.y) / x_58);
param_7 = float2(0.699999988f, 0.300000012f);
param_8 = float2(0.5f, 0.899999976f);
param_9 = float2(0.100000001f, 0.400000006f);
int const x_60 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
if ((x_60 == 1)) {
*(tint_symbol_4) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_4) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_17, float4 gl_FragCoord_param, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
*(tint_symbol_5) = gl_FragCoord_param;
main_1(x_17, tint_symbol_5, tint_symbol_6);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_17 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_17, gl_FragCoord_param, &(tint_symbol_7), &(tint_symbol_8));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}