• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*#pragma settings RewriteMatrixComparisons*/
2
3// This is patterned on MatrixEquality.sksl.
4uniform half4 colorGreen, colorRed;
5uniform half2x2 testHalf2x2;
6uniform float2x2 testFloat2x2;
7uniform half3x3 testHalf3x3;
8uniform float4x2 testFloat4x2;
9
10bool test_equality() {
11    bool ok = true;
12    ok = ok && testHalf2x2 == half2x2(1,2,3,4);
13    ok = ok && testFloat2x2 == half2x2(5,6,7,8);
14    ok = ok && testHalf2x2 != half2x2(123);
15    ok = ok && testFloat2x2 != half2x2(456);
16    ok = ok && testHalf3x3 == half3x3(1,2,3,4,5,6,7,8,9);
17    ok = ok && testFloat4x2 != float4x2(1,2,3,4,5,6,7,8);
18    return ok;
19}
20
21half4 main(float2 coords) {
22    return test_equality() ? colorGreen : colorRed;
23}
24