mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
43 lines
1.4 KiB
Text
43 lines
1.4 KiB
Text
#include <metal_stdlib>
|
|
using namespace metal;
|
|
struct xlatMtlShaderInput {
|
|
float4 _glesVertex [[attribute(0)]];
|
|
float4 _glesMultiTexCoord0 [[attribute(1)]];
|
|
float4 _glesTANGENT [[attribute(2)]];
|
|
};
|
|
struct xlatMtlShaderOutput {
|
|
float4 gl_Position [[position]];
|
|
half2 xlv_TEXCOORD0;
|
|
half4 xlv_TEXCOORD1;
|
|
};
|
|
struct xlatMtlShaderUniform {
|
|
float4x4 glstate_matrix_mvp;
|
|
};
|
|
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
|
|
{
|
|
xlatMtlShaderOutput _mtl_o;
|
|
float2 tmpvar_1;
|
|
tmpvar_1 = _mtl_i._glesMultiTexCoord0.xy;
|
|
float4 tmpvar_2;
|
|
tmpvar_2.xyz = normalize(_mtl_i._glesTANGENT.xyz);
|
|
tmpvar_2.w = _mtl_i._glesTANGENT.w;
|
|
half2 uv_3;
|
|
uv_3 = half2(tmpvar_1);
|
|
half4 tmpvar_4;
|
|
tmpvar_4.xy = ((half2)(_mtl_i._glesMultiTexCoord0.xy * 0.3));
|
|
tmpvar_4.xyz = half3(((float3)tmpvar_4.xyz + ((tmpvar_2.xyz * 0.5) + 0.5)));
|
|
tmpvar_4.w = half(0.0);
|
|
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
|
|
_mtl_o.xlv_TEXCOORD0 = uv_3;
|
|
_mtl_o.xlv_TEXCOORD1 = tmpvar_4;
|
|
return _mtl_o;
|
|
}
|
|
|
|
|
|
// stats: 7 alu 0 tex 0 flow
|
|
// inputs: 3
|
|
// #0: _glesVertex (high float) 4x1 [-1] loc 0
|
|
// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 1
|
|
// #2: _glesTANGENT (high float) 4x1 [-1] loc 2
|
|
// uniforms: 1 (total size: 64)
|
|
// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
|