skia2/resources/sksl/runtime_errors/IllegalShaderUse.rte
Brian Osman 5c62582874 Require that runtime effect child variables are 'uniform'
Bug: skia:11374
Change-Id: I63d605eabbe514a0469d00d8a671969874f3edd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393081
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-04-07 13:16:28 +00:00

17 lines
557 B
Plaintext

// Expect >= 7 errors (currently 9, due to double-reporting)
// Correct declaration (used in some test functions)
uniform shader s1;
uniform shader s2;
// Incorrect shader declarations (they must be uniform)
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); }