skia2/tests/sksl
John Stiles 1a49a5334c Restructure blend functions to allow for smarter inlining.
Early returns can cause the inliner to generate suboptimal code. We
control our built-ins, so let's avoid them where we can.

Patterns like this challenge the inliner:
    if (x) return y;
    return z;

But this can be replaced by equivalent code that inlines better:
    return x ? y : z;

Or, if a ternary can't be used, this also does a better job:
    if (x) return y;
    else return z;

In several cases, this allows the inliner to avoid generating a
do-while(false) block for control flow.

Change-Id: I921c929122297c40476ff15b4da631fc1581e308
Bug: skia:10737
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318211
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-21 22:42:01 +00:00
..
blend Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
errors Migrate SkSL error tests to golden outputs. 2020-09-18 13:46:17 +00:00
fp Revert "Remove inliner from IR generation stage." 2020-09-19 12:47:25 +00:00
glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
inliner Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
workarounds Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00