mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 11:05:36 -05:00
55 lines
2.2 KiB
Text
55 lines
2.2 KiB
Text
#include <metal_stdlib>
|
|
using namespace metal;
|
|
struct xlatMtlShaderInput {
|
|
float4 _inVertex [[attribute(0)]];
|
|
};
|
|
struct xlatMtlShaderOutput {
|
|
float4 gl_Position [[position]];
|
|
half4 xlv_TEXCOORD0;
|
|
};
|
|
struct xlatMtlShaderUniform {
|
|
float4x4 UNITY_MATRIX_MVP;
|
|
float4 unity_LightAtten[4];
|
|
float4 unity_LightColor[4];
|
|
};
|
|
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
|
|
{
|
|
xlatMtlShaderOutput _mtl_o;
|
|
float4 l_1_1;
|
|
float4 l_2;
|
|
half4 tmpvar_3;
|
|
half4 tmpvar_4;
|
|
tmpvar_3 = half4((_mtl_u.UNITY_MATRIX_MVP * _mtl_i._inVertex));
|
|
tmpvar_4 = half4(_mtl_u.unity_LightColor[0]);
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0]));
|
|
l_2 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].x);
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + l_2));
|
|
l_2 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].x);
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + l_2));
|
|
l_1_1 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].z);
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1));
|
|
l_1_1 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].z);
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1].x));
|
|
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2].x));
|
|
_mtl_o.gl_Position = float4(tmpvar_3);
|
|
_mtl_o.xlv_TEXCOORD0 = tmpvar_4;
|
|
return _mtl_o;
|
|
}
|
|
|
|
|
|
// stats: 20 alu 0 tex 0 flow
|
|
// inputs: 1
|
|
// #0: _inVertex (high float) 4x1 [-1] loc 0
|
|
// uniforms: 3 (total size: 192)
|
|
// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1] loc 0
|
|
// #1: unity_LightAtten (high float) 4x1 [4] loc 64
|
|
// #2: unity_LightColor (high float) 4x1 [4] loc 128
|