skia2/resources/sksl/workarounds/RewriteMatrixComparisons.sksl

24 lines
694 B
Plaintext
Raw Normal View History

/*#pragma settings RewriteMatrixComparisons*/
// This is patterned on MatrixEquality.sksl.
uniform half4 colorGreen, colorRed;
uniform half2x2 testHalf2x2;
uniform float2x2 testFloat2x2;
uniform half3x3 testHalf3x3;
uniform float4x2 testFloat4x2;
bool test_equality() {
bool ok = true;
ok = ok && testHalf2x2 == half2x2(1,2,3,4);
ok = ok && testFloat2x2 == half2x2(5,6,7,8);
ok = ok && testHalf2x2 != half2x2(123);
ok = ok && testFloat2x2 != half2x2(456);
ok = ok && testHalf3x3 == half3x3(1,2,3,4,5,6,7,8,9);
ok = ok && testFloat4x2 != float4x2(1,2,3,4,5,6,7,8);
return ok;
}
half4 main(float2 coords) {
return test_equality() ? colorGreen : colorRed;
}