skia2/resources/sksl/runtime_errors/InvalidBlendMain.rtb
John Stiles f7f36ae077 Add ProgramKind::kRuntimeBlend for Runtime Blend functions.
Runtime Blend effects always take two input colors--source and
destination--instead of one. This CL adds a new ProgramKind for blend
effects, a new program module (empty for now), and adds a test to
confirm that the signature for blend functions is checked. Currently
these are only accessible via skslc; there's no Runtime Effect API to
create one and the dest color isn't hooked up to anything.

Change-Id: I5272a811d2d76b878cfdf3429efa78c9c8b3fd97
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416798
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-08 19:34:39 +00:00

12 lines
442 B
Plaintext

// Runtime blend modes require specific main signatures.
// Ensure that signatures intended for other runtime effect types don't work.
// Expect 4 errors
half4 main() { return half4(1); }
half4 main(half4 src) { return src; }
half4 main(half2 coords, half4 src) { return src; }
half4 main(half2 coords, half4 src, half4 dst) { return src * dst; }
half4 main(half4 src, half4 dst) { return src * dst; } // the correct signature is allowed