Fix call counts for intrinsic functions.

This allows dead-stripping to properly optimize away unreferenced clones
of intrinsic functions, and allows the inliner to detect intrinsic
functions that are only called once (which can generally always be
inlined without penalty).

Change-Id: I0cf034d880ae5d52f4cc0f93de6e2c7aad34e975
Bug: skia:10776
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320258
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2020-09-28 13:13:40 -04:00 committed by Skia Commit-Bot
parent e41b4ee49e
commit bc0c29ead3
88 changed files with 888 additions and 1257 deletions

View File

@ -96,6 +96,15 @@ static void grab_intrinsics(std::vector<std::unique_ptr<ProgramElement>>* src,
}
}
static void reset_call_counts(std::vector<std::unique_ptr<ProgramElement>>* src) {
for (std::unique_ptr<ProgramElement>& element : *src) {
if (element->is<FunctionDefinition>()) {
const FunctionDeclaration& fnDecl = element->as<FunctionDefinition>().fDeclaration;
fnDecl.fCallCount = 0;
}
}
}
Compiler::Compiler(Flags flags)
: fGPUIntrinsics(std::make_unique<IRIntrinsicMap>(/*parent=*/nullptr))
, fInterpreterIntrinsics(std::make_unique<IRIntrinsicMap>(/*parent=*/nullptr))
@ -266,6 +275,15 @@ Compiler::Compiler(Flags flags)
fFragmentInclude = rehydrator.elements();
}
#endif
// Call counts are used to track dead-stripping and inlinability within the program being
// currently compiled, and always should start at zero for a new program. Zero out any call
// counts that were registered during the assembly of the intrinsics/include data. (If we
// actually use calls from inside the intrinsics, we will clone them into the program and they
// will get new call counts.)
reset_call_counts(&gpuIntrinsics);
reset_call_counts(&fVertexInclude);
reset_call_counts(&fFragmentInclude);
grab_intrinsics(&gpuIntrinsics, fGPUIntrinsics.get());
SkASSERT(gpuIntrinsics.empty());
}

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_clear(vec4 src, vec4 dst) {
return vec4(0.0);
}
void main() {
sk_FragColor = vec4(0.0);

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_clear(float4 src, float4 dst) {
return float4(0.0);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_clear(vec4 src, vec4 dst) {
return vec4(0.0);
}
void main() {
sk_FragColor = vec4(0.0);

View File

@ -1,42 +1,35 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
vec4 blend_color(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(sda, alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
vec4 _0_blend_color;
{
float _1_alpha = dst.w * src.w;
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
_0_blend_color = vec4((((_blend_set_color_luminance(_2_sda, _1_alpha, _3_dsa) + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
vec3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
vec3 _8_result = (_7_lum - _12_blend_color_luminance) + _2_sda;
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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_color = vec4((((_6_blend_set_color_luminance + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
}
sk_FragColor = _0_blend_color;

View File

@ -8,35 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_color_luminance(float3 color) {
return dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
float3 _blend_set_color_luminance(float3 hueSatColor, float alpha, float3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
float3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float4 blend_color(float4 src, float4 dst) {
float alpha = dst.w * src.w;
float3 sda = src.xyz * dst.w;
float3 dsa = dst.xyz * src.w;
return float4((((_blend_set_color_luminance(sda, alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
@ -45,7 +16,29 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float _1_alpha = _in.dst.w * _in.src.w;
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
_0_blend_color = float4((((_blend_set_color_luminance(_2_sda, _1_alpha, _3_dsa) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
float3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
float3 _8_result = (_7_lum - _12_blend_color_luminance) + _2_sda;
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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_color = float4((((_6_blend_set_color_luminance + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
}
_out->sk_FragColor = _0_blend_color;

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_burn_component(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
@ -21,9 +18,6 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
vec4 blend_color_burn(vec4 src, vec4 dst) {
return vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_color_burn;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_burn_component(float2 s, float2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
@ -28,9 +25,6 @@ float _color_burn_component(float2 s, float2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
float4 blend_color_burn(float4 src, float4 dst) {
return float4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_burn_component(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
@ -21,9 +18,6 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
vec4 blend_color_burn(vec4 src, vec4 dst) {
return vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_color_burn;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_dodge_component(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
@ -23,9 +20,6 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
vec4 blend_color_dodge(vec4 src, vec4 dst) {
return vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_color_dodge;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_dodge_component(float2 s, float2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
@ -30,9 +27,6 @@ float _color_dodge_component(float2 s, float2 d) {
}
}
}
float4 blend_color_dodge(float4 src, float4 dst) {
return float4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _color_dodge_component(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
@ -23,9 +20,6 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
vec4 blend_color_dodge(vec4 src, vec4 dst) {
return vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_color_dodge;
{

View File

@ -1,42 +1,35 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
vec4 blend_color(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(sda, alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
vec4 _0_blend_color;
{
float _1_alpha = dst.w * src.w;
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
_0_blend_color = vec4((((_blend_set_color_luminance(_2_sda, _1_alpha, _3_dsa) + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
vec3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
vec3 _8_result = (_7_lum - _12_blend_color_luminance) + _2_sda;
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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_color = vec4((((_6_blend_set_color_luminance + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
}
sk_FragColor = _0_blend_color;

View File

@ -1,19 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
vec4 blend_darken(vec4 src, vec4 dst) {
vec4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
vec4 result = _2_blend_src_over;
result.xyz = min(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
void main() {
vec4 _0_blend_darken;
{

View File

@ -8,19 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_over(float4 src, float4 dst) {
return src + (1.0 - src.w) * dst;
}
float4 blend_darken(float4 src, float4 dst) {
float4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
float4 result = _2_blend_src_over;
result.xyz = min(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,19 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
vec4 blend_darken(vec4 src, vec4 dst) {
vec4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
vec4 result = _2_blend_src_over;
result.xyz = min(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
void main() {
vec4 _0_blend_darken;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_difference(vec4 src, vec4 dst) {
return vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_difference;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_difference(float4 src, float4 dst) {
return float4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_difference(vec4 src, vec4 dst) {
return vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_difference;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst(vec4 src, vec4 dst) {
return dst;
}
void main() {
vec4 _0_blend_dst;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_dst(float4 src, float4 dst) {
return dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_atop(vec4 src, vec4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_atop;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_atop(float4 src, float4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_atop(vec4 src, vec4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_atop;
{

View File

@ -1,17 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_in(vec4 src, vec4 dst) {
return src * dst.w;
}
vec4 blend_dst_in(vec4 src, vec4 dst) {
vec4 _1_blend_src_in;
{
_1_blend_src_in = dst * src.w;
}
return _1_blend_src_in;
}
void main() {
vec4 _0_blend_dst_in;
{

View File

@ -8,17 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_in(float4 src, float4 dst) {
return src * dst.w;
}
float4 blend_dst_in(float4 src, float4 dst) {
float4 _1_blend_src_in;
{
_1_blend_src_in = dst * src.w;
}
return _1_blend_src_in;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,17 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_in(vec4 src, vec4 dst) {
return src * dst.w;
}
vec4 blend_dst_in(vec4 src, vec4 dst) {
vec4 _1_blend_src_in;
{
_1_blend_src_in = dst * src.w;
}
return _1_blend_src_in;
}
void main() {
vec4 _0_blend_dst_in;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst_out(vec4 src, vec4 dst) {
return (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_dst_out;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_dst_out(float4 src, float4 dst) {
return (1.0 - src.w) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst_out(vec4 src, vec4 dst) {
return (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_dst_out;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst_over(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src + dst;
}
void main() {
vec4 _0_blend_dst_over;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_dst_over(float4 src, float4 dst) {
return (1.0 - dst.w) * src + dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst_over(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src + dst;
}
void main() {
vec4 _0_blend_dst_over;
{

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_dst(vec4 src, vec4 dst) {
return dst;
}
void main() {
vec4 _0_blend_dst;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_exclusion(vec4 src, vec4 dst) {
return vec4((dst.xyz + src.xyz) - (2.0 * dst.xyz) * src.xyz, src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_exclusion;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_exclusion(float4 src, float4 dst) {
return float4((dst.xyz + src.xyz) - (2.0 * dst.xyz) * src.xyz, src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_exclusion(vec4 src, vec4 dst) {
return vec4((dst.xyz + src.xyz) - (2.0 * dst.xyz) * src.xyz, src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_exclusion;
{

View File

@ -1,42 +1,38 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_overlay_component(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
float _1_blend_overlay_component;
vec2 _2_s = src.xw;
vec2 _3_d = dst.xw;
{
_1_blend_overlay_component = 2.0 * _3_d.x <= _3_d.y ? (2.0 * _2_s.x) * _3_d.x : _2_s.y * _3_d.y - (2.0 * (_3_d.y - _3_d.x)) * (_2_s.y - _2_s.x);
}
float _4_blend_overlay_component;
vec2 _5_s = src.yw;
vec2 _6_d = dst.yw;
{
_4_blend_overlay_component = 2.0 * _6_d.x <= _6_d.y ? (2.0 * _5_s.x) * _6_d.x : _5_s.y * _6_d.y - (2.0 * (_6_d.y - _6_d.x)) * (_5_s.y - _5_s.x);
}
float _7_blend_overlay_component;
vec2 _8_s = src.zw;
vec2 _9_d = dst.zw;
{
_7_blend_overlay_component = 2.0 * _9_d.x <= _9_d.y ? (2.0 * _8_s.x) * _9_d.x : _8_s.y * _9_d.y - (2.0 * (_9_d.y - _9_d.x)) * (_8_s.y - _8_s.x);
}
vec4 result = vec4(_1_blend_overlay_component, _4_blend_overlay_component, _7_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
vec4 blend_hard_light(vec4 src, vec4 dst) {
return blend_overlay(dst, src);
}
void main() {
vec4 _0_blend_hard_light;
{
_0_blend_hard_light = blend_overlay(dst, src);
vec4 _7_blend_overlay;
{
float _9_blend_overlay_component;
vec2 _10_s = dst.xw;
vec2 _11_d = src.xw;
{
_9_blend_overlay_component = 2.0 * _11_d.x <= _11_d.y ? (2.0 * _10_s.x) * _11_d.x : _10_s.y * _11_d.y - (2.0 * (_11_d.y - _11_d.x)) * (_10_s.y - _10_s.x);
}
float _12_blend_overlay_component;
vec2 _13_s = dst.yw;
vec2 _14_d = src.yw;
{
_12_blend_overlay_component = 2.0 * _14_d.x <= _14_d.y ? (2.0 * _13_s.x) * _14_d.x : _13_s.y * _14_d.y - (2.0 * (_14_d.y - _14_d.x)) * (_13_s.y - _13_s.x);
}
float _15_blend_overlay_component;
vec2 _16_s = dst.zw;
vec2 _17_d = src.zw;
{
_15_blend_overlay_component = 2.0 * _17_d.x <= _17_d.y ? (2.0 * _16_s.x) * _17_d.x : _16_s.y * _17_d.y - (2.0 * (_17_d.y - _17_d.x)) * (_16_s.y - _16_s.x);
}
vec4 _8_result = vec4(_9_blend_overlay_component, _12_blend_overlay_component, _15_blend_overlay_component, dst.w + (1.0 - dst.w) * src.w);
_8_result.xyz += src.xyz * (1.0 - dst.w) + dst.xyz * (1.0 - src.w);
_7_blend_overlay = _8_result;
}
_0_blend_hard_light = _7_blend_overlay;
}
sk_FragColor = _0_blend_hard_light;

View File

@ -8,44 +8,40 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_overlay_component(float2 s, float2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
float4 blend_overlay(float4 src, float4 dst) {
float _1_blend_overlay_component;
float2 _2_s = src.xw;
float2 _3_d = dst.xw;
{
_1_blend_overlay_component = 2.0 * _3_d.x <= _3_d.y ? (2.0 * _2_s.x) * _3_d.x : _2_s.y * _3_d.y - (2.0 * (_3_d.y - _3_d.x)) * (_2_s.y - _2_s.x);
}
float _4_blend_overlay_component;
float2 _5_s = src.yw;
float2 _6_d = dst.yw;
{
_4_blend_overlay_component = 2.0 * _6_d.x <= _6_d.y ? (2.0 * _5_s.x) * _6_d.x : _5_s.y * _6_d.y - (2.0 * (_6_d.y - _6_d.x)) * (_5_s.y - _5_s.x);
}
float _7_blend_overlay_component;
float2 _8_s = src.zw;
float2 _9_d = dst.zw;
{
_7_blend_overlay_component = 2.0 * _9_d.x <= _9_d.y ? (2.0 * _8_s.x) * _9_d.x : _8_s.y * _9_d.y - (2.0 * (_9_d.y - _9_d.x)) * (_8_s.y - _8_s.x);
}
float4 result = float4(_1_blend_overlay_component, _4_blend_overlay_component, _7_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz = result.xyz + dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
float4 blend_hard_light(float4 src, float4 dst) {
return blend_overlay(dst, src);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 _0_blend_hard_light;
{
_0_blend_hard_light = blend_overlay(_in.dst, _in.src);
float4 _7_blend_overlay;
{
float _9_blend_overlay_component;
float2 _10_s = _in.dst.xw;
float2 _11_d = _in.src.xw;
{
_9_blend_overlay_component = 2.0 * _11_d.x <= _11_d.y ? (2.0 * _10_s.x) * _11_d.x : _10_s.y * _11_d.y - (2.0 * (_11_d.y - _11_d.x)) * (_10_s.y - _10_s.x);
}
float _12_blend_overlay_component;
float2 _13_s = _in.dst.yw;
float2 _14_d = _in.src.yw;
{
_12_blend_overlay_component = 2.0 * _14_d.x <= _14_d.y ? (2.0 * _13_s.x) * _14_d.x : _13_s.y * _14_d.y - (2.0 * (_14_d.y - _14_d.x)) * (_13_s.y - _13_s.x);
}
float _15_blend_overlay_component;
float2 _16_s = _in.dst.zw;
float2 _17_d = _in.src.zw;
{
_15_blend_overlay_component = 2.0 * _17_d.x <= _17_d.y ? (2.0 * _16_s.x) * _17_d.x : _16_s.y * _17_d.y - (2.0 * (_17_d.y - _17_d.x)) * (_16_s.y - _16_s.x);
}
float4 _8_result = float4(_9_blend_overlay_component, _12_blend_overlay_component, _15_blend_overlay_component, _in.dst.w + (1.0 - _in.dst.w) * _in.src.w);
_8_result.xyz = _8_result.xyz + _in.src.xyz * (1.0 - _in.dst.w) + _in.dst.xyz * (1.0 - _in.src.w);
_7_blend_overlay = _8_result;
}
_0_blend_hard_light = _7_blend_overlay;
}
_out->sk_FragColor = _0_blend_hard_light;

View File

@ -1,42 +1,38 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_overlay_component(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
float _1_blend_overlay_component;
vec2 _2_s = src.xw;
vec2 _3_d = dst.xw;
{
_1_blend_overlay_component = 2.0 * _3_d.x <= _3_d.y ? (2.0 * _2_s.x) * _3_d.x : _2_s.y * _3_d.y - (2.0 * (_3_d.y - _3_d.x)) * (_2_s.y - _2_s.x);
}
float _4_blend_overlay_component;
vec2 _5_s = src.yw;
vec2 _6_d = dst.yw;
{
_4_blend_overlay_component = 2.0 * _6_d.x <= _6_d.y ? (2.0 * _5_s.x) * _6_d.x : _5_s.y * _6_d.y - (2.0 * (_6_d.y - _6_d.x)) * (_5_s.y - _5_s.x);
}
float _7_blend_overlay_component;
vec2 _8_s = src.zw;
vec2 _9_d = dst.zw;
{
_7_blend_overlay_component = 2.0 * _9_d.x <= _9_d.y ? (2.0 * _8_s.x) * _9_d.x : _8_s.y * _9_d.y - (2.0 * (_9_d.y - _9_d.x)) * (_8_s.y - _8_s.x);
}
vec4 result = vec4(_1_blend_overlay_component, _4_blend_overlay_component, _7_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
vec4 blend_hard_light(vec4 src, vec4 dst) {
return blend_overlay(dst, src);
}
void main() {
vec4 _0_blend_hard_light;
{
_0_blend_hard_light = blend_overlay(dst, src);
vec4 _7_blend_overlay;
{
float _9_blend_overlay_component;
vec2 _10_s = dst.xw;
vec2 _11_d = src.xw;
{
_9_blend_overlay_component = 2.0 * _11_d.x <= _11_d.y ? (2.0 * _10_s.x) * _11_d.x : _10_s.y * _11_d.y - (2.0 * (_11_d.y - _11_d.x)) * (_10_s.y - _10_s.x);
}
float _12_blend_overlay_component;
vec2 _13_s = dst.yw;
vec2 _14_d = src.yw;
{
_12_blend_overlay_component = 2.0 * _14_d.x <= _14_d.y ? (2.0 * _13_s.x) * _14_d.x : _13_s.y * _14_d.y - (2.0 * (_14_d.y - _14_d.x)) * (_13_s.y - _13_s.x);
}
float _15_blend_overlay_component;
vec2 _16_s = dst.zw;
vec2 _17_d = src.zw;
{
_15_blend_overlay_component = 2.0 * _17_d.x <= _17_d.y ? (2.0 * _16_s.x) * _17_d.x : _16_s.y * _17_d.y - (2.0 * (_17_d.y - _17_d.x)) * (_16_s.y - _16_s.x);
}
vec4 _8_result = vec4(_9_blend_overlay_component, _12_blend_overlay_component, _15_blend_overlay_component, dst.w + (1.0 - dst.w) * src.w);
_8_result.xyz += src.xyz * (1.0 - dst.w) + dst.xyz * (1.0 - src.w);
_7_blend_overlay = _8_result;
}
_0_blend_hard_light = _7_blend_overlay;
}
sk_FragColor = _0_blend_hard_light;

View File

@ -1,100 +1,98 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(vec3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : vec3(0.0);
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
vec3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? vec3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : vec3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _4_blend_set_color_saturation_helper;
vec3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? vec3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
vec3 _6_blend_set_color_saturation_helper;
vec3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? vec3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _8_blend_set_color_saturation_helper;
vec3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? vec3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
vec3 _10_blend_set_color_saturation_helper;
vec3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? vec3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
vec3 _12_blend_set_color_saturation_helper;
vec3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? vec3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
vec4 blend_hue(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
sk_FragColor = blend_hue(src, dst);
vec4 _17_blend_hue;
{
float _18_alpha = dst.w * src.w;
vec3 _19_sda = src.xyz * dst.w;
vec3 _20_dsa = dst.xyz * src.w;
vec3 _21_blend_set_color_saturation;
vec3 _22_hueLumColor = _19_sda;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_20_dsa.x, _20_dsa.y), _20_dsa.z) - min(min(_20_dsa.x, _20_dsa.y), _20_dsa.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? vec3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _26_blend_set_color_saturation_helper;
vec3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? vec3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
vec3 _28_blend_set_color_saturation_helper;
vec3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? vec3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _30_blend_set_color_saturation_helper;
vec3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? vec3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _32_blend_set_color_saturation_helper;
vec3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? vec3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
vec3 _34_blend_set_color_saturation_helper;
vec3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? vec3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
vec3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
vec3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_hue = vec4((((_36_blend_set_color_luminance + dst.xyz) - _20_dsa) + src.xyz) - _19_sda, (src.w + dst.w) - _18_alpha);
}
sk_FragColor = _17_blend_hue;
}

View File

@ -8,103 +8,101 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_color_luminance(float3 color) {
return dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
float3 _blend_set_color_luminance(float3 hueSatColor, float alpha, float3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
float3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(float3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
float3 _blend_set_color_saturation_helper(float3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? float3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : float3(0.0);
}
float3 _blend_set_color_saturation(float3 hueLumColor, float3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
float3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? float3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : float3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
float3 _4_blend_set_color_saturation_helper;
float3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? float3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
float3 _6_blend_set_color_saturation_helper;
float3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? float3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
float3 _8_blend_set_color_saturation_helper;
float3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? float3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
float3 _10_blend_set_color_saturation_helper;
float3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? float3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
float3 _12_blend_set_color_saturation_helper;
float3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? float3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
float4 blend_hue(float4 src, float4 dst) {
float alpha = dst.w * src.w;
float3 sda = src.xyz * dst.w;
float3 dsa = dst.xyz * src.w;
return float4((((_blend_set_color_luminance(_blend_set_color_saturation(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = blend_hue(_in.src, _in.dst);
float4 _17_blend_hue;
{
float _18_alpha = _in.dst.w * _in.src.w;
float3 _19_sda = _in.src.xyz * _in.dst.w;
float3 _20_dsa = _in.dst.xyz * _in.src.w;
float3 _21_blend_set_color_saturation;
float3 _22_hueLumColor = _19_sda;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_20_dsa.x, _20_dsa.y), _20_dsa.z) - min(min(_20_dsa.x, _20_dsa.y), _20_dsa.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
float3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? float3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
float3 _26_blend_set_color_saturation_helper;
float3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? float3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
float3 _28_blend_set_color_saturation_helper;
float3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? float3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
float3 _30_blend_set_color_saturation_helper;
float3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? float3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
float3 _32_blend_set_color_saturation_helper;
float3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? float3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
float3 _34_blend_set_color_saturation_helper;
float3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? float3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
float3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
float3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_hue = float4((((_36_blend_set_color_luminance + _in.dst.xyz) - _20_dsa) + _in.src.xyz) - _19_sda, (_in.src.w + _in.dst.w) - _18_alpha);
}
_out->sk_FragColor = _17_blend_hue;
return *_out;
}

View File

@ -1,100 +1,98 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(vec3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : vec3(0.0);
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
vec3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? vec3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : vec3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _4_blend_set_color_saturation_helper;
vec3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? vec3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
vec3 _6_blend_set_color_saturation_helper;
vec3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? vec3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _8_blend_set_color_saturation_helper;
vec3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? vec3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
vec3 _10_blend_set_color_saturation_helper;
vec3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? vec3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
vec3 _12_blend_set_color_saturation_helper;
vec3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? vec3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
vec4 blend_hue(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
sk_FragColor = blend_hue(src, dst);
vec4 _17_blend_hue;
{
float _18_alpha = dst.w * src.w;
vec3 _19_sda = src.xyz * dst.w;
vec3 _20_dsa = dst.xyz * src.w;
vec3 _21_blend_set_color_saturation;
vec3 _22_hueLumColor = _19_sda;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_20_dsa.x, _20_dsa.y), _20_dsa.z) - min(min(_20_dsa.x, _20_dsa.y), _20_dsa.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? vec3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _26_blend_set_color_saturation_helper;
vec3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? vec3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
vec3 _28_blend_set_color_saturation_helper;
vec3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? vec3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _30_blend_set_color_saturation_helper;
vec3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? vec3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _32_blend_set_color_saturation_helper;
vec3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? vec3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
vec3 _34_blend_set_color_saturation_helper;
vec3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? vec3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
vec3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
vec3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_hue = vec4((((_36_blend_set_color_luminance + dst.xyz) - _20_dsa) + src.xyz) - _19_sda, (src.w + dst.w) - _18_alpha);
}
sk_FragColor = _17_blend_hue;
}

View File

@ -1,19 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
vec4 blend_lighten(vec4 src, vec4 dst) {
vec4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
vec4 result = _2_blend_src_over;
result.xyz = max(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
void main() {
vec4 _0_blend_lighten;
{

View File

@ -8,19 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_over(float4 src, float4 dst) {
return src + (1.0 - src.w) * dst;
}
float4 blend_lighten(float4 src, float4 dst) {
float4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
float4 result = _2_blend_src_over;
result.xyz = max(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,19 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
vec4 blend_lighten(vec4 src, vec4 dst) {
vec4 _2_blend_src_over;
{
_2_blend_src_over = src + (1.0 - src.w) * dst;
}
vec4 result = _2_blend_src_over;
result.xyz = max(result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return result;
}
void main() {
vec4 _0_blend_lighten;
{

View File

@ -1,42 +1,35 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
vec4 blend_luminosity(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(dsa, alpha, sda) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
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;
_0_blend_luminosity = vec4((((_blend_set_color_luminance(_3_dsa, _1_alpha, _2_sda) + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
vec3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
vec3 _8_result = (_7_lum - _12_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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_luminosity = vec4((((_6_blend_set_color_luminance + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
}
sk_FragColor = _0_blend_luminosity;

View File

@ -8,35 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_color_luminance(float3 color) {
return dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
float3 _blend_set_color_luminance(float3 hueSatColor, float alpha, float3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
float3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float4 blend_luminosity(float4 src, float4 dst) {
float alpha = dst.w * src.w;
float3 sda = src.xyz * dst.w;
float3 dsa = dst.xyz * src.w;
return float4((((_blend_set_color_luminance(dsa, alpha, sda) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
@ -45,7 +16,29 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float _1_alpha = _in.dst.w * _in.src.w;
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
_0_blend_luminosity = float4((((_blend_set_color_luminance(_3_dsa, _1_alpha, _2_sda) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
float3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
float3 _8_result = (_7_lum - _12_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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_luminosity = float4((((_6_blend_set_color_luminance + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
}
_out->sk_FragColor = _0_blend_luminosity;

View File

@ -1,42 +1,35 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _4_blend_color_luminance;
{
_4_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _4_blend_color_luminance;
float _5_blend_color_luminance;
{
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _5_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
vec4 blend_luminosity(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(dsa, alpha, sda) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
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;
_0_blend_luminosity = vec4((((_blend_set_color_luminance(_3_dsa, _1_alpha, _2_sda) + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
vec3 _6_blend_set_color_luminance;
{
float _11_blend_color_luminance;
{
_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
}
float _7_lum = _11_blend_color_luminance;
float _12_blend_color_luminance;
{
_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
}
vec3 _8_result = (_7_lum - _12_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 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_6_blend_set_color_luminance = _10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result;
}
_0_blend_luminosity = vec4((((_6_blend_set_color_luminance + dst.xyz) - _3_dsa) + src.xyz) - _2_sda, (src.w + dst.w) - _1_alpha);
}
sk_FragColor = _0_blend_luminosity;

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_modulate(vec4 src, vec4 dst) {
return src * dst;
}
void main() {
vec4 _0_blend_modulate;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_modulate(float4 src, float4 dst) {
return src * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_modulate(vec4 src, vec4 dst) {
return src * dst;
}
void main() {
vec4 _0_blend_modulate;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_multiply(vec4 src, vec4 dst) {
return vec4(((1.0 - src.w) * dst.xyz + (1.0 - dst.w) * src.xyz) + src.xyz * dst.xyz, src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_multiply;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_multiply(float4 src, float4 dst) {
return float4(((1.0 - src.w) * dst.xyz + (1.0 - dst.w) * src.xyz) + src.xyz * dst.xyz, src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_multiply(vec4 src, vec4 dst) {
return vec4(((1.0 - src.w) * dst.xyz + (1.0 - dst.w) * src.xyz) + src.xyz * dst.xyz, src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_multiply;
{

View File

@ -1,35 +1,34 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_overlay_component(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
float _0_blend_overlay_component;
vec2 _1_s = src.xw;
vec2 _2_d = dst.xw;
{
_0_blend_overlay_component = 2.0 * _2_d.x <= _2_d.y ? (2.0 * _1_s.x) * _2_d.x : _1_s.y * _2_d.y - (2.0 * (_2_d.y - _2_d.x)) * (_1_s.y - _1_s.x);
}
float _3_blend_overlay_component;
vec2 _4_s = src.yw;
vec2 _5_d = dst.yw;
{
_3_blend_overlay_component = 2.0 * _5_d.x <= _5_d.y ? (2.0 * _4_s.x) * _5_d.x : _4_s.y * _5_d.y - (2.0 * (_5_d.y - _5_d.x)) * (_4_s.y - _4_s.x);
}
float _6_blend_overlay_component;
vec2 _7_s = src.zw;
vec2 _8_d = dst.zw;
{
_6_blend_overlay_component = 2.0 * _8_d.x <= _8_d.y ? (2.0 * _7_s.x) * _8_d.x : _7_s.y * _8_d.y - (2.0 * (_8_d.y - _8_d.x)) * (_7_s.y - _7_s.x);
}
vec4 result = vec4(_0_blend_overlay_component, _3_blend_overlay_component, _6_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
void main() {
sk_FragColor = blend_overlay(src, dst);
vec4 _3_blend_overlay;
{
float _5_blend_overlay_component;
vec2 _6_s = src.xw;
vec2 _7_d = dst.xw;
{
_5_blend_overlay_component = 2.0 * _7_d.x <= _7_d.y ? (2.0 * _6_s.x) * _7_d.x : _6_s.y * _7_d.y - (2.0 * (_7_d.y - _7_d.x)) * (_6_s.y - _6_s.x);
}
float _8_blend_overlay_component;
vec2 _9_s = src.yw;
vec2 _10_d = dst.yw;
{
_8_blend_overlay_component = 2.0 * _10_d.x <= _10_d.y ? (2.0 * _9_s.x) * _10_d.x : _9_s.y * _10_d.y - (2.0 * (_10_d.y - _10_d.x)) * (_9_s.y - _9_s.x);
}
float _11_blend_overlay_component;
vec2 _12_s = src.zw;
vec2 _13_d = dst.zw;
{
_11_blend_overlay_component = 2.0 * _13_d.x <= _13_d.y ? (2.0 * _12_s.x) * _13_d.x : _12_s.y * _13_d.y - (2.0 * (_13_d.y - _13_d.x)) * (_12_s.y - _12_s.x);
}
vec4 _4_result = vec4(_5_blend_overlay_component, _8_blend_overlay_component, _11_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
_4_result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
_3_blend_overlay = _4_result;
}
sk_FragColor = _3_blend_overlay;
}

View File

@ -8,38 +8,37 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_overlay_component(float2 s, float2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
float4 blend_overlay(float4 src, float4 dst) {
float _0_blend_overlay_component;
float2 _1_s = src.xw;
float2 _2_d = dst.xw;
{
_0_blend_overlay_component = 2.0 * _2_d.x <= _2_d.y ? (2.0 * _1_s.x) * _2_d.x : _1_s.y * _2_d.y - (2.0 * (_2_d.y - _2_d.x)) * (_1_s.y - _1_s.x);
}
float _3_blend_overlay_component;
float2 _4_s = src.yw;
float2 _5_d = dst.yw;
{
_3_blend_overlay_component = 2.0 * _5_d.x <= _5_d.y ? (2.0 * _4_s.x) * _5_d.x : _4_s.y * _5_d.y - (2.0 * (_5_d.y - _5_d.x)) * (_4_s.y - _4_s.x);
}
float _6_blend_overlay_component;
float2 _7_s = src.zw;
float2 _8_d = dst.zw;
{
_6_blend_overlay_component = 2.0 * _8_d.x <= _8_d.y ? (2.0 * _7_s.x) * _8_d.x : _7_s.y * _8_d.y - (2.0 * (_8_d.y - _8_d.x)) * (_7_s.y - _7_s.x);
}
float4 result = float4(_0_blend_overlay_component, _3_blend_overlay_component, _6_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz = result.xyz + dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = blend_overlay(_in.src, _in.dst);
float4 _3_blend_overlay;
{
float _5_blend_overlay_component;
float2 _6_s = _in.src.xw;
float2 _7_d = _in.dst.xw;
{
_5_blend_overlay_component = 2.0 * _7_d.x <= _7_d.y ? (2.0 * _6_s.x) * _7_d.x : _6_s.y * _7_d.y - (2.0 * (_7_d.y - _7_d.x)) * (_6_s.y - _6_s.x);
}
float _8_blend_overlay_component;
float2 _9_s = _in.src.yw;
float2 _10_d = _in.dst.yw;
{
_8_blend_overlay_component = 2.0 * _10_d.x <= _10_d.y ? (2.0 * _9_s.x) * _10_d.x : _9_s.y * _10_d.y - (2.0 * (_10_d.y - _10_d.x)) * (_9_s.y - _9_s.x);
}
float _11_blend_overlay_component;
float2 _12_s = _in.src.zw;
float2 _13_d = _in.dst.zw;
{
_11_blend_overlay_component = 2.0 * _13_d.x <= _13_d.y ? (2.0 * _12_s.x) * _13_d.x : _12_s.y * _13_d.y - (2.0 * (_13_d.y - _13_d.x)) * (_12_s.y - _12_s.x);
}
float4 _4_result = float4(_5_blend_overlay_component, _8_blend_overlay_component, _11_blend_overlay_component, _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
_4_result.xyz = _4_result.xyz + _in.dst.xyz * (1.0 - _in.src.w) + _in.src.xyz * (1.0 - _in.dst.w);
_3_blend_overlay = _4_result;
}
_out->sk_FragColor = _3_blend_overlay;
return *_out;
}

View File

@ -1,35 +1,34 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_overlay_component(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
float _0_blend_overlay_component;
vec2 _1_s = src.xw;
vec2 _2_d = dst.xw;
{
_0_blend_overlay_component = 2.0 * _2_d.x <= _2_d.y ? (2.0 * _1_s.x) * _2_d.x : _1_s.y * _2_d.y - (2.0 * (_2_d.y - _2_d.x)) * (_1_s.y - _1_s.x);
}
float _3_blend_overlay_component;
vec2 _4_s = src.yw;
vec2 _5_d = dst.yw;
{
_3_blend_overlay_component = 2.0 * _5_d.x <= _5_d.y ? (2.0 * _4_s.x) * _5_d.x : _4_s.y * _5_d.y - (2.0 * (_5_d.y - _5_d.x)) * (_4_s.y - _4_s.x);
}
float _6_blend_overlay_component;
vec2 _7_s = src.zw;
vec2 _8_d = dst.zw;
{
_6_blend_overlay_component = 2.0 * _8_d.x <= _8_d.y ? (2.0 * _7_s.x) * _8_d.x : _7_s.y * _8_d.y - (2.0 * (_8_d.y - _8_d.x)) * (_7_s.y - _7_s.x);
}
vec4 result = vec4(_0_blend_overlay_component, _3_blend_overlay_component, _6_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
void main() {
sk_FragColor = blend_overlay(src, dst);
vec4 _3_blend_overlay;
{
float _5_blend_overlay_component;
vec2 _6_s = src.xw;
vec2 _7_d = dst.xw;
{
_5_blend_overlay_component = 2.0 * _7_d.x <= _7_d.y ? (2.0 * _6_s.x) * _7_d.x : _6_s.y * _7_d.y - (2.0 * (_7_d.y - _7_d.x)) * (_6_s.y - _6_s.x);
}
float _8_blend_overlay_component;
vec2 _9_s = src.yw;
vec2 _10_d = dst.yw;
{
_8_blend_overlay_component = 2.0 * _10_d.x <= _10_d.y ? (2.0 * _9_s.x) * _10_d.x : _9_s.y * _10_d.y - (2.0 * (_10_d.y - _10_d.x)) * (_9_s.y - _9_s.x);
}
float _11_blend_overlay_component;
vec2 _12_s = src.zw;
vec2 _13_d = dst.zw;
{
_11_blend_overlay_component = 2.0 * _13_d.x <= _13_d.y ? (2.0 * _12_s.x) * _13_d.x : _12_s.y * _13_d.y - (2.0 * (_13_d.y - _13_d.x)) * (_12_s.y - _12_s.x);
}
vec4 _4_result = vec4(_5_blend_overlay_component, _8_blend_overlay_component, _11_blend_overlay_component, src.w + (1.0 - src.w) * dst.w);
_4_result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
_3_blend_overlay = _4_result;
}
sk_FragColor = _3_blend_overlay;
}

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_plus(vec4 src, vec4 dst) {
return min(src + dst, 1.0);
}
void main() {
vec4 _0_blend_plus;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_plus(float4 src, float4 dst) {
return min(src + dst, 1.0);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_plus(vec4 src, vec4 dst) {
return min(src + dst, 1.0);
}
void main() {
vec4 _0_blend_plus;
{

View File

@ -1,100 +1,98 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(vec3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : vec3(0.0);
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
vec3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? vec3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : vec3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _4_blend_set_color_saturation_helper;
vec3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? vec3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
vec3 _6_blend_set_color_saturation_helper;
vec3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? vec3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _8_blend_set_color_saturation_helper;
vec3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? vec3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
vec3 _10_blend_set_color_saturation_helper;
vec3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? vec3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
vec3 _12_blend_set_color_saturation_helper;
vec3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? vec3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
vec4 blend_saturation(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(dsa, sda), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
sk_FragColor = blend_saturation(src, dst);
vec4 _17_blend_saturation;
{
float _18_alpha = dst.w * src.w;
vec3 _19_sda = src.xyz * dst.w;
vec3 _20_dsa = dst.xyz * src.w;
vec3 _21_blend_set_color_saturation;
vec3 _22_hueLumColor = _20_dsa;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_19_sda.x, _19_sda.y), _19_sda.z) - min(min(_19_sda.x, _19_sda.y), _19_sda.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? vec3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _26_blend_set_color_saturation_helper;
vec3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? vec3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
vec3 _28_blend_set_color_saturation_helper;
vec3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? vec3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _30_blend_set_color_saturation_helper;
vec3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? vec3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _32_blend_set_color_saturation_helper;
vec3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? vec3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
vec3 _34_blend_set_color_saturation_helper;
vec3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? vec3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
vec3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
vec3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_saturation = vec4((((_36_blend_set_color_luminance + dst.xyz) - _20_dsa) + src.xyz) - _19_sda, (src.w + dst.w) - _18_alpha);
}
sk_FragColor = _17_blend_saturation;
}

View File

@ -8,103 +8,101 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _blend_color_luminance(float3 color) {
return dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
float3 _blend_set_color_luminance(float3 hueSatColor, float alpha, float3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
float3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(float3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
float3 _blend_set_color_saturation_helper(float3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? float3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : float3(0.0);
}
float3 _blend_set_color_saturation(float3 hueLumColor, float3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
float3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? float3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : float3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
float3 _4_blend_set_color_saturation_helper;
float3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? float3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
float3 _6_blend_set_color_saturation_helper;
float3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? float3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
float3 _8_blend_set_color_saturation_helper;
float3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? float3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
float3 _10_blend_set_color_saturation_helper;
float3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? float3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
float3 _12_blend_set_color_saturation_helper;
float3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? float3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : float3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
float4 blend_saturation(float4 src, float4 dst) {
float alpha = dst.w * src.w;
float3 sda = src.xyz * dst.w;
float3 dsa = dst.xyz * src.w;
return float4((((_blend_set_color_luminance(_blend_set_color_saturation(dsa, sda), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = blend_saturation(_in.src, _in.dst);
float4 _17_blend_saturation;
{
float _18_alpha = _in.dst.w * _in.src.w;
float3 _19_sda = _in.src.xyz * _in.dst.w;
float3 _20_dsa = _in.dst.xyz * _in.src.w;
float3 _21_blend_set_color_saturation;
float3 _22_hueLumColor = _20_dsa;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_19_sda.x, _19_sda.y), _19_sda.z) - min(min(_19_sda.x, _19_sda.y), _19_sda.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
float3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? float3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
float3 _26_blend_set_color_saturation_helper;
float3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? float3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
float3 _28_blend_set_color_saturation_helper;
float3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? float3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
float3 _30_blend_set_color_saturation_helper;
float3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? float3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
float3 _32_blend_set_color_saturation_helper;
float3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? float3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
float3 _34_blend_set_color_saturation_helper;
float3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? float3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : float3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
float3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
float3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_saturation = float4((((_36_blend_set_color_luminance + _in.dst.xyz) - _20_dsa) + _in.src.xyz) - _19_sda, (_in.src.w + _in.dst.w) - _18_alpha);
}
_out->sk_FragColor = _17_blend_saturation;
return *_out;
}

View File

@ -1,100 +1,98 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _blend_color_luminance(vec3 color) {
return dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), color);
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
float _0_blend_color_luminance;
{
_0_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
}
float lum = _0_blend_color_luminance;
float _1_blend_color_luminance;
{
_1_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor);
}
vec3 result = (lum - _1_blend_color_luminance) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
float maxComp = max(max(result.x, result.y), result.z);
if (minComp < 0.0 && lum != minComp) {
result = lum + ((result - lum) * lum) / (lum - minComp);
}
return maxComp > alpha && maxComp != lum ? lum + ((result - lum) * (alpha - lum)) / (maxComp - lum) : result;
}
float _blend_color_saturation(vec3 color) {
return max(max(color.x, color.y), color.z) - min(min(color.x, color.y), color.z);
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
return minMidMax.x < minMidMax.z ? vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat) : vec3(0.0);
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
float _2_blend_color_saturation;
{
_2_blend_color_saturation = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
}
float sat = _2_blend_color_saturation;
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
vec3 _3_blend_set_color_saturation_helper;
{
_3_blend_set_color_saturation_helper = hueLumColor.x < hueLumColor.z ? vec3(0.0, (sat * (hueLumColor.y - hueLumColor.x)) / (hueLumColor.z - hueLumColor.x), sat) : vec3(0.0);
}
hueLumColor.xyz = _3_blend_set_color_saturation_helper;
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _4_blend_set_color_saturation_helper;
vec3 _5_minMidMax = hueLumColor.xzy;
{
_4_blend_set_color_saturation_helper = _5_minMidMax.x < _5_minMidMax.z ? vec3(0.0, (sat * (_5_minMidMax.y - _5_minMidMax.x)) / (_5_minMidMax.z - _5_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.xzy = _4_blend_set_color_saturation_helper;
} else {
vec3 _6_blend_set_color_saturation_helper;
vec3 _7_minMidMax = hueLumColor.zxy;
{
_6_blend_set_color_saturation_helper = _7_minMidMax.x < _7_minMidMax.z ? vec3(0.0, (sat * (_7_minMidMax.y - _7_minMidMax.x)) / (_7_minMidMax.z - _7_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zxy = _6_blend_set_color_saturation_helper;
}
} else if (hueLumColor.x <= hueLumColor.z) {
vec3 _8_blend_set_color_saturation_helper;
vec3 _9_minMidMax = hueLumColor.yxz;
{
_8_blend_set_color_saturation_helper = _9_minMidMax.x < _9_minMidMax.z ? vec3(0.0, (sat * (_9_minMidMax.y - _9_minMidMax.x)) / (_9_minMidMax.z - _9_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yxz = _8_blend_set_color_saturation_helper;
} else if (hueLumColor.y <= hueLumColor.z) {
vec3 _10_blend_set_color_saturation_helper;
vec3 _11_minMidMax = hueLumColor.yzx;
{
_10_blend_set_color_saturation_helper = _11_minMidMax.x < _11_minMidMax.z ? vec3(0.0, (sat * (_11_minMidMax.y - _11_minMidMax.x)) / (_11_minMidMax.z - _11_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.yzx = _10_blend_set_color_saturation_helper;
} else {
vec3 _12_blend_set_color_saturation_helper;
vec3 _13_minMidMax = hueLumColor.zyx;
{
_12_blend_set_color_saturation_helper = _13_minMidMax.x < _13_minMidMax.z ? vec3(0.0, (sat * (_13_minMidMax.y - _13_minMidMax.x)) / (_13_minMidMax.z - _13_minMidMax.x), sat) : vec3(0.0);
}
hueLumColor.zyx = _12_blend_set_color_saturation_helper;
}
return hueLumColor;
}
vec4 blend_saturation(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(dsa, sda), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
sk_FragColor = blend_saturation(src, dst);
vec4 _17_blend_saturation;
{
float _18_alpha = dst.w * src.w;
vec3 _19_sda = src.xyz * dst.w;
vec3 _20_dsa = dst.xyz * src.w;
vec3 _21_blend_set_color_saturation;
vec3 _22_hueLumColor = _20_dsa;
{
float _24_blend_color_saturation;
{
_24_blend_color_saturation = max(max(_19_sda.x, _19_sda.y), _19_sda.z) - min(min(_19_sda.x, _19_sda.y), _19_sda.z);
}
float _23_sat = _24_blend_color_saturation;
if (_22_hueLumColor.x <= _22_hueLumColor.y) {
if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _25_blend_set_color_saturation_helper;
{
_25_blend_set_color_saturation_helper = _22_hueLumColor.x < _22_hueLumColor.z ? vec3(0.0, (_23_sat * (_22_hueLumColor.y - _22_hueLumColor.x)) / (_22_hueLumColor.z - _22_hueLumColor.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xyz = _25_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _26_blend_set_color_saturation_helper;
vec3 _27_minMidMax = _22_hueLumColor.xzy;
{
_26_blend_set_color_saturation_helper = _27_minMidMax.x < _27_minMidMax.z ? vec3(0.0, (_23_sat * (_27_minMidMax.y - _27_minMidMax.x)) / (_27_minMidMax.z - _27_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.xzy = _26_blend_set_color_saturation_helper;
} else {
vec3 _28_blend_set_color_saturation_helper;
vec3 _29_minMidMax = _22_hueLumColor.zxy;
{
_28_blend_set_color_saturation_helper = _29_minMidMax.x < _29_minMidMax.z ? vec3(0.0, (_23_sat * (_29_minMidMax.y - _29_minMidMax.x)) / (_29_minMidMax.z - _29_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zxy = _28_blend_set_color_saturation_helper;
}
} else if (_22_hueLumColor.x <= _22_hueLumColor.z) {
vec3 _30_blend_set_color_saturation_helper;
vec3 _31_minMidMax = _22_hueLumColor.yxz;
{
_30_blend_set_color_saturation_helper = _31_minMidMax.x < _31_minMidMax.z ? vec3(0.0, (_23_sat * (_31_minMidMax.y - _31_minMidMax.x)) / (_31_minMidMax.z - _31_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yxz = _30_blend_set_color_saturation_helper;
} else if (_22_hueLumColor.y <= _22_hueLumColor.z) {
vec3 _32_blend_set_color_saturation_helper;
vec3 _33_minMidMax = _22_hueLumColor.yzx;
{
_32_blend_set_color_saturation_helper = _33_minMidMax.x < _33_minMidMax.z ? vec3(0.0, (_23_sat * (_33_minMidMax.y - _33_minMidMax.x)) / (_33_minMidMax.z - _33_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.yzx = _32_blend_set_color_saturation_helper;
} else {
vec3 _34_blend_set_color_saturation_helper;
vec3 _35_minMidMax = _22_hueLumColor.zyx;
{
_34_blend_set_color_saturation_helper = _35_minMidMax.x < _35_minMidMax.z ? vec3(0.0, (_23_sat * (_35_minMidMax.y - _35_minMidMax.x)) / (_35_minMidMax.z - _35_minMidMax.x), _23_sat) : vec3(0.0);
}
_22_hueLumColor.zyx = _34_blend_set_color_saturation_helper;
}
_21_blend_set_color_saturation = _22_hueLumColor;
}
vec3 _36_blend_set_color_luminance;
{
float _41_blend_color_luminance;
{
_41_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _20_dsa);
}
float _37_lum = _41_blend_color_luminance;
float _42_blend_color_luminance;
{
_42_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _21_blend_set_color_saturation);
}
vec3 _38_result = (_37_lum - _42_blend_color_luminance) + _21_blend_set_color_saturation;
float _39_minComp = min(min(_38_result.x, _38_result.y), _38_result.z);
float _40_maxComp = max(max(_38_result.x, _38_result.y), _38_result.z);
if (_39_minComp < 0.0 && _37_lum != _39_minComp) {
_38_result = _37_lum + ((_38_result - _37_lum) * _37_lum) / (_37_lum - _39_minComp);
}
_36_blend_set_color_luminance = _40_maxComp > _18_alpha && _40_maxComp != _37_lum ? _37_lum + ((_38_result - _37_lum) * (_18_alpha - _37_lum)) / (_40_maxComp - _37_lum) : _38_result;
}
_17_blend_saturation = vec4((((_36_blend_set_color_luminance + dst.xyz) - _20_dsa) + src.xyz) - _19_sda, (src.w + dst.w) - _18_alpha);
}
sk_FragColor = _17_blend_saturation;
}

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_screen(vec4 src, vec4 dst) {
return src + (1.0 - src) * dst;
}
void main() {
vec4 _0_blend_screen;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_screen(float4 src, float4 dst) {
return src + (1.0 - src) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_screen(vec4 src, vec4 dst) {
return src + (1.0 - src) * dst;
}
void main() {
vec4 _0_blend_screen;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _soft_light_component(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
float _1_guarded_divide;
@ -30,9 +27,6 @@ float _soft_light_component(vec2 s, vec2 d) {
return ((d.x * ((s.y - 2.0 * s.x) + 1.0) + s.x) - sqrt(d.y * d.x) * (s.y - 2.0 * s.x)) - d.y * s.x;
}
}
vec4 blend_soft_light(vec4 src, vec4 dst) {
return dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_soft_light;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float _guarded_divide(float n, float d) {
return n / d;
}
float _soft_light_component(float2 s, float2 d) {
if (2.0 * s.x <= s.y) {
float _1_guarded_divide;
@ -37,9 +34,6 @@ float _soft_light_component(float2 s, float2 d) {
return ((d.x * ((s.y - 2.0 * s.x) + 1.0) + s.x) - sqrt(d.y * d.x) * (s.y - 2.0 * s.x)) - d.y * s.x;
}
}
float4 blend_soft_light(float4 src, float4 dst) {
return dst.w == 0.0 ? src : float4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
float _guarded_divide(float n, float d) {
return n / d;
}
float _soft_light_component(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
float _1_guarded_divide;
@ -30,9 +27,6 @@ float _soft_light_component(vec2 s, vec2 d) {
return ((d.x * ((s.y - 2.0 * s.x) + 1.0) + s.x) - sqrt(d.y * d.x) * (s.y - 2.0 * s.x)) - d.y * s.x;
}
}
vec4 blend_soft_light(vec4 src, vec4 dst) {
return dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}
void main() {
vec4 _0_blend_soft_light;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src(vec4 src, vec4 dst) {
return src;
}
void main() {
vec4 _0_blend_src;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src(float4 src, float4 dst) {
return src;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_atop(vec4 src, vec4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_atop;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_atop(float4 src, float4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_atop(vec4 src, vec4 dst) {
return dst.w * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_atop;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_in(vec4 src, vec4 dst) {
return src * dst.w;
}
void main() {
vec4 _0_blend_src_in;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_in(float4 src, float4 dst) {
return src * dst.w;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_in(vec4 src, vec4 dst) {
return src * dst.w;
}
void main() {
vec4 _0_blend_src_in;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_out(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src;
}
void main() {
vec4 _0_blend_src_out;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_out(float4 src, float4 dst) {
return (1.0 - dst.w) * src;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_out(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src;
}
void main() {
vec4 _0_blend_src_out;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_over;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_src_over(float4 src, float4 dst) {
return src + (1.0 - src.w) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src_over(vec4 src, vec4 dst) {
return src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_src_over;
{

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_src(vec4 src, vec4 dst) {
return src;
}
void main() {
vec4 _0_blend_src;
{

View File

@ -1,9 +1,6 @@
#version 400
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_xor(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_xor;
{

View File

@ -8,9 +8,6 @@ struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float4 blend_xor(float4 src, float4 dst) {
return (1.0 - dst.w) * src + (1.0 - src.w) * dst;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;

View File

@ -1,9 +1,6 @@
out vec4 sk_FragColor;
in vec4 src, dst;
vec4 blend_xor(vec4 src, vec4 dst) {
return (1.0 - dst.w) * src + (1.0 - src.w) * dst;
}
void main() {
vec4 _0_blend_xor;
{