skia2/resources/sksl/shared/Functions.sksl

21 lines
317 B
Plaintext
Raw Normal View History

/*#pragma settings NoInline*/
uniform half4 colorGreen, colorRed;
float foo(float2 v) {
return v.x * v.y;
}
void bar(inout float x) {
float y[2];
y[0] = x;
y[1] = x * 2;
x = foo(float2(y[0], y[1]));
}
half4 main() {
float x = 10;
bar(x);
return x == 200 ? colorGreen : colorRed;
}