skia2/tests/sksl/inliner/SwizzleCanBeInlinedDirectly.sksl
John Stiles 59b2a92c96 Add new unit tests for SkSL.
These cover:
- Properly configured out-params
- Invalid/non-lvalue out-params, which currently cause an SkSL crash
- Interactions between the inliner and variable swizzles

Change-Id: I4874101236084f273e704d8717149b431d813883
Bug: skia:10753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319036
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-23 20:30:47 +00:00

20 lines
291 B
Plaintext

uniform half4 inColor;
half4 flip(half4 v) {
return v.wzyx;
}
void mutating_flip(out half4 v) {
v = v.wzyx;
}
void main() {
half4 color = inColor;
sk_FragColor = color.xyzy.wzyx;
sk_FragColor = flip(color.xyzy);
mutating_flip(color);
sk_FragColor = color;
}