• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 colorRed, colorGreen;
2uniform half unknownInput;
3
4bool test() {
5    bool ok = true;
6    ok = ok &&  (float2x2(float2(1.0, 0.0), float2(0.0, 1.0)) ==
7                 float2x2(float2(1.0, 0.0), float2(0.0, 1.0)));
8    ok = ok && !(float2x2(float2(1.0, 0.0), float2(1.0, 1.0)) ==
9                 float2x2(float2(1.0, 0.0), float2(0.0, 1.0)));
10
11    ok = ok &&  ( float2x2(1)  == float2x2(1));
12    ok = ok && !( float2x2(1)  == float2x2(0));
13    ok = ok &&  ( float2x2(-1) == -float2x2(1));
14    ok = ok &&  ( float2x2(0)  == -float2x2(0));
15    ok = ok &&  (-float2x2(-1) ==  float2x2(1));
16    ok = ok &&  (-float2x2(0)  == -float2x2(-0));
17
18    ok = ok &&  (float2x2(1) == float2x2(float2(1.0, 0.0), float2(0.0, 1.0)));
19    ok = ok && !(float2x2(2) == float2x2(float2(1.0, 0.0), float2(0.0, 1.0)));
20
21    ok = ok && !(float2x2(1) != float2x2(1));
22    ok = ok &&  (float2x2(1) != float2x2(0));
23    ok = ok &&  (float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)) ==
24                 float3x3(float2x2(1.0)));
25    ok = ok &&  (float3x3(float3(9.0, 0.0, 0.0), float3(0.0, 9.0, 0.0), float3(0.0, 0.0, 1.0)) ==
26                 float3x3(float2x2(9.0)));
27    ok = ok &&  (float3x3(unknownInput) == float3x3(float2x2(1.0)));
28    ok = ok &&  (float3x3(float3(9).x00, float3(9).0x0, float3(unknownInput).00x) ==
29                 float3x3(float2x2(9.0)));
30    ok = ok &&  (float2x2(float3x3(1.0)) == float2x2(1.0));
31    ok = ok &&  (float2x2(float3x3(1.0)) == float2x2(1.0));
32    ok = ok &&  (float2x2(float4(1.0, 0.0, 0.0, 1.0)) == float2x2(1.0));
33    ok = ok &&  (float2x2(1.0, 0.0, float2(0.0, 1.0)) == float2x2(1.0));
34    ok = ok &&  (float2x2(float2(1.0, 0.0), 0.0, 1.0) == float2x2(1.0));
35    return ok;
36}
37
38half4 main(float2 coords) {
39    return test() ? colorGreen : colorRed;
40}
41