summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt
blob: aff9cd484d447e039585270470839d1de0e7fa69 (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
#include <metal_stdlib>
using namespace metal;
struct xlatMtlShaderInput {
  float4 xlv_TEXCOORD0;
};
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(0.0, 0.0, 0.0, 0.0));
  float tmpvar_2;
  if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
    tmpvar_2 = 0.9;
  } else {
    tmpvar_2 = 0.1;
  };
  c_1 = half4(float4(tmpvar_2));
  float4 tmpvar_3;
  if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
    tmpvar_3 = float4(0.9, 0.9, 0.9, 0.9);
  } else {
    tmpvar_3 = float4(0.1, 0.1, 0.1, 0.1);
  };
  c_1 = ((half4)(float4(tmpvar_2) + tmpvar_3));
  float3 tmpvar_4;
  if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
    tmpvar_4 = float3(0.9, 0.9, 0.9);
  } else {
    tmpvar_4 = float3(0.1, 0.1, 0.1);
  };
  c_1.xyz = (c_1.xyz + (half3)tmpvar_4);
  float2 tmpvar_5;
  if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
    tmpvar_5 = float2(0.9, 0.9);
  } else {
    tmpvar_5 = float2(0.1, 0.1);
  };
  c_1.xy = (c_1.xy + (half2)tmpvar_5);
  float tmpvar_6;
  tmpvar_6 = fract(_mtl_i.xlv_TEXCOORD0.x);
  float tmpvar_7;
  if (bool(tmpvar_6)) {
    tmpvar_7 = 0.9;
  } else {
    tmpvar_7 = 0.1;
  };
  c_1.x = (c_1.x + (half)tmpvar_7);
  _mtl_o._fragData = c_1;
  return _mtl_o;
}


// stats: 21 alu 0 tex 5 flow
// inputs: 1
//  #0: xlv_TEXCOORD0 (high float) 4x1 [-1]