601abfacc7
Also adds tests of non-uniform shader declarations. These are currently allowed, but will be detected as an error in the next CL. Bug: skia:11374 Change-Id: I3fee0a0c97ae590f7bc6952cb367f7e94436b891 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393080 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
18 lines
578 B
Plaintext
18 lines
578 B
Plaintext
// Expect 5 errors
|
|
|
|
// Correct declaration (used in some test functions)
|
|
uniform shader s1;
|
|
uniform shader s2;
|
|
|
|
// Incorrect shader declarations (they must be uniform)
|
|
// TODO(skbug.com/11374): These are not detected as errors yet
|
|
shader s3;
|
|
in shader s4;
|
|
|
|
// Various places that shaders should not be allowed:
|
|
half4 local() { shader s; return sample(s); }
|
|
half4 parameter(shader s) { return sample(s); }
|
|
shader returned() { return s1; }
|
|
half4 constructed() { return sample(shader(s1)); }
|
|
half4 expression(bool b) { return sample(b ? s1 : s2); }
|