skia2/tests/sksl/blend/golden/BlendLuminosityStandaloneSettings.glsl
John Stiles fa9a08369e Remove unnecessary Blocks from the inliner.
If we aren't wrapping the inlined function body in a loop, there's no
need to add a scopeless Block; we've already got one. This doesn't
affect the final output meaningfully--it just suppresses a newline--but
it's one fewer IRNode allocation.

Change-Id: Ib7b0014e908586d8acfcf6c23520873fad31d0b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345163
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-17 19:35:35 +00:00

30 lines
1.3 KiB
GLSL

out vec4 sk_FragColor;
in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_luminosity;
float _1_alpha = dst.w * src.w;
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_luminance;
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _6_lum = _5_blend_color_luminance;
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
vec3 _8_result = (_6_lum - _7_blend_color_luminance) + _3_dsa;
float _9_minComp = min(min(_8_result.x, _8_result.y), _8_result.z);
float _10_maxComp = max(max(_8_result.x, _8_result.y), _8_result.z);
if (_9_minComp < 0.0 && _6_lum != _9_minComp) {
_8_result = _6_lum + ((_8_result - _6_lum) * _6_lum) / (_6_lum - _9_minComp);
}
_4_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _6_lum ? _6_lum + ((_8_result - _6_lum) * (_1_alpha - _6_lum)) / (_10_maxComp - _6_lum) : _8_result;
_0_blend_luminosity = vec4((((_4_blend_set_color_luminance + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
sk_FragColor = _0_blend_luminosity;
}