• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 pos1, pos2;
2uniform half4 colorGreen, colorRed;
3
4half4 main(float2 coords) {
5    const half4 constPos1 = half4(8, -3, 4, 14);
6    const half4 constPos2 = half4(5, -3, 0, 2);
7    half4 expected = half4(3, 3, 5, 13);
8
9    return (distance(pos1.x,         pos2.x)         == expected.x &&
10            distance(pos1.xy,        pos2.xy)        == expected.y &&
11            distance(pos1.xyz,       pos2.xyz)       == expected.z &&
12            distance(pos1.xyzw,      pos2.xyzw)      == expected.w &&
13            distance(constPos1.x,    constPos2.x)    == expected.x &&
14            distance(constPos1.xy,   constPos2.xy)   == expected.y &&
15            distance(constPos1.xyz,  constPos2.xyz)  == expected.z &&
16            distance(constPos1.xyzw, constPos2.xyzw) == expected.w) ? colorGreen : colorRed;
17}
18