Simplify generated GLSL code for trivial FPs.
By using `return` directly instead of creating a temporary `_output`
variable, we generate less code and simplify the final GLSL output.
In the case of OverrideInputFragmentProcessor, the ternary expression
is performed on a `layout(key)` bool and will always be optimized away.
Before:
vec4 _10_ConstColorProcessor_Stage1_c0;
{
vec4 _12_output;
_12_output = ucolor_Stage1_c0;
_10_ConstColorProcessor_Stage1_c0 = _12_output;
}
After:
vec4 _8_ConstColorProcessor_Stage1_c0;
{
_8_ConstColorProcessor_Stage1_c0 = ucolor_Stage1_c0;
}
Change-Id: Ic3fd446345aa73e3936d1759443b80b41f5468f0
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320962
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
4 files changed