summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt
blob: c794c1259220df2615a3dc090c673bff2cecf3c3 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
struct xlatMtlShaderInput {
  half2 xlv_TEXCOORD0;
};
struct xlatMtlShaderOutput {
  half4 _fragData [[color(0)]];
};
struct xlatMtlShaderUniform {
  half _NumPasses;
  half4 _ContrastShift;
  half4 _SaturationShift;
  half4 _HueShift;
  half4 _LuminosityShift;
};
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 t_1;
  half4 tmpvar_2;
  tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
  t_1 = tmpvar_2;
  if ((_mtl_u._NumPasses > (half)0.0)) {
    half passes_3;
    passes_3 = _mtl_u._NumPasses;
    float i_4;
    half3 res_5;
    res_5 = tmpvar_2.xyz;
    i_4 = 0.0;
    while (true) {
      if ((i_4 >= 4.0)) {
        break;
      };
      if ((i_4 == (float)passes_3)) {
        break;
      };
      if ((i_4 == 0.0)) {
        half3 tmpvar_6;
        half val_7;
        val_7 = ((_mtl_u._ContrastShift.x * (half)3.0) + (half)12.0);
        half tmpvar_8;
        tmpvar_8 = pow ((cos(val_7) + (half)1.0), val_7);
        tmpvar_6 = ((res_5 - (half)0.5) * tmpvar_8);
        res_5 = tmpvar_6;
      } else {
        if ((i_4 == 1.0)) {
          half3 tmpvar_9;
          half val_10;
          val_10 = ((_mtl_u._SaturationShift.y * (half)3.0) + (half)12.0);
          half tmpvar_11;
          tmpvar_11 = pow ((cos(val_10) + (half)1.0), val_10);
          tmpvar_9 = ((res_5 - (half)0.5) * tmpvar_11);
          res_5 = tmpvar_9;
        } else {
          if ((i_4 == 2.0)) {
            half3 tmpvar_12;
            half val_13;
            val_13 = ((_mtl_u._HueShift.z * (half)3.0) + (half)12.0);
            half tmpvar_14;
            tmpvar_14 = pow ((cos(val_13) + (half)1.0), val_13);
            tmpvar_12 = ((res_5 - (half)0.5) * tmpvar_14);
            res_5 = tmpvar_12;
          } else {
            half3 tmpvar_15;
            half val_16;
            val_16 = ((_mtl_u._LuminosityShift.x * (half)3.0) + (half)12.0);
            half tmpvar_17;
            tmpvar_17 = pow ((cos(val_16) + (half)1.0), val_16);
            tmpvar_15 = ((res_5 - (half)0.5) * tmpvar_17);
            res_5 = tmpvar_15;
          };
        };
      };
      i_4 += 1.0;
    };
    t_1.xyz = res_5;
  };
  half4 tmpvar_18;
  tmpvar_18.w = half(1.0);
  tmpvar_18.xyz = t_1.xyz;
  _mtl_o._fragData = tmpvar_18;
  return _mtl_o;
}


// stats: 37 alu 1 tex 7 flow
// inputs: 1
//  #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
// uniforms: 5 (total size: 40)
//  #0: _NumPasses (medium float) 1x1 [-1] loc 0
//  #1: _ContrastShift (medium float) 4x1 [-1] loc 8
//  #2: _SaturationShift (medium float) 4x1 [-1] loc 16
//  #3: _HueShift (low float) 4x1 [-1] loc 24
//  #4: _LuminosityShift (low float) 4x1 [-1] loc 32
// textures: 1
//  #0: _MainTex (low 2d) 0x0 [-1] loc 0