xref: /aosp_15_r20/external/skia/resources/sksl/workarounds/BuiltinDeterminantSupport.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1/*#pragma settings NoBuiltinDeterminantSupport*/
2
3uniform float2x2 testMatrix2x2;
4uniform half4 colorGreen, colorRed;
5
6half4 main(float2 coords) {
7    return (determinant(testMatrix2x2) == -2 &&
8            determinant(half3x3(1, 2, 3, 4, 5, 6, 7, 8, 10)) == -3 &&
9            determinant(float4x4(1, 2, 3, 4, 5, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17)) == -16)
10                ? colorGreen : colorRed;
11}
12