summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt
blob: 0d959ebe6489e6129f030adfde5abcbdffb6a607 (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
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
struct xlatMtlShaderInput {
  half3 normal;
  half3 halfDir;
};
struct xlatMtlShaderOutput {
  half4 _fragData [[color(0)]];
};
struct xlatMtlShaderUniform {
  half specPower;
};
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half4 c_1;
  half tmpvar_2;
  tmpvar_2 = dot (_mtl_i.normal, _mtl_i.halfDir);
  half4 tmpvar_3;
  tmpvar_3 = half4(pow (tmpvar_2, _mtl_u.specPower));
  c_1 = tmpvar_3;
  _mtl_o._fragData = c_1;
  return _mtl_o;
}


// stats: 2 alu 0 tex 0 flow
// inputs: 2
//  #0: normal (low float) 3x1 [-1]
//  #1: halfDir (low float) 3x1 [-1]
// uniforms: 1 (total size: 2)
//  #0: specPower (medium float) 1x1 [-1] loc 0