mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
42 lines
1.4 KiB
Text
42 lines
1.4 KiB
Text
#include <metal_stdlib>
|
|
using namespace metal;
|
|
struct xlatMtlShaderInput {
|
|
float4 uv;
|
|
};
|
|
struct xlatMtlShaderOutput {
|
|
half4 _fragData [[color(0)]];
|
|
};
|
|
struct xlatMtlShaderUniform {
|
|
};
|
|
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
|
|
, texture2d_array<half> myarr [[texture(0)]], sampler _mtlsmp_myarr [[sampler(0)]])
|
|
{
|
|
xlatMtlShaderOutput _mtl_o;
|
|
half4 tmpvar_1;
|
|
float4 slod_2;
|
|
half4 tmpvar_3;
|
|
tmpvar_3 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z));
|
|
float4 tmpvar_4;
|
|
tmpvar_4 = float4(tmpvar_3);
|
|
half4 tmpvar_5;
|
|
tmpvar_5 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyw).xy), (uint)((_mtl_i.uv.xyw).z));
|
|
float4 tmpvar_6;
|
|
tmpvar_6 = float4(tmpvar_5);
|
|
half4 tmpvar_7;
|
|
tmpvar_7 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), bias(1.5));
|
|
float4 tmpvar_8;
|
|
tmpvar_8 = float4(tmpvar_7);
|
|
half4 tmpvar_9;
|
|
tmpvar_9 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), level(2.5));
|
|
slod_2 = float4(tmpvar_9);
|
|
tmpvar_1 = half4(((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2)));
|
|
_mtl_o._fragData = tmpvar_1;
|
|
return _mtl_o;
|
|
}
|
|
|
|
|
|
// stats: 3 alu 4 tex 0 flow
|
|
// inputs: 1
|
|
// #0: uv (high float) 4x1 [-1]
|
|
// textures: 1
|
|
// #0: myarr (low 2darray) 0x0 [-1] loc 0
|