• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 testInputs;
2uniform half4 colorGreen, colorRed;
3
4half4 main(float2 coords) {
5    int4 intValues = int4(testInputs * 100);
6    int4 intGreen  = int4(colorGreen * 100);
7
8    int4 expectedA = int4(-125, 0, 50, 50);
9    int4 expectedB = int4(-125, 0, 0, 100);
10    return (min(intValues.x,    50)            == expectedA.x     &&
11            min(intValues.xy,   50)            == expectedA.xy    &&
12            min(intValues.xyz,  50)            == expectedA.xyz   &&
13            min(intValues.xyzw, 50)            == expectedA.xyzw  &&
14            min(intValues.x,    intGreen.x)    == expectedB.x     &&
15            min(intValues.xy,   intGreen.xy)   == expectedB.xy    &&
16            min(intValues.xyz,  intGreen.xyz)  == expectedB.xyz   &&
17            min(intValues.xyzw, intGreen.xyzw) == expectedB.xyzw) ? colorGreen : colorRed;
18}
19