Improve inliner variable name mangling.

Previously, multiple inliner passes in a row would each apply a
separate name mangling to variable names, so names like "_25_14_3_1_pos"
were not uncommon. This change demangles the name before re-mangling it,
so we would have just "_25_pos" instead.

It's not important, but it makes things easier to read.

Change-Id: I1257222dac2a68e337f431af230ce50730cedc9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2020-12-16 13:30:54 -05:00 committed by Skia Commit-Bot
parent 632a23afa4
commit 6f31e27f1e
39 changed files with 255 additions and 241 deletions

View File

@ -298,19 +298,33 @@ void Inliner::reset(ModifiersPool* modifiers, const Program::Settings* settings)
fInlinedStatementCounter = 0;
}
String Inliner::uniqueNameForInlineVar(const String& baseName, SymbolTable* symbolTable) {
// If the base name starts with an underscore, like "_coords", we can't append another
// underscore, because OpenGL disallows two consecutive underscores anywhere in the string. But
// in the general case, using the underscore as a splitter reads nicely enough that it's worth
// putting in this special case.
const char* splitter = baseName.startsWith("_") ? "" : "_";
String Inliner::uniqueNameForInlineVar(String baseName, SymbolTable* symbolTable) {
// The inliner runs more than once, so the base name might already have a prefix like "_123_x".
// Let's strip that prefix off to make the generated code easier to read.
if (baseName.startsWith("_")) {
// Determine if we have a string of digits.
int offset = 1;
while (isdigit(baseName[offset])) {
++offset;
}
// If we found digits, another underscore, and anything else, that's the inliner prefix.
// Strip it off.
if (offset > 1 && baseName[offset] == '_' && baseName[offset + 1] != '\0') {
baseName.erase(0, offset + 1);
} else {
// This name doesn't contain an inliner prefix, but it does start with an underscore.
// OpenGL disallows two consecutive underscores anywhere in the string, and we'll be
// adding one as part of the inliner prefix, so strip the leading underscore.
baseName.erase(0, 1);
}
}
// Append a unique numeric prefix to avoid name overlap. Check the symbol table to make sure
// we're not reusing an existing name. (Note that within a single compilation pass, this check
// isn't fully comprehensive, as code isn't always generated in top-to-bottom order.)
String uniqueName;
for (;;) {
uniqueName = String::printf("_%d%s%s", fInlineVarCounter++, splitter, baseName.c_str());
uniqueName = String::printf("_%d_%s", fInlineVarCounter++, baseName.c_str());
StringFragment frag{uniqueName.data(), uniqueName.length()};
if ((*symbolTable)[frag] == nullptr) {
break;

View File

@ -48,7 +48,7 @@ public:
private:
using VariableRewriteMap = std::unordered_map<const Variable*, std::unique_ptr<Expression>>;
String uniqueNameForInlineVar(const String& baseName, SymbolTable* symbolTable);
String uniqueNameForInlineVar(String baseName, SymbolTable* symbolTable);
void buildCandidateList(const std::vector<std::unique_ptr<ProgramElement>>& elements,
SymbolTable* symbols, ProgramUsage* usage,

View File

@ -13,9 +13,9 @@ OpName %_1_alpha "_1_alpha"
OpName %_2_sda "_2_sda"
OpName %_3_dsa "_3_dsa"
OpName %_4_blend_set_color_luminance "_4_blend_set_color_luminance"
OpName %_5_11_blend_color_luminance "_5_11_blend_color_luminance"
OpName %_5_blend_color_luminance "_5_blend_color_luminance"
OpName %_6_lum "_6_lum"
OpName %_7_12_blend_color_luminance "_7_12_blend_color_luminance"
OpName %_7_blend_color_luminance "_7_blend_color_luminance"
OpName %_8_result "_8_result"
OpName %_9_minComp "_9_minComp"
OpName %_10_maxComp "_10_maxComp"
@ -117,9 +117,9 @@ OpDecorate %158 RelaxedPrecision
%_2_sda = OpVariable %_ptr_Function_v3float Function
%_3_dsa = OpVariable %_ptr_Function_v3float Function
%_4_blend_set_color_luminance = OpVariable %_ptr_Function_v3float Function
%_5_11_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_5_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_6_lum = OpVariable %_ptr_Function_float Function
%_7_12_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_7_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_8_result = OpVariable %_ptr_Function_v3float Function
%_9_minComp = OpVariable %_ptr_Function_float Function
%_10_maxComp = OpVariable %_ptr_Function_float Function
@ -144,14 +144,14 @@ OpStore %_2_sda %32
OpStore %_3_dsa %38
%46 = OpLoad %v3float %_3_dsa
%41 = OpDot %float %42 %46
OpStore %_5_11_blend_color_luminance %41
%48 = OpLoad %float %_5_11_blend_color_luminance
OpStore %_5_blend_color_luminance %41
%48 = OpLoad %float %_5_blend_color_luminance
OpStore %_6_lum %48
%52 = OpLoad %v3float %_2_sda
%50 = OpDot %float %51 %52
OpStore %_7_12_blend_color_luminance %50
OpStore %_7_blend_color_luminance %50
%54 = OpLoad %float %_6_lum
%55 = OpLoad %float %_7_12_blend_color_luminance
%55 = OpLoad %float %_7_blend_color_luminance
%56 = OpFSub %float %54 %55
%57 = OpLoad %v3float %_2_sda
%58 = OpCompositeConstruct %v3float %56 %56 %56

View File

@ -8,15 +8,15 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
vec3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _2_sda;
vec3 _8_result = (_6_lum - _7_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);

View File

@ -18,15 +18,15 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
float3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _2_sda;
float3 _8_result = (_6_lum - _7_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);

View File

@ -8,15 +8,15 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
vec3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _2_sda;
vec3 _8_result = (_6_lum - _7_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);

View File

@ -9,7 +9,7 @@ OpName %src "src"
OpName %dst "dst"
OpName %main "main"
OpName %_0_blend_darken "_0_blend_darken"
OpName %_1_1_blend_src_over "_1_1_blend_src_over"
OpName %_1_blend_src_over "_1_blend_src_over"
OpName %_2_result "_2_result"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
@ -51,7 +51,7 @@ OpDecorate %45 RelaxedPrecision
%main = OpFunction %void None %14
%15 = OpLabel
%_0_blend_darken = OpVariable %_ptr_Function_v4float Function
%_1_1_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_1_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_2_result = OpVariable %_ptr_Function_v4float Function
%19 = OpLoad %v4float %src
%21 = OpLoad %v4float %src
@ -60,8 +60,8 @@ OpDecorate %45 RelaxedPrecision
%24 = OpLoad %v4float %dst
%25 = OpVectorTimesScalar %v4float %24 %23
%26 = OpFAdd %v4float %19 %25
OpStore %_1_1_blend_src_over %26
%28 = OpLoad %v4float %_1_1_blend_src_over
OpStore %_1_blend_src_over %26
%28 = OpLoad %v4float %_1_blend_src_over
OpStore %_2_result %28
%30 = OpLoad %v4float %_2_result
%31 = OpVectorShuffle %v3float %30 %30 0 1 2

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_darken;
vec4 _1_1_blend_src_over;
_1_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _1_blend_src_over;
_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _2_result = _1_1_blend_src_over;
vec4 _2_result = _1_blend_src_over;
_2_result.xyz = min(_2_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_0_blend_darken = _2_result;

View File

@ -14,10 +14,10 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 _0_blend_darken;
float4 _1_1_blend_src_over;
_1_1_blend_src_over = _in.src + (1.0 - _in.src.w) * _in.dst;
float4 _1_blend_src_over;
_1_blend_src_over = _in.src + (1.0 - _in.src.w) * _in.dst;
float4 _2_result = _1_1_blend_src_over;
float4 _2_result = _1_blend_src_over;
_2_result.xyz = min(_2_result.xyz, (1.0 - _in.dst.w) * _in.src.xyz + _in.dst.xyz);
_0_blend_darken = _2_result;

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_darken;
vec4 _1_1_blend_src_over;
_1_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _1_blend_src_over;
_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _2_result = _1_1_blend_src_over;
vec4 _2_result = _1_blend_src_over;
_2_result.xyz = min(_2_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_0_blend_darken = _2_result;

View File

@ -9,7 +9,7 @@ OpName %src "src"
OpName %dst "dst"
OpName %main "main"
OpName %_0_blend_dst_in "_0_blend_dst_in"
OpName %_1_0_blend_src_in "_1_0_blend_src_in"
OpName %_1_blend_src_in "_1_blend_src_in"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
@ -37,13 +37,13 @@ OpDecorate %24 RelaxedPrecision
%main = OpFunction %void None %14
%15 = OpLabel
%_0_blend_dst_in = OpVariable %_ptr_Function_v4float Function
%_1_0_blend_src_in = OpVariable %_ptr_Function_v4float Function
%_1_blend_src_in = OpVariable %_ptr_Function_v4float Function
%19 = OpLoad %v4float %dst
%20 = OpLoad %v4float %src
%21 = OpCompositeExtract %float %20 3
%22 = OpVectorTimesScalar %v4float %19 %21
OpStore %_1_0_blend_src_in %22
%23 = OpLoad %v4float %_1_0_blend_src_in
OpStore %_1_blend_src_in %22
%23 = OpLoad %v4float %_1_blend_src_in
OpStore %_0_blend_dst_in %23
%24 = OpLoad %v4float %_0_blend_dst_in
OpStore %sk_FragColor %24

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_dst_in;
vec4 _1_0_blend_src_in;
_1_0_blend_src_in = dst * src.w;
vec4 _1_blend_src_in;
_1_blend_src_in = dst * src.w;
_0_blend_dst_in = _1_0_blend_src_in;
_0_blend_dst_in = _1_blend_src_in;
sk_FragColor = _0_blend_dst_in;

View File

@ -14,10 +14,10 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 _0_blend_dst_in;
float4 _1_0_blend_src_in;
_1_0_blend_src_in = _in.dst * _in.src.w;
float4 _1_blend_src_in;
_1_blend_src_in = _in.dst * _in.src.w;
_0_blend_dst_in = _1_0_blend_src_in;
_0_blend_dst_in = _1_blend_src_in;
_out->sk_FragColor = _0_blend_dst_in;

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_dst_in;
vec4 _1_0_blend_src_in;
_1_0_blend_src_in = dst * src.w;
vec4 _1_blend_src_in;
_1_blend_src_in = dst * src.w;
_0_blend_dst_in = _1_0_blend_src_in;
_0_blend_dst_in = _1_blend_src_in;
sk_FragColor = _0_blend_dst_in;

View File

@ -45,7 +45,7 @@ OpName %_17_blend_src_over "_17_blend_src_over"
OpName %_18_blend_dst_over "_18_blend_dst_over"
OpName %_19_blend_src_in "_19_blend_src_in"
OpName %_20_blend_dst_in "_20_blend_dst_in"
OpName %_21_0_blend_src_in "_21_0_blend_src_in"
OpName %_21_blend_src_in "_21_blend_src_in"
OpName %_22_blend_src_out "_22_blend_src_out"
OpName %_23_blend_dst_out "_23_blend_dst_out"
OpName %_24_blend_src_atop "_24_blend_src_atop"
@ -55,10 +55,10 @@ OpName %_27_blend_plus "_27_blend_plus"
OpName %_28_blend_modulate "_28_blend_modulate"
OpName %_29_blend_screen "_29_blend_screen"
OpName %_30_blend_darken "_30_blend_darken"
OpName %_31_1_blend_src_over "_31_1_blend_src_over"
OpName %_31_blend_src_over "_31_blend_src_over"
OpName %_32_result "_32_result"
OpName %_33_blend_lighten "_33_blend_lighten"
OpName %_34_2_blend_src_over "_34_2_blend_src_over"
OpName %_34_blend_src_over "_34_blend_src_over"
OpName %_35_result "_35_result"
OpName %_36_blend_color_dodge "_36_blend_color_dodge"
OpName %_37_blend_color_burn "_37_blend_color_burn"
@ -1530,7 +1530,7 @@ OpFunctionEnd
%_18_blend_dst_over = OpVariable %_ptr_Function_v4float Function
%_19_blend_src_in = OpVariable %_ptr_Function_v4float Function
%_20_blend_dst_in = OpVariable %_ptr_Function_v4float Function
%_21_0_blend_src_in = OpVariable %_ptr_Function_v4float Function
%_21_blend_src_in = OpVariable %_ptr_Function_v4float Function
%_22_blend_src_out = OpVariable %_ptr_Function_v4float Function
%_23_blend_dst_out = OpVariable %_ptr_Function_v4float Function
%_24_blend_src_atop = OpVariable %_ptr_Function_v4float Function
@ -1542,10 +1542,10 @@ OpFunctionEnd
%834 = OpVariable %_ptr_Function_v4float Function
%836 = OpVariable %_ptr_Function_v4float Function
%_30_blend_darken = OpVariable %_ptr_Function_v4float Function
%_31_1_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_31_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_32_result = OpVariable %_ptr_Function_v4float Function
%_33_blend_lighten = OpVariable %_ptr_Function_v4float Function
%_34_2_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_34_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_35_result = OpVariable %_ptr_Function_v4float Function
%_36_blend_color_dodge = OpVariable %_ptr_Function_v4float Function
%895 = OpVariable %_ptr_Function_v2float Function
@ -1657,8 +1657,8 @@ OpReturnValue %752
%756 = OpLoad %v4float %688
%757 = OpCompositeExtract %float %756 3
%758 = OpVectorTimesScalar %v4float %755 %757
OpStore %_21_0_blend_src_in %758
%759 = OpLoad %v4float %_21_0_blend_src_in
OpStore %_21_blend_src_in %758
%759 = OpLoad %v4float %_21_blend_src_in
OpStore %_20_blend_dst_in %759
%760 = OpLoad %v4float %_20_blend_dst_in
OpReturnValue %760
@ -1765,8 +1765,8 @@ OpReturnValue %837
%844 = OpLoad %v4float %689
%845 = OpVectorTimesScalar %v4float %844 %843
%846 = OpFAdd %v4float %840 %845
OpStore %_31_1_blend_src_over %846
%848 = OpLoad %v4float %_31_1_blend_src_over
OpStore %_31_blend_src_over %846
%848 = OpLoad %v4float %_31_blend_src_over
OpStore %_32_result %848
%850 = OpLoad %v4float %_32_result
%851 = OpVectorShuffle %v3float %850 %850 0 1 2
@ -1795,8 +1795,8 @@ OpReturnValue %864
%871 = OpLoad %v4float %689
%872 = OpVectorTimesScalar %v4float %871 %870
%873 = OpFAdd %v4float %867 %872
OpStore %_34_2_blend_src_over %873
%875 = OpLoad %v4float %_34_2_blend_src_over
OpStore %_34_blend_src_over %873
%875 = OpLoad %v4float %_34_blend_src_over
OpStore %_35_result %875
%877 = OpLoad %v4float %_35_result
%878 = OpVectorShuffle %v3float %877 %877 0 1 2

View File

@ -144,10 +144,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 6:
vec4 _20_blend_dst_in;
vec4 _21_0_blend_src_in;
_21_0_blend_src_in = dst * src.w;
vec4 _21_blend_src_in;
_21_blend_src_in = dst * src.w;
_20_blend_dst_in = _21_0_blend_src_in;
_20_blend_dst_in = _21_blend_src_in;
return _20_blend_dst_in;
@ -204,10 +204,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
return blend_overlay(src, dst);
case 16:
vec4 _30_blend_darken;
vec4 _31_1_blend_src_over;
_31_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _31_blend_src_over;
_31_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _32_result = _31_1_blend_src_over;
vec4 _32_result = _31_blend_src_over;
_32_result.xyz = min(_32_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_30_blend_darken = _32_result;
@ -216,10 +216,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 17:
vec4 _33_blend_lighten;
vec4 _34_2_blend_src_over;
_34_2_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _34_blend_src_over;
_34_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _35_result = _34_2_blend_src_over;
vec4 _35_result = _34_blend_src_over;
_35_result.xyz = max(_35_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_33_blend_lighten = _35_result;

View File

@ -152,10 +152,10 @@ float4 blend(int mode, float4 src, float4 dst) {
case 6:
float4 _20_blend_dst_in;
float4 _21_0_blend_src_in;
_21_0_blend_src_in = dst * src.w;
float4 _21_blend_src_in;
_21_blend_src_in = dst * src.w;
_20_blend_dst_in = _21_0_blend_src_in;
_20_blend_dst_in = _21_blend_src_in;
return _20_blend_dst_in;
@ -212,10 +212,10 @@ float4 blend(int mode, float4 src, float4 dst) {
return blend_overlay(src, dst);
case 16:
float4 _30_blend_darken;
float4 _31_1_blend_src_over;
_31_1_blend_src_over = src + (1.0 - src.w) * dst;
float4 _31_blend_src_over;
_31_blend_src_over = src + (1.0 - src.w) * dst;
float4 _32_result = _31_1_blend_src_over;
float4 _32_result = _31_blend_src_over;
_32_result.xyz = min(_32_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_30_blend_darken = _32_result;
@ -224,10 +224,10 @@ float4 blend(int mode, float4 src, float4 dst) {
case 17:
float4 _33_blend_lighten;
float4 _34_2_blend_src_over;
_34_2_blend_src_over = src + (1.0 - src.w) * dst;
float4 _34_blend_src_over;
_34_blend_src_over = src + (1.0 - src.w) * dst;
float4 _35_result = _34_2_blend_src_over;
float4 _35_result = _34_blend_src_over;
_35_result.xyz = max(_35_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_33_blend_lighten = _35_result;

View File

@ -144,10 +144,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 6:
vec4 _20_blend_dst_in;
vec4 _21_0_blend_src_in;
_21_0_blend_src_in = dst * src.w;
vec4 _21_blend_src_in;
_21_blend_src_in = dst * src.w;
_20_blend_dst_in = _21_0_blend_src_in;
_20_blend_dst_in = _21_blend_src_in;
return _20_blend_dst_in;
@ -204,10 +204,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
return blend_overlay(src, dst);
case 16:
vec4 _30_blend_darken;
vec4 _31_1_blend_src_over;
_31_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _31_blend_src_over;
_31_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _32_result = _31_1_blend_src_over;
vec4 _32_result = _31_blend_src_over;
_32_result.xyz = min(_32_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_30_blend_darken = _32_result;
@ -216,10 +216,10 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 17:
vec4 _33_blend_lighten;
vec4 _34_2_blend_src_over;
_34_2_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _34_blend_src_over;
_34_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _35_result = _34_2_blend_src_over;
vec4 _35_result = _34_blend_src_over;
_35_result.xyz = max(_35_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_33_blend_lighten = _35_result;

View File

@ -14,12 +14,12 @@ OpName %_1_alpha "_1_alpha"
OpName %_2_sda "_2_sda"
OpName %_3_dsa "_3_dsa"
OpName %_4_blend_set_color_saturation "_4_blend_set_color_saturation"
OpName %_5_13_blend_color_saturation "_5_13_blend_color_saturation"
OpName %_5_blend_color_saturation "_5_blend_color_saturation"
OpName %_6_sat "_6_sat"
OpName %_7_blend_set_color_luminance "_7_blend_set_color_luminance"
OpName %_8_11_blend_color_luminance "_8_11_blend_color_luminance"
OpName %_8_blend_color_luminance "_8_blend_color_luminance"
OpName %_9_lum "_9_lum"
OpName %_10_12_blend_color_luminance "_10_12_blend_color_luminance"
OpName %_10_blend_color_luminance "_10_blend_color_luminance"
OpName %_11_result "_11_result"
OpName %_12_minComp "_12_minComp"
OpName %_13_maxComp "_13_maxComp"
@ -203,7 +203,7 @@ OpFunctionEnd
%_2_sda = OpVariable %_ptr_Function_v3float Function
%_3_dsa = OpVariable %_ptr_Function_v3float Function
%_4_blend_set_color_saturation = OpVariable %_ptr_Function_v3float Function
%_5_13_blend_color_saturation = OpVariable %_ptr_Function_float Function
%_5_blend_color_saturation = OpVariable %_ptr_Function_float Function
%_6_sat = OpVariable %_ptr_Function_float Function
%109 = OpVariable %_ptr_Function_v3float Function
%111 = OpVariable %_ptr_Function_float Function
@ -218,9 +218,9 @@ OpFunctionEnd
%167 = OpVariable %_ptr_Function_v3float Function
%169 = OpVariable %_ptr_Function_float Function
%_7_blend_set_color_luminance = OpVariable %_ptr_Function_v3float Function
%_8_11_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_8_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_9_lum = OpVariable %_ptr_Function_float Function
%_10_12_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_10_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_11_result = OpVariable %_ptr_Function_v3float Function
%_12_minComp = OpVariable %_ptr_Function_float Function
%_13_maxComp = OpVariable %_ptr_Function_float Function
@ -260,8 +260,8 @@ OpStore %_3_dsa %70
%88 = OpCompositeExtract %float %87 2
%81 = OpExtInst %float %1 FMin %82 %88
%89 = OpFSub %float %73 %81
OpStore %_5_13_blend_color_saturation %89
%91 = OpLoad %float %_5_13_blend_color_saturation
OpStore %_5_blend_color_saturation %89
%91 = OpLoad %float %_5_blend_color_saturation
OpStore %_6_sat %91
%92 = OpLoad %v3float %_2_sda
%93 = OpCompositeExtract %float %92 0
@ -371,14 +371,14 @@ OpBranch %99
%99 = OpLabel
%179 = OpLoad %v3float %_3_dsa
%174 = OpDot %float %175 %179
OpStore %_8_11_blend_color_luminance %174
%181 = OpLoad %float %_8_11_blend_color_luminance
OpStore %_8_blend_color_luminance %174
%181 = OpLoad %float %_8_blend_color_luminance
OpStore %_9_lum %181
%185 = OpLoad %v3float %_4_blend_set_color_saturation
%183 = OpDot %float %184 %185
OpStore %_10_12_blend_color_luminance %183
OpStore %_10_blend_color_luminance %183
%187 = OpLoad %float %_9_lum
%188 = OpLoad %float %_10_12_blend_color_luminance
%188 = OpLoad %float %_10_blend_color_luminance
%189 = OpFSub %float %187 %188
%190 = OpLoad %v3float %_4_blend_set_color_saturation
%191 = OpCompositeConstruct %v3float %189 %189 %189

View File

@ -11,10 +11,10 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_2_sda.x <= _2_sda.y) {
if (_2_sda.y <= _2_sda.z) {
@ -33,15 +33,15 @@ void main() {
}
vec3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
vec3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
vec3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -21,10 +21,10 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
float3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_2_sda.x <= _2_sda.y) {
if (_2_sda.y <= _2_sda.z) {
@ -43,15 +43,15 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
}
float3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
float3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -11,10 +11,10 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_3_dsa.x, _3_dsa.y), _3_dsa.z) - min(min(_3_dsa.x, _3_dsa.y), _3_dsa.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_2_sda.x <= _2_sda.y) {
if (_2_sda.y <= _2_sda.z) {
@ -33,15 +33,15 @@ void main() {
}
vec3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
vec3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
vec3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -9,7 +9,7 @@ OpName %src "src"
OpName %dst "dst"
OpName %main "main"
OpName %_0_blend_lighten "_0_blend_lighten"
OpName %_1_2_blend_src_over "_1_2_blend_src_over"
OpName %_1_blend_src_over "_1_blend_src_over"
OpName %_2_result "_2_result"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
@ -51,7 +51,7 @@ OpDecorate %45 RelaxedPrecision
%main = OpFunction %void None %14
%15 = OpLabel
%_0_blend_lighten = OpVariable %_ptr_Function_v4float Function
%_1_2_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_1_blend_src_over = OpVariable %_ptr_Function_v4float Function
%_2_result = OpVariable %_ptr_Function_v4float Function
%19 = OpLoad %v4float %src
%21 = OpLoad %v4float %src
@ -60,8 +60,8 @@ OpDecorate %45 RelaxedPrecision
%24 = OpLoad %v4float %dst
%25 = OpVectorTimesScalar %v4float %24 %23
%26 = OpFAdd %v4float %19 %25
OpStore %_1_2_blend_src_over %26
%28 = OpLoad %v4float %_1_2_blend_src_over
OpStore %_1_blend_src_over %26
%28 = OpLoad %v4float %_1_blend_src_over
OpStore %_2_result %28
%30 = OpLoad %v4float %_2_result
%31 = OpVectorShuffle %v3float %30 %30 0 1 2

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_lighten;
vec4 _1_2_blend_src_over;
_1_2_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _1_blend_src_over;
_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _2_result = _1_2_blend_src_over;
vec4 _2_result = _1_blend_src_over;
_2_result.xyz = max(_2_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_0_blend_lighten = _2_result;

View File

@ -14,10 +14,10 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 _0_blend_lighten;
float4 _1_2_blend_src_over;
_1_2_blend_src_over = _in.src + (1.0 - _in.src.w) * _in.dst;
float4 _1_blend_src_over;
_1_blend_src_over = _in.src + (1.0 - _in.src.w) * _in.dst;
float4 _2_result = _1_2_blend_src_over;
float4 _2_result = _1_blend_src_over;
_2_result.xyz = max(_2_result.xyz, (1.0 - _in.dst.w) * _in.src.xyz + _in.dst.xyz);
_0_blend_lighten = _2_result;

View File

@ -4,10 +4,10 @@ in vec4 src;
in vec4 dst;
void main() {
vec4 _0_blend_lighten;
vec4 _1_2_blend_src_over;
_1_2_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _1_blend_src_over;
_1_blend_src_over = src + (1.0 - src.w) * dst;
vec4 _2_result = _1_2_blend_src_over;
vec4 _2_result = _1_blend_src_over;
_2_result.xyz = max(_2_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
_0_blend_lighten = _2_result;

View File

@ -13,9 +13,9 @@ OpName %_1_alpha "_1_alpha"
OpName %_2_sda "_2_sda"
OpName %_3_dsa "_3_dsa"
OpName %_4_blend_set_color_luminance "_4_blend_set_color_luminance"
OpName %_5_11_blend_color_luminance "_5_11_blend_color_luminance"
OpName %_5_blend_color_luminance "_5_blend_color_luminance"
OpName %_6_lum "_6_lum"
OpName %_7_12_blend_color_luminance "_7_12_blend_color_luminance"
OpName %_7_blend_color_luminance "_7_blend_color_luminance"
OpName %_8_result "_8_result"
OpName %_9_minComp "_9_minComp"
OpName %_10_maxComp "_10_maxComp"
@ -117,9 +117,9 @@ OpDecorate %158 RelaxedPrecision
%_2_sda = OpVariable %_ptr_Function_v3float Function
%_3_dsa = OpVariable %_ptr_Function_v3float Function
%_4_blend_set_color_luminance = OpVariable %_ptr_Function_v3float Function
%_5_11_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_5_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_6_lum = OpVariable %_ptr_Function_float Function
%_7_12_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_7_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_8_result = OpVariable %_ptr_Function_v3float Function
%_9_minComp = OpVariable %_ptr_Function_float Function
%_10_maxComp = OpVariable %_ptr_Function_float Function
@ -144,14 +144,14 @@ OpStore %_2_sda %32
OpStore %_3_dsa %38
%46 = OpLoad %v3float %_2_sda
%41 = OpDot %float %42 %46
OpStore %_5_11_blend_color_luminance %41
%48 = OpLoad %float %_5_11_blend_color_luminance
OpStore %_5_blend_color_luminance %41
%48 = OpLoad %float %_5_blend_color_luminance
OpStore %_6_lum %48
%52 = OpLoad %v3float %_3_dsa
%50 = OpDot %float %51 %52
OpStore %_7_12_blend_color_luminance %50
OpStore %_7_blend_color_luminance %50
%54 = OpLoad %float %_6_lum
%55 = OpLoad %float %_7_12_blend_color_luminance
%55 = OpLoad %float %_7_blend_color_luminance
%56 = OpFSub %float %54 %55
%57 = OpLoad %v3float %_3_dsa
%58 = OpCompositeConstruct %v3float %56 %56 %56

View File

@ -8,15 +8,15 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
vec3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _3_dsa;
vec3 _8_result = (_6_lum - _7_blend_color_luminance) + _3_dsa;
float _9_minComp = min(min(_8_result.x, _8_result.y), _8_result.z);
float _10_maxComp = max(max(_8_result.x, _8_result.y), _8_result.z);

View File

@ -18,15 +18,15 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
float3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _3_dsa;
float3 _8_result = (_6_lum - _7_blend_color_luminance) + _3_dsa;
float _9_minComp = min(min(_8_result.x, _8_result.y), _8_result.z);
float _10_maxComp = max(max(_8_result.x, _8_result.y), _8_result.z);

View File

@ -8,15 +8,15 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_luminance;
float _5_11_blend_color_luminance;
_5_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _5_blend_color_luminance;
_5_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _2_sda);
float _6_lum = _5_11_blend_color_luminance;
float _6_lum = _5_blend_color_luminance;
float _7_12_blend_color_luminance;
_7_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _7_blend_color_luminance;
_7_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
vec3 _8_result = (_6_lum - _7_12_blend_color_luminance) + _3_dsa;
vec3 _8_result = (_6_lum - _7_blend_color_luminance) + _3_dsa;
float _9_minComp = min(min(_8_result.x, _8_result.y), _8_result.z);
float _10_maxComp = max(max(_8_result.x, _8_result.y), _8_result.z);

View File

@ -14,12 +14,12 @@ OpName %_1_alpha "_1_alpha"
OpName %_2_sda "_2_sda"
OpName %_3_dsa "_3_dsa"
OpName %_4_blend_set_color_saturation "_4_blend_set_color_saturation"
OpName %_5_13_blend_color_saturation "_5_13_blend_color_saturation"
OpName %_5_blend_color_saturation "_5_blend_color_saturation"
OpName %_6_sat "_6_sat"
OpName %_7_blend_set_color_luminance "_7_blend_set_color_luminance"
OpName %_8_11_blend_color_luminance "_8_11_blend_color_luminance"
OpName %_8_blend_color_luminance "_8_blend_color_luminance"
OpName %_9_lum "_9_lum"
OpName %_10_12_blend_color_luminance "_10_12_blend_color_luminance"
OpName %_10_blend_color_luminance "_10_blend_color_luminance"
OpName %_11_result "_11_result"
OpName %_12_minComp "_12_minComp"
OpName %_13_maxComp "_13_maxComp"
@ -203,7 +203,7 @@ OpFunctionEnd
%_2_sda = OpVariable %_ptr_Function_v3float Function
%_3_dsa = OpVariable %_ptr_Function_v3float Function
%_4_blend_set_color_saturation = OpVariable %_ptr_Function_v3float Function
%_5_13_blend_color_saturation = OpVariable %_ptr_Function_float Function
%_5_blend_color_saturation = OpVariable %_ptr_Function_float Function
%_6_sat = OpVariable %_ptr_Function_float Function
%109 = OpVariable %_ptr_Function_v3float Function
%111 = OpVariable %_ptr_Function_float Function
@ -218,9 +218,9 @@ OpFunctionEnd
%167 = OpVariable %_ptr_Function_v3float Function
%169 = OpVariable %_ptr_Function_float Function
%_7_blend_set_color_luminance = OpVariable %_ptr_Function_v3float Function
%_8_11_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_8_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_9_lum = OpVariable %_ptr_Function_float Function
%_10_12_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_10_blend_color_luminance = OpVariable %_ptr_Function_float Function
%_11_result = OpVariable %_ptr_Function_v3float Function
%_12_minComp = OpVariable %_ptr_Function_float Function
%_13_maxComp = OpVariable %_ptr_Function_float Function
@ -260,8 +260,8 @@ OpStore %_3_dsa %70
%88 = OpCompositeExtract %float %87 2
%81 = OpExtInst %float %1 FMin %82 %88
%89 = OpFSub %float %73 %81
OpStore %_5_13_blend_color_saturation %89
%91 = OpLoad %float %_5_13_blend_color_saturation
OpStore %_5_blend_color_saturation %89
%91 = OpLoad %float %_5_blend_color_saturation
OpStore %_6_sat %91
%92 = OpLoad %v3float %_3_dsa
%93 = OpCompositeExtract %float %92 0
@ -371,14 +371,14 @@ OpBranch %99
%99 = OpLabel
%179 = OpLoad %v3float %_3_dsa
%174 = OpDot %float %175 %179
OpStore %_8_11_blend_color_luminance %174
%181 = OpLoad %float %_8_11_blend_color_luminance
OpStore %_8_blend_color_luminance %174
%181 = OpLoad %float %_8_blend_color_luminance
OpStore %_9_lum %181
%185 = OpLoad %v3float %_4_blend_set_color_saturation
%183 = OpDot %float %184 %185
OpStore %_10_12_blend_color_luminance %183
OpStore %_10_blend_color_luminance %183
%187 = OpLoad %float %_9_lum
%188 = OpLoad %float %_10_12_blend_color_luminance
%188 = OpLoad %float %_10_blend_color_luminance
%189 = OpFSub %float %187 %188
%190 = OpLoad %v3float %_4_blend_set_color_saturation
%191 = OpCompositeConstruct %v3float %189 %189 %189

View File

@ -11,10 +11,10 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_3_dsa.x <= _3_dsa.y) {
if (_3_dsa.y <= _3_dsa.z) {
@ -33,15 +33,15 @@ void main() {
}
vec3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
vec3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
vec3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -21,10 +21,10 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
float3 _2_sda = _in.src.xyz * _in.dst.w;
float3 _3_dsa = _in.dst.xyz * _in.src.w;
float3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_3_dsa.x <= _3_dsa.y) {
if (_3_dsa.y <= _3_dsa.z) {
@ -43,15 +43,15 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
}
float3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(float3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
float3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -11,10 +11,10 @@ void main() {
vec3 _2_sda = src.xyz * dst.w;
vec3 _3_dsa = dst.xyz * src.w;
vec3 _4_blend_set_color_saturation;
float _5_13_blend_color_saturation;
_5_13_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _5_blend_color_saturation;
_5_blend_color_saturation = max(max(_2_sda.x, _2_sda.y), _2_sda.z) - min(min(_2_sda.x, _2_sda.y), _2_sda.z);
float _6_sat = _5_13_blend_color_saturation;
float _6_sat = _5_blend_color_saturation;
if (_3_dsa.x <= _3_dsa.y) {
if (_3_dsa.y <= _3_dsa.z) {
@ -33,15 +33,15 @@ void main() {
}
vec3 _7_blend_set_color_luminance;
float _8_11_blend_color_luminance;
_8_11_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _8_blend_color_luminance;
_8_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _3_dsa);
float _9_lum = _8_11_blend_color_luminance;
float _9_lum = _8_blend_color_luminance;
float _10_12_blend_color_luminance;
_10_12_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
float _10_blend_color_luminance;
_10_blend_color_luminance = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), _4_blend_set_color_saturation);
vec3 _11_result = (_9_lum - _10_12_blend_color_luminance) + _4_blend_set_color_saturation;
vec3 _11_result = (_9_lum - _10_blend_color_luminance) + _4_blend_set_color_saturation;
float _12_minComp = min(min(_11_result.x, _11_result.y), _11_result.z);
float _13_maxComp = max(max(_11_result.x, _11_result.y), _11_result.z);

View File

@ -3,11 +3,11 @@ in vec2 x;
vec4 main() {
vec2 _2_InlineA;
vec2 _3_reusedName = x + vec2(1.0, 2.0);
vec2 _4_0_InlineB;
vec2 _5_1_reusedName = _3_reusedName + vec2(3.0, 4.0);
_4_0_InlineB = _5_1_reusedName;
vec2 _4_InlineB;
vec2 _5_reusedName = _3_reusedName + vec2(3.0, 4.0);
_4_InlineB = _5_reusedName;
_2_InlineA = _4_0_InlineB;
_2_InlineA = _4_InlineB;
return _2_InlineA.xyxy;

View File

@ -52,11 +52,11 @@ vec4 blend_hue(vec4 src, vec4 dst) {
uniform vec4 color;
void main() {
float _1_fma;
float _2_0_mul;
_2_0_mul = color.x * color.y;
float _2_mul;
_2_mul = color.x * color.y;
float _7_add;
float _8_c = _2_0_mul + color.z;
float _8_c = _2_mul + color.z;
_7_add = _8_c;
_1_fma = _7_add;
@ -73,10 +73,10 @@ void main() {
sk_FragColor *= _4_blend_src_in;
vec4 _5_blend_dst_in;
vec4 _6_0_blend_src_in;
_6_0_blend_src_in = color.zzww * color.y;
vec4 _6_blend_src_in;
_6_blend_src_in = color.zzww * color.y;
_5_blend_dst_in = _6_0_blend_src_in;
_5_blend_dst_in = _6_blend_src_in;
sk_FragColor *= _5_blend_dst_in;

View File

@ -2,11 +2,11 @@
uniform vec4 color;
vec4 main() {
float _1_fma;
float _2_0_mul;
_2_0_mul = color.x * color.y;
float _2_mul;
_2_mul = color.x * color.y;
float _8_add;
float _9_c = _2_0_mul + color.z;
float _9_c = _2_mul + color.z;
_8_add = _9_c;
_1_fma = _8_add;
@ -16,11 +16,11 @@ vec4 main() {
float a = _1_fma;
float _3_fma;
float _4_0_mul;
_4_0_mul = color.y * color.z;
float _4_mul;
_4_mul = color.y * color.z;
float _10_add;
float _11_c = _4_0_mul + color.w;
float _11_c = _4_mul + color.w;
_10_add = _11_c;
_3_fma = _10_add;
@ -30,11 +30,11 @@ vec4 main() {
float b = _3_fma;
float _5_fma;
float _6_0_mul;
_6_0_mul = color.z * color.w;
float _6_mul;
_6_mul = color.z * color.w;
float _12_add;
float _13_c = _6_0_mul + color.x;
float _13_c = _6_mul + color.x;
_12_add = _13_c;
_5_fma = _12_add;

View File

@ -9,10 +9,10 @@ void main() {
sk_FragColor = _0_blend_src_in;
vec4 _1_blend_dst_in;
vec4 _2_0_blend_src_in;
_2_0_blend_src_in = dst == vec4(0.0) ? vec4(0.0) : dst * src.w;
vec4 _2_blend_src_in;
_2_blend_src_in = dst == vec4(0.0) ? vec4(0.0) : dst * src.w;
_1_blend_dst_in = _2_0_blend_src_in;
_1_blend_dst_in = _2_blend_src_in;
sk_FragColor = _1_blend_dst_in;

View File

@ -9,10 +9,10 @@ void main() {
sk_FragColor = _0_blend_src_in;
vec4 _1_blend_dst_in;
vec4 _2_0_blend_src_in;
_2_0_blend_src_in = dst * src.w;
vec4 _2_blend_src_in;
_2_blend_src_in = dst * src.w;
_1_blend_dst_in = _2_0_blend_src_in;
_1_blend_dst_in = _2_blend_src_in;
sk_FragColor = _1_blend_dst_in;