• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 colorGreen, colorRed, colorBlack, colorWhite, testInputs;
2
3half4 main(float2 coords) {
4    half4 expectedBW = half4(0.5, 0.5, 0.5, 1);
5    half4 expectedWT = half4(1,   0.5, 1,   2.25);
6
7    return (mix(colorGreen,      colorRed,        0)                   == half4(0,    1,    0, 1) &&
8            mix(colorGreen,      colorRed,        0.25)                == half4(0.25, 0.75, 0, 1) &&
9            mix(colorGreen,      colorRed,        0.75)                == half4(0.75, 0.25, 0, 1) &&
10            mix(colorGreen,      colorRed,        1)                   == half4(1,    0,    0, 1) &&
11            mix(colorBlack.x,    colorWhite.x,    0.5)                 == expectedBW.x            &&
12            mix(colorBlack.xy,   colorWhite.xy,   0.5)                 == expectedBW.xy           &&
13            mix(colorBlack.xyz,  colorWhite.xyz,  0.5)                 == expectedBW.xyz          &&
14            mix(colorBlack.xyzw, colorWhite.xyzw, 0.5)                 == expectedBW.xyzw         &&
15            mix(colorWhite.x,    testInputs.x,    0)                   == expectedWT.x            &&
16            mix(colorWhite.xy,   testInputs.xy,   half2(0, 0.5))       == expectedWT.xy           &&
17            mix(colorWhite.xyz,  testInputs.xyz,  half3(0, 0.5, 0))    == expectedWT.xyz          &&
18            mix(colorWhite.xyzw, testInputs.xyzw, half4(0, 0.5, 0, 1)) == expectedWT.xyzw)
19                ? colorGreen : colorRed;
20}
21