skia2/tests/sksl/intrinsics/MatrixCompMult.sksl
John Stiles d06d4a983f Fix matrixCompMult halfNxM implementation and add unit tests.
The existing code didn't work properly with half types since the $mat
type encompassed both halfNxM and floatNxM. This was fixed by splitting
the half types out of $mat into a separate $matH generic.

Unit tests now compile properly for GLSL, but generate errors in SPIR-V
and generate Metal code which attempts to call a non-existent intrinsic.

Change-Id: I2fff10f0dd7f00534bf6b1d5b13354543694194e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342926
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-10 20:51:59 +00:00

7 lines
144 B
Plaintext

half3x3 a, b;
float4x4 c, d;
void main() {
sk_FragColor.xyz = matrixCompMult(a, b)[0];
sk_FragColor = half4(matrixCompMult(c, d)[0]);
}