mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 11:05:36 -05:00
186 lines
3.7 KiB
Text
186 lines
3.7 KiB
Text
|
#include <metal_stdlib>
|
||
|
using namespace metal;
|
||
|
struct xlatMtlShaderInput {
|
||
|
float4 xlv_TEXCOORD0;
|
||
|
};
|
||
|
struct xlatMtlShaderOutput {
|
||
|
half4 _fragData [[color(0)]];
|
||
|
};
|
||
|
struct xlatMtlShaderUniform {
|
||
|
};
|
||
|
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
|
||
|
{
|
||
|
xlatMtlShaderOutput _mtl_o;
|
||
|
half4 tmpvar_1;
|
||
|
float4 a_2;
|
||
|
a_2 = float4(0.0, 0.0, 0.0, 0.0);
|
||
|
bool4 tmpvar_3;
|
||
|
tmpvar_3 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
|
||
|
float tmpvar_4;
|
||
|
if (tmpvar_3.x) {
|
||
|
tmpvar_4 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_4 = 5.0;
|
||
|
};
|
||
|
float tmpvar_5;
|
||
|
if (tmpvar_3.y) {
|
||
|
tmpvar_5 = 2.0;
|
||
|
} else {
|
||
|
tmpvar_5 = 6.0;
|
||
|
};
|
||
|
float tmpvar_6;
|
||
|
if (tmpvar_3.z) {
|
||
|
tmpvar_6 = 3.0;
|
||
|
} else {
|
||
|
tmpvar_6 = 7.0;
|
||
|
};
|
||
|
float tmpvar_7;
|
||
|
if (tmpvar_3.w) {
|
||
|
tmpvar_7 = 4.0;
|
||
|
} else {
|
||
|
tmpvar_7 = 8.0;
|
||
|
};
|
||
|
float4 tmpvar_8;
|
||
|
tmpvar_8.x = tmpvar_4;
|
||
|
tmpvar_8.y = tmpvar_5;
|
||
|
tmpvar_8.z = tmpvar_6;
|
||
|
tmpvar_8.w = tmpvar_7;
|
||
|
a_2 = tmpvar_8;
|
||
|
bool4 tmpvar_9;
|
||
|
tmpvar_9 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
|
||
|
float tmpvar_10;
|
||
|
if (tmpvar_9.x) {
|
||
|
tmpvar_10 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_10 = 5.0;
|
||
|
};
|
||
|
float tmpvar_11;
|
||
|
if (tmpvar_9.y) {
|
||
|
tmpvar_11 = 2.0;
|
||
|
} else {
|
||
|
tmpvar_11 = 6.0;
|
||
|
};
|
||
|
float tmpvar_12;
|
||
|
if (tmpvar_9.z) {
|
||
|
tmpvar_12 = 3.0;
|
||
|
} else {
|
||
|
tmpvar_12 = 7.0;
|
||
|
};
|
||
|
float tmpvar_13;
|
||
|
if (tmpvar_9.w) {
|
||
|
tmpvar_13 = 4.0;
|
||
|
} else {
|
||
|
tmpvar_13 = 8.0;
|
||
|
};
|
||
|
float4 tmpvar_14;
|
||
|
tmpvar_14.x = tmpvar_10;
|
||
|
tmpvar_14.y = tmpvar_11;
|
||
|
tmpvar_14.z = tmpvar_12;
|
||
|
tmpvar_14.w = tmpvar_13;
|
||
|
a_2 = (tmpvar_8 + tmpvar_14);
|
||
|
bool4 tmpvar_15;
|
||
|
tmpvar_15 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
|
||
|
float tmpvar_16;
|
||
|
if (tmpvar_15.x) {
|
||
|
tmpvar_16 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_16 = 2.0;
|
||
|
};
|
||
|
float tmpvar_17;
|
||
|
if (tmpvar_15.y) {
|
||
|
tmpvar_17 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_17 = 2.0;
|
||
|
};
|
||
|
float tmpvar_18;
|
||
|
if (tmpvar_15.z) {
|
||
|
tmpvar_18 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_18 = 2.0;
|
||
|
};
|
||
|
float tmpvar_19;
|
||
|
if (tmpvar_15.w) {
|
||
|
tmpvar_19 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_19 = 2.0;
|
||
|
};
|
||
|
float4 tmpvar_20;
|
||
|
tmpvar_20.x = tmpvar_16;
|
||
|
tmpvar_20.y = tmpvar_17;
|
||
|
tmpvar_20.z = tmpvar_18;
|
||
|
tmpvar_20.w = tmpvar_19;
|
||
|
a_2 = (a_2 + tmpvar_20);
|
||
|
bool4 tmpvar_21;
|
||
|
tmpvar_21 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
|
||
|
float tmpvar_22;
|
||
|
if (tmpvar_21.x) {
|
||
|
tmpvar_22 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_22 = 2.0;
|
||
|
};
|
||
|
float tmpvar_23;
|
||
|
if (tmpvar_21.y) {
|
||
|
tmpvar_23 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_23 = 2.0;
|
||
|
};
|
||
|
float tmpvar_24;
|
||
|
if (tmpvar_21.z) {
|
||
|
tmpvar_24 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_24 = 2.0;
|
||
|
};
|
||
|
float tmpvar_25;
|
||
|
if (tmpvar_21.w) {
|
||
|
tmpvar_25 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_25 = 2.0;
|
||
|
};
|
||
|
float4 tmpvar_26;
|
||
|
tmpvar_26.x = tmpvar_22;
|
||
|
tmpvar_26.y = tmpvar_23;
|
||
|
tmpvar_26.z = tmpvar_24;
|
||
|
tmpvar_26.w = tmpvar_25;
|
||
|
a_2 = (a_2 + tmpvar_26);
|
||
|
bool4 tmpvar_27;
|
||
|
tmpvar_27 = bool4(fract(_mtl_i.xlv_TEXCOORD0));
|
||
|
float tmpvar_28;
|
||
|
if (tmpvar_27.x) {
|
||
|
tmpvar_28 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_28 = 2.0;
|
||
|
};
|
||
|
float tmpvar_29;
|
||
|
if (tmpvar_27.y) {
|
||
|
tmpvar_29 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_29 = 2.0;
|
||
|
};
|
||
|
float tmpvar_30;
|
||
|
if (tmpvar_27.z) {
|
||
|
tmpvar_30 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_30 = 2.0;
|
||
|
};
|
||
|
float tmpvar_31;
|
||
|
if (tmpvar_27.w) {
|
||
|
tmpvar_31 = 1.0;
|
||
|
} else {
|
||
|
tmpvar_31 = 2.0;
|
||
|
};
|
||
|
float4 tmpvar_32;
|
||
|
tmpvar_32.x = tmpvar_28;
|
||
|
tmpvar_32.y = tmpvar_29;
|
||
|
tmpvar_32.z = tmpvar_30;
|
||
|
tmpvar_32.w = tmpvar_31;
|
||
|
a_2 = (a_2 + tmpvar_32);
|
||
|
tmpvar_1 = half4(a_2);
|
||
|
_mtl_o._fragData = tmpvar_1;
|
||
|
return _mtl_o;
|
||
|
}
|
||
|
|
||
|
|
||
|
// stats: 51 alu 0 tex 20 flow
|
||
|
// inputs: 1
|
||
|
// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
|