summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt
blob: 82058c2372d953d73f0efe823d70382bfc774bc6 (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
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
struct xlatMtlShaderInput {
  float2 gl_PointCoord [[point_coord]];
  bool gl_FrontFacing [[front_facing]];
  float4 gl_FragCoord [[position]];
  half4 uv;
};
struct xlatMtlShaderOutput {
  half4 _fragData [[color(0)]];
};
struct xlatMtlShaderUniform {
};
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half4 c_1;
  c_1 = half4(((float4)_mtl_i.uv + _mtl_i.gl_FragCoord));
  float tmpvar_2;
  if (_mtl_i.gl_FrontFacing) {
    tmpvar_2 = 1.0;
  } else {
    tmpvar_2 = 0.0;
  };
  c_1.x = (c_1.x + (half)tmpvar_2);
  c_1.xy = half2(((float2)c_1.xy + _mtl_i.gl_PointCoord));
  _mtl_o._fragData = c_1;
  return _mtl_o;
}


// stats: 5 alu 0 tex 1 flow
// inputs: 4
//  #0: gl_PointCoord (high float) 2x1 [-1] loc 23
//  #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22
//  #2: gl_FragCoord (high float) 4x1 [-1] loc 0
//  #3: uv (medium float) 4x1 [-1]