• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 colorGreen, colorRed, colorBlack, colorWhite, testInputs;
2
3half4 main(float2 coords) {
4    int4 intGreen  = int4(colorGreen * 100);
5    int4 intRed    = int4(colorRed   * 100);
6    const int4 constIGreen  = int4(0, 100, 0, 100);
7    const int4 constIRed    = int4(100, 0, 0, 100);
8    const half4 constGreen  = half4(0, 1, 0, 1);
9    const half4 constRed    = half4(1, 0, 0, 1);
10
11    return (mix(intGreen.x,       intRed.x,       false)        == intGreen.x      &&
12            mix(intGreen.xy,      intRed.xy,      bool2(false)) == intGreen.xy     &&
13            mix(intGreen.xyz,     intRed.xyz,     bool3(false)) == intGreen.xyz    &&
14            mix(intGreen.xyzw,    intRed.xyzw,    bool4(false)) == intGreen.xyzw   &&
15            mix(intGreen.x,       intRed.x,       true)         == intRed.x        &&
16            mix(intGreen.xy,      intRed.xy,      bool2(true))  == intRed.xy       &&
17            mix(intGreen.xyz,     intRed.xyz,     bool3(true))  == intRed.xyz      &&
18            mix(intGreen.xyzw,    intRed.xyzw,    bool4(true))  == intRed.xyzw     &&
19            mix(constIGreen.x,    constIRed.x,    false)        == intGreen.x      &&
20            mix(constIGreen.xy,   constIRed.xy,   bool2(false)) == intGreen.xy     &&
21            mix(constIGreen.xyz,  constIRed.xyz,  bool3(false)) == intGreen.xyz    &&
22            mix(constIGreen.xyzw, constIRed.xyzw, bool4(false)) == intGreen.xyzw   &&
23            mix(constIGreen.x,    constIRed.x,    true)         == intRed.x        &&
24            mix(constIGreen.xy,   constIRed.xy,   bool2(true))  == intRed.xy       &&
25            mix(constIGreen.xyz,  constIRed.xyz,  bool3(true))  == intRed.xyz      &&
26            mix(constIGreen.xyzw, constIRed.xyzw, bool4(true))  == intRed.xyzw     &&
27            mix(colorGreen.x,     colorRed.x,     false)        == colorGreen.x    &&
28            mix(colorGreen.xy,    colorRed.xy,    bool2(false)) == colorGreen.xy   &&
29            mix(colorGreen.xyz,   colorRed.xyz,   bool3(false)) == colorGreen.xyz  &&
30            mix(colorGreen.xyzw,  colorRed.xyzw,  bool4(false)) == colorGreen.xyzw &&
31            mix(colorGreen.x,     colorRed.x,     true)         == colorRed.x      &&
32            mix(colorGreen.xy,    colorRed.xy,    bool2(true))  == colorRed.xy     &&
33            mix(colorGreen.xyz,   colorRed.xyz,   bool3(true))  == colorRed.xyz    &&
34            mix(colorGreen.xyzw,  colorRed.xyzw,  bool4(true))  == colorRed.xyzw   &&
35            mix(constGreen.x,     constRed.x,     false)        == colorGreen.x    &&
36            mix(constGreen.xy,    constRed.xy,    bool2(false)) == colorGreen.xy   &&
37            mix(constGreen.xyz,   constRed.xyz,   bool3(false)) == colorGreen.xyz  &&
38            mix(constGreen.xyzw,  constRed.xyzw,  bool4(false)) == colorGreen.xyzw &&
39            mix(constGreen.x,     constRed.x,     true)         == colorRed.x      &&
40            mix(constGreen.xy,    constRed.xy,    bool2(true))  == colorRed.xy     &&
41            mix(constGreen.xyz,   constRed.xyz,   bool3(true))  == colorRed.xyz    &&
42            mix(constGreen.xyzw,  constRed.xyzw,  bool4(true))  == colorRed.xyzw) ? colorGreen
43                                                                                  : colorRed;
44}
45
46