skia2/resources/sksl/shared/GeometricIntrinsics.sksl
John Stiles bfc9be0f77 Migrate SkSL test inputs to the resources/ directory.
This will allow us to load these inputs for unit testing in `dm`.

Change-Id: Id256ba7c30d3ec94b98048e47af44cf9efe580d5
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357282
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 18:57:29 +00:00

22 lines
423 B
Plaintext

float scalar(float x, float y) {
x = length(x);
x = distance(x, y);
x = dot(x, y);
x = normalize(x);
return x;
}
float2 vector(float2 x, float2 y) {
x = length(x).xx;
x = distance(x, y).xx;
x = dot(x, y).xx;
x = normalize(x);
return x;
}
void main() {
float x = scalar(1, 2);
float2 y = vector(float2(1, 2), float2(3, 4));
sk_FragColor = half4(half(x), half2(y), 1);
}