mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 08:41:31 -05:00
54 lines
2 KiB
Text
54 lines
2 KiB
Text
|
#include <metal_stdlib>
|
||
|
using namespace metal;
|
||
|
struct xlatMtlShaderInput {
|
||
|
float4 varUV;
|
||
|
};
|
||
|
struct xlatMtlShaderOutput {
|
||
|
half4 _fragData [[color(0)]];
|
||
|
};
|
||
|
struct xlatMtlShaderUniform {
|
||
|
};
|
||
|
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
|
||
|
, texture2d<half> texlow [[texture(0)]], sampler _mtlsmp_texlow [[sampler(0)]]
|
||
|
, texture2d<half> texmed [[texture(1)]], sampler _mtlsmp_texmed [[sampler(1)]]
|
||
|
, texture2d<float> texhigh [[texture(2)]], sampler _mtlsmp_texhigh [[sampler(2)]]
|
||
|
, texturecube<half> cubelow [[texture(3)]], sampler _mtlsmp_cubelow [[sampler(3)]]
|
||
|
, texturecube<half> cubemed [[texture(4)]], sampler _mtlsmp_cubemed [[sampler(4)]]
|
||
|
, texturecube<float> cubehigh [[texture(5)]], sampler _mtlsmp_cubehigh [[sampler(5)]])
|
||
|
{
|
||
|
xlatMtlShaderOutput _mtl_o;
|
||
|
half4 c_1;
|
||
|
half4 tmpvar_2;
|
||
|
tmpvar_2 = texlow.sample(_mtlsmp_texlow, (float2)(_mtl_i.varUV.xy));
|
||
|
c_1 = tmpvar_2;
|
||
|
half4 tmpvar_3;
|
||
|
tmpvar_3 = texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy));
|
||
|
c_1 = (c_1 + tmpvar_3);
|
||
|
float4 tmpvar_4;
|
||
|
tmpvar_4 = float4(texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy)));
|
||
|
c_1 = half4(((float4)c_1 + tmpvar_4));
|
||
|
half4 tmpvar_5;
|
||
|
tmpvar_5 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz));
|
||
|
c_1 = (c_1 + tmpvar_5);
|
||
|
half4 tmpvar_6;
|
||
|
tmpvar_6 = cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz));
|
||
|
c_1 = (c_1 + tmpvar_6);
|
||
|
float4 tmpvar_7;
|
||
|
tmpvar_7 = float4(cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz)));
|
||
|
c_1 = half4(((float4)c_1 + tmpvar_7));
|
||
|
_mtl_o._fragData = c_1;
|
||
|
return _mtl_o;
|
||
|
}
|
||
|
|
||
|
|
||
|
// stats: 5 alu 6 tex 0 flow
|
||
|
// inputs: 1
|
||
|
// #0: varUV (high float) 4x1 [-1]
|
||
|
// textures: 6
|
||
|
// #0: texlow (low 2d) 0x0 [-1] loc 0
|
||
|
// #1: texmed (medium 2d) 0x0 [-1] loc 1
|
||
|
// #2: texhigh (high 2d) 0x0 [-1] loc 2
|
||
|
// #3: cubelow (low cube) 0x0 [-1] loc 3
|
||
|
// #4: cubemed (medium cube) 0x0 [-1] loc 4
|
||
|
// #5: cubehigh (high cube) 0x0 [-1] loc 5
|