blob: f81aa5046735ec2bf51a777ff5d37a6fde9c08e7 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_private_vars_struct {
bool tint_discarded;
float fClipDistance3;
float fClipDistance4;
float4 glFragColor;
};
struct Material_tint_packed_vec3 {
/* 0x0000 */ float4 vDiffuseColor;
/* 0x0010 */ packed_float3 vAmbientColor;
/* 0x001c */ float placeholder;
/* 0x0020 */ packed_float3 vEmissiveColor;
/* 0x002c */ float placeholder2;
};
struct Scene {
/* 0x0000 */ float4 vEyePosition;
};
struct Material {
float4 vDiffuseColor;
float3 vAmbientColor;
float placeholder;
float3 vEmissiveColor;
float placeholder2;
};
struct Mesh {
/* 0x0000 */ float visibility;
};
void main_1(thread tint_private_vars_struct* const tint_private_vars, const constant Scene* const tint_symbol_5, const constant Material_tint_packed_vec3* const tint_symbol_6, const constant Mesh* const tint_symbol_7) {
float3 viewDirectionW = 0.0f;
float4 baseColor = 0.0f;
float3 diffuseColor = 0.0f;
float alpha = 0.0f;
float3 normalW = 0.0f;
float2 uvOffset = 0.0f;
float3 baseAmbientColor = 0.0f;
float glossiness = 0.0f;
float3 diffuseBase = 0.0f;
float shadow = 0.0f;
float4 refractionColor = 0.0f;
float4 reflectionColor = 0.0f;
float3 emissiveColor = 0.0f;
float3 finalDiffuse = 0.0f;
float3 finalSpecular = 0.0f;
float4 color = 0.0f;
float const x_9 = (*(tint_private_vars)).fClipDistance3;
if ((x_9 > 0.0f)) {
(*(tint_private_vars)).tint_discarded = true;
}
float const x_17 = (*(tint_private_vars)).fClipDistance4;
if ((x_17 > 0.0f)) {
(*(tint_private_vars)).tint_discarded = true;
}
float4 const x_34 = (*(tint_symbol_5)).vEyePosition;
float3 const x_38 = float3(0.0f);
viewDirectionW = normalize((float3(x_34[0], x_34[1], x_34[2]) - x_38));
baseColor = float4(1.0f);
float4 const x_52 = (*(tint_symbol_6)).vDiffuseColor;
diffuseColor = float3(x_52[0], x_52[1], x_52[2]);
float const x_60 = (*(tint_symbol_6)).vDiffuseColor[3];
alpha = x_60;
float3 const x_62 = float3(0.0f);
float3 const x_64 = float3(0.0f);
uvOffset = float2(0.0f);
float4 const x_74 = float4(0.0f);
float4 const x_76 = baseColor;
float3 const x_78 = (float3(x_76[0], x_76[1], x_76[2]) * float3(x_74[0], x_74[1], x_74[2]));
float4 const x_79 = baseColor;
baseColor = float4(x_78[0], x_78[1], x_78[2], x_79[3]);
baseAmbientColor = float3(1.0f);
glossiness = 0.0f;
diffuseBase = float3(0.0f);
shadow = 1.0f;
refractionColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
reflectionColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
float3 const x_94 = float3((*(tint_symbol_6)).vEmissiveColor);
emissiveColor = x_94;
float3 const x_96 = diffuseBase;
float3 const x_97 = diffuseColor;
float3 const x_99 = emissiveColor;
float3 const x_103 = float3((*(tint_symbol_6)).vAmbientColor);
float4 const x_108 = baseColor;
finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), float3(0.0f), float3(1.0f)) * float3(x_108[0], x_108[1], x_108[2]));
finalSpecular = float3(0.0f);
float3 const x_113 = finalDiffuse;
float3 const x_114 = baseAmbientColor;
float3 const x_116 = finalSpecular;
float4 const x_118 = reflectionColor;
float4 const x_121 = refractionColor;
float3 const x_123 = ((((x_113 * x_114) + x_116) + float3(x_118[0], x_118[1], x_118[2])) + float3(x_121[0], x_121[1], x_121[2]));
float const x_124 = alpha;
color = float4(x_123[0], x_123[1], x_123[2], x_124);
float4 const x_129 = color;
float3 const x_132 = fmax(float3(x_129[0], x_129[1], x_129[2]), float3(0.0f));
float4 const x_133 = color;
color = float4(x_132[0], x_132[1], x_132[2], x_133[3]);
float const x_140 = (*(tint_symbol_7)).visibility;
float const x_142 = color[3];
color[3] = (x_142 * x_140);
float4 const x_147 = color;
(*(tint_private_vars)).glFragColor = x_147;
return;
}
struct main_out {
float4 glFragColor_1;
};
struct tint_symbol_2 {
float fClipDistance3_param [[user(locn2)]];
float fClipDistance4_param [[user(locn3)]];
};
struct tint_symbol_3 {
float4 glFragColor_1 [[color(0)]];
};
main_out tint_symbol_inner(float fClipDistance3_param, float fClipDistance4_param, thread tint_private_vars_struct* const tint_private_vars, const constant Scene* const tint_symbol_8, const constant Material_tint_packed_vec3* const tint_symbol_9, const constant Mesh* const tint_symbol_10) {
(*(tint_private_vars)).fClipDistance3 = fClipDistance3_param;
(*(tint_private_vars)).fClipDistance4 = fClipDistance4_param;
main_1(tint_private_vars, tint_symbol_8, tint_symbol_9, tint_symbol_10);
main_out const tint_symbol_4 = {.glFragColor_1=(*(tint_private_vars)).glFragColor};
return tint_symbol_4;
}
fragment tint_symbol_3 tint_symbol(const constant Scene* tint_symbol_11 [[buffer(0)]], const constant Material_tint_packed_vec3* tint_symbol_12 [[buffer(1)]], const constant Mesh* tint_symbol_13 [[buffer(2)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
thread tint_private_vars_struct tint_private_vars = {};
tint_private_vars.tint_discarded = false;
main_out const inner_result = tint_symbol_inner(tint_symbol_1.fClipDistance3_param, tint_symbol_1.fClipDistance4_param, &(tint_private_vars), tint_symbol_11, tint_symbol_12, tint_symbol_13);
tint_symbol_3 wrapper_result = {};
wrapper_result.glFragColor_1 = inner_result.glFragColor_1;
if (tint_private_vars.tint_discarded) {
discard_fragment();
}
return wrapper_result;
}