skia2/resources/sksl/shared/FunctionAnonymousParameters.sksl
John Stiles 1c7d442b52 Add test containing anonymous function parameters.
SkSL will reject ES2-compatible code because function parameters always
require a name in SkSL. (A followup CL relaxes this restriction and
allows anonymous parameters in SkSL.)

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

16 lines
282 B
Plaintext

uniform half4 colorGreen, colorRed;
struct S { int i; };
half4 fnGreen(bool b, float2) {
return colorGreen;
}
half4 fnRed(int, float f, S) {
return colorRed;
}
half4 main(float2 coords) {
return bool(colorGreen.g) ? fnGreen(true, coords) : fnRed(123, 3.14, S(0));
}