skia2/resources/sksl/intrinsics/CrossNoInline.sksl
Brian Osman fde20db7ca Rename SkSL's 2D cross product builtin function
Note that the 2D cross product isn't defined. There are at least two
possible interpretations of what that might mean. This name makes it
clearer that we're asking for the length of the resulting vector, if
we computed the 3D cross product (assuming Z == 0 for both vectors).

It also eliminates name overlap between builtin functions and actual
intrinsics.

Change-Id: I24e8bc0ab2ec91aaace20f0dd3e8565c10bd44a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484440
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-14 22:00:26 +00:00

9 lines
191 B
Plaintext

/*#pragma settings NoInline*/
uniform half2 ah, bh;
uniform float2 af, bf;
void main() {
sk_FragColor.x = cross_length_2d(ah, bh);
sk_FragColor.y = half(cross_length_2d(af, bf));
}