skia2/tests/sksl/shared/FunctionAnonymousParameters.glsl
John Stiles f604efbeb4 Add support for anonymous function parameters in SkSL.
Anonymous function parameters are now automatically assigned a name,
"_skAnonymousParamN", where N is the parameter index.

Change-Id: I87adcd51ed025c76ae2b333317f21b523a4632b4
Bug: skia:12769
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489538
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-28 20:47:05 +00:00

17 lines
395 B
GLSL

out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
struct S {
int i;
};
vec4 fnGreen_h4bf2(bool b, vec2 _skAnonymousParam1) {
return colorGreen;
}
vec4 fnRed_h4ifS(int _skAnonymousParam0, float f, S _skAnonymousParam2) {
return colorRed;
}
vec4 main() {
return bool(colorGreen.y) ? fnGreen_h4bf2(true, coords) : fnRed_h4ifS(123, 3.1400001049041748, S(0));
}