• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 testInputs;  // -1.25, 0, 0.75, 2.25
2uniform half4 colorGreen, colorRed;
3
4half4 main(float2 coords) {
5    const float4 expectedA = half4(-1.0, 0.0, 0.0, 2.0);
6
7    const float4 constVal = half4(-6.75, -0.5, 3.5, 1.25);
8    const float4 expectedB = half4(-6.0, -0.0, 3.0, 1.0);
9    return (trunc(testInputs.x)    == expectedA.x     &&
10            trunc(testInputs.xy)   == expectedA.xy    &&
11            trunc(testInputs.xyz)  == expectedA.xyz   &&
12            trunc(testInputs.xyzw) == expectedA.xyzw  &&
13            trunc(constVal.x)      == expectedB.x     &&
14            trunc(constVal.xy)     == expectedB.xy    &&
15            trunc(constVal.xyz)    == expectedB.xyz   &&
16            trunc(constVal.xyzw)   == expectedB.xyzw) ? colorGreen : colorRed;
17}
18