skia2/resources/sksl/workarounds/RewriteMatrixComparisons.sksl
John Stiles 5ee369f623 Rename caps bit for matrix comparison rewrites.
This was originally designated for 2x2 matrices only, but this was not
right--all matrix comparisons actually need to be rewritten to fully
work around the bug.

Change-Id: I743d16a65bc55e93361a3dd8753653384583f063
Bug: skia:11308
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411416
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-21 22:31:53 +00:00

24 lines
694 B
Plaintext

/*#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;
}