summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt
blob: 0017785998cb31b5945b535ac0252e78b8f8fa54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <metal_stdlib>
using namespace metal;
struct xlatMtlShaderInput {
  float2 xlv_uv;
  half3 xlv_nl;
};
struct xlatMtlShaderOutput {
  half4 _fragData [[color(0)]];
};
struct xlatMtlShaderUniform {
  half4 _TerrainTreeLightColors[4];
};
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
  ,   texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half4 tmpvar_1;
  half3 light_2;
  half4 col_3;
  col_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv));
  light_2 = ((col_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz);
  light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz));
  light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz));
  half4 tmpvar_4;
  tmpvar_4.w = half(1.0);
  tmpvar_4.xyz = light_2;
  tmpvar_1 = tmpvar_4;
  _mtl_o._fragData = tmpvar_1;
  return _mtl_o;
}


// stats: 9 alu 1 tex 0 flow
// inputs: 2
//  #0: xlv_uv (high float) 2x1 [-1]
//  #1: xlv_nl (medium float) 3x1 [-1]
// uniforms: 1 (total size: 32)
//  #0: _TerrainTreeLightColors (medium float) 4x1 [4] loc 0
// textures: 1
//  #0: _MainTex (low 2d) 0x0 [-1] loc 0