Remove unnecessary _out pointer in Metal.

Like _globals, it's not actually necessary to indirect through a
separate pointer at all. The output struct is now passed by reference
and the additional pointer variable is removed.

(Additionally, renamed _skGlobals back to _globals.)

Change-Id: Id089a20cb751cdaedc48462a52da78ee43783611
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355632
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-01-19 13:07:55 -05:00 committed by Skia Commit-Bot
parent 37d16f1352
commit f7410bd413
205 changed files with 905 additions and 1110 deletions

View File

@ -312,7 +312,7 @@ String MetalCodeGenerator::getOutParamHelper(const FunctionCall& call,
this->writeLine(";");
}
// [int _skResult = ] myFunction(inputs, outputs, _skGlobals, _var0, _var1, _var2, _var3);
// [int _skResult = ] myFunction(inputs, outputs, _globals, _var0, _var1, _var2, _var3);
bool hasResult = (call.type().name() != "void");
if (hasResult) {
this->writeBaseType(call.type());
@ -1136,7 +1136,7 @@ void MetalCodeGenerator::writeFragCoord() {
void MetalCodeGenerator::writeVariableReference(const VariableReference& ref) {
// When assembling out-param helper functions, we copy variables into local clones with matching
// names. We never want to prepend "_in." or "_skGlobals." when writing these variables since
// names. We never want to prepend "_in." or "_globals." when writing these variables since
// we're actually targeting the clones.
if (fIgnoreVariableReferenceModifiers) {
this->writeName(ref.variable()->name());
@ -1145,7 +1145,7 @@ void MetalCodeGenerator::writeVariableReference(const VariableReference& ref) {
switch (ref.variable()->modifiers().fLayout.fBuiltin) {
case SK_FRAGCOLOR_BUILTIN:
this->write("_out->sk_FragColor");
this->write("_out.sk_FragColor");
break;
case SK_FRAGCOORD_BUILTIN:
this->writeFragCoord();
@ -1167,12 +1167,12 @@ void MetalCodeGenerator::writeVariableReference(const VariableReference& ref) {
if (var.modifiers().fFlags & Modifiers::kIn_Flag) {
this->write("_in.");
} else if (var.modifiers().fFlags & Modifiers::kOut_Flag) {
this->write("_out->");
this->write("_out.");
} else if (var.modifiers().fFlags & Modifiers::kUniform_Flag &&
var.type().typeKind() != Type::TypeKind::kSampler) {
this->write("_uniforms.");
} else {
this->write("_skGlobals.");
this->write("_globals.");
}
}
this->writeName(var.name());
@ -1194,14 +1194,14 @@ void MetalCodeGenerator::writeFieldAccess(const FieldAccess& f) {
}
switch (field->fModifiers.fLayout.fBuiltin) {
case SK_POSITION_BUILTIN:
this->write("_out->sk_Position");
this->write("_out.sk_Position");
break;
default:
if (field->fName == "sk_PointSize") {
this->write("_out->sk_PointSize");
this->write("_out.sk_PointSize");
} else {
if (FieldAccess::OwnerKind::kAnonymousInterfaceBlock == f.ownerKind()) {
this->write("_skGlobals.");
this->write("_globals.");
this->write(fInterfaceBlockNameMap[fInterfaceBlockMap[field]]);
this->write("->");
}
@ -1409,7 +1409,7 @@ void MetalCodeGenerator::writeFunctionRequirementArgs(const FunctionDeclaration&
}
if (requirements & kGlobals_Requirement) {
this->write(separator);
this->write("_skGlobals");
this->write("_globals");
separator = ", ";
}
if (requirements & kFragCoord_Requirement) {
@ -1429,7 +1429,7 @@ void MetalCodeGenerator::writeFunctionRequirementParams(const FunctionDeclaratio
}
if (requirements & kOutputs_Requirement) {
this->write(separator);
this->write("thread Outputs* _out");
this->write("thread Outputs& _out");
separator = ", ";
}
if (requirements & kUniforms_Requirement) {
@ -1439,7 +1439,7 @@ void MetalCodeGenerator::writeFunctionRequirementParams(const FunctionDeclaratio
}
if (requirements & kGlobals_Requirement) {
this->write(separator);
this->write("thread Globals& _skGlobals");
this->write("thread Globals& _globals");
separator = ", ";
}
if (requirements & kFragCoord_Requirement) {
@ -1450,7 +1450,7 @@ void MetalCodeGenerator::writeFunctionRequirementParams(const FunctionDeclaratio
}
bool MetalCodeGenerator::writeFunctionDeclaration(const FunctionDeclaration& f) {
fRTHeightName = fProgram.fInputs.fRTHeight ? "_skGlobals._anonInterface0->u_skRTHeight" : "";
fRTHeightName = fProgram.fInputs.fRTHeight ? "_globals._anonInterface0->u_skRTHeight" : "";
const char* separator = "";
if ("main" == f.name()) {
switch (fProgram.fKind) {
@ -1591,8 +1591,7 @@ void MetalCodeGenerator::writeFunction(const FunctionDefinition& f) {
if (f.declaration().name() == "main") {
this->writeGlobalInit();
this->writeLine(" Outputs _outputStruct;");
this->writeLine(" thread Outputs* _out = &_outputStruct;");
this->writeLine(" Outputs _out;");
}
fFunctionHeader = "";
@ -1891,10 +1890,10 @@ void MetalCodeGenerator::writeReturnStatementFromMain() {
// main functions in Metal return a magic _out parameter that doesn't exist in SkSL.
switch (fProgram.fKind) {
case Program::kFragment_Kind:
this->write("return *_out;");
this->write("return _out;");
break;
case Program::kVertex_Kind:
this->write("return (_out->sk_Position.y = -_out->sk_Position.y, *_out);");
this->write("return (_out.sk_Position.y = -_out.sk_Position.y, _out);");
break;
default:
SkDEBUGFAIL("unsupported kind of program");
@ -2174,7 +2173,7 @@ void MetalCodeGenerator::writeGlobalInit() {
}
void addElement() {
if (fFirst) {
fCodeGen->write(" Globals _skGlobals{");
fCodeGen->write(" Globals _globals{");
fFirst = false;
} else {
fCodeGen->write(", ");

View File

@ -11,9 +11,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(0.0);
Outputs _out;
_out.sk_FragColor = float4(0.0);
return *_out;
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
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;
@ -25,8 +24,8 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
if (_7_minComp < 0.0 && _5_lum != _7_minComp) {
_6_result = _5_lum + ((_6_result - _5_lum) * _5_lum) / (_5_lum - _7_minComp);
}
_out->sk_FragColor = float4(((((_8_maxComp > _1_alpha && _8_maxComp != _5_lum ? _5_lum + ((_6_result - _5_lum) * (_1_alpha - _5_lum)) / (_8_maxComp - _5_lum) : _6_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
_out.sk_FragColor = float4(((((_8_maxComp > _1_alpha && _8_maxComp != _5_lum ? _5_lum + ((_6_result - _5_lum) * (_1_alpha - _5_lum)) / (_8_maxComp - _5_lum) : _6_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
return *_out;
return _out;
}

View File

@ -23,9 +23,8 @@ float _color_burn_component(float2 s, float2 d) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_color_burn_component(_in.src.xw, _in.dst.xw), _color_burn_component(_in.src.yw, _in.dst.yw), _color_burn_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
Outputs _out;
_out.sk_FragColor = float4(_color_burn_component(_in.src.xw, _in.dst.xw), _color_burn_component(_in.src.yw, _in.dst.yw), _color_burn_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
return *_out;
return _out;
}

View File

@ -26,9 +26,8 @@ float _color_dodge_component(float2 s, float2 d) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_color_dodge_component(_in.src.xw, _in.dst.xw), _color_dodge_component(_in.src.yw, _in.dst.yw), _color_dodge_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
Outputs _out;
_out.sk_FragColor = float4(_color_dodge_component(_in.src.xw, _in.dst.xw), _color_dodge_component(_in.src.yw, _in.dst.yw), _color_dodge_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
return *_out;
return _out;
}

View File

@ -11,12 +11,11 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float4 _1_result = _in.src + (1.0 - _in.src.w) * _in.dst;
_1_result.xyz = min(_1_result.xyz, (1.0 - _in.dst.w) * _in.src.xyz + _in.dst.xyz);
_out->sk_FragColor = _1_result;
_out.sk_FragColor = _1_result;
return *_out;
return _out;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float4 _0_blend;
for (int _1_loop = 0;_1_loop < 1; _1_loop++) {
{
@ -23,7 +22,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
}
}
_out->sk_FragColor = _0_blend;
_out.sk_FragColor = _0_blend;
return *_out;
return _out;
}

View File

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

View File

@ -14,12 +14,11 @@ float _blend_overlay_component(float2 s, float2 d) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float4 _2_result = float4(_blend_overlay_component(_in.dst.xw, _in.src.xw), _blend_overlay_component(_in.dst.yw, _in.src.yw), _blend_overlay_component(_in.dst.zw, _in.src.zw), _in.dst.w + (1.0 - _in.dst.w) * _in.src.w);
_2_result.xyz = _2_result.xyz + _in.src.xyz * (1.0 - _in.dst.w) + _in.dst.xyz * (1.0 - _in.src.w);
_out->sk_FragColor = _2_result;
_out.sk_FragColor = _2_result;
return *_out;
return _out;
}

View File

@ -14,8 +14,7 @@ float3 _blend_set_color_saturation_helper(float3 minMidMax, float sat) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
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;
@ -46,9 +45,9 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
if (_9_minComp < 0.0 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_out->sk_FragColor = float4(((((_10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
_out.sk_FragColor = float4(((((_10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
return *_out;
return _out;
}

View File

@ -11,12 +11,11 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float4 _1_result = _in.src + (1.0 - _in.src.w) * _in.dst;
_1_result.xyz = max(_1_result.xyz, (1.0 - _in.dst.w) * _in.src.xyz + _in.dst.xyz);
_out->sk_FragColor = _1_result;
_out.sk_FragColor = _1_result;
return *_out;
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
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;
@ -25,8 +24,8 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
if (_7_minComp < 0.0 && _5_lum != _7_minComp) {
_6_result = _5_lum + ((_6_result - _5_lum) * _5_lum) / (_5_lum - _7_minComp);
}
_out->sk_FragColor = float4(((((_8_maxComp > _1_alpha && _8_maxComp != _5_lum ? _5_lum + ((_6_result - _5_lum) * (_1_alpha - _5_lum)) / (_8_maxComp - _5_lum) : _6_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
_out.sk_FragColor = float4(((((_8_maxComp > _1_alpha && _8_maxComp != _5_lum ? _5_lum + ((_6_result - _5_lum) * (_1_alpha - _5_lum)) / (_8_maxComp - _5_lum) : _6_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
return *_out;
return _out;
}

View File

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

View File

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

View File

@ -14,11 +14,10 @@ float _blend_overlay_component(float2 s, float2 d) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float4 _1_result = float4(_blend_overlay_component(_in.src.xw, _in.dst.xw), _blend_overlay_component(_in.src.yw, _in.dst.yw), _blend_overlay_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
_1_result.xyz = _1_result.xyz + _in.dst.xyz * (1.0 - _in.src.w) + _in.src.xyz * (1.0 - _in.dst.w);
_out->sk_FragColor = _1_result;
_out.sk_FragColor = _1_result;
return *_out;
return _out;
}

View File

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

View File

@ -14,8 +14,7 @@ float3 _blend_set_color_saturation_helper(float3 minMidMax, float sat) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
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;
@ -46,9 +45,9 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front
if (_9_minComp < 0.0 && _7_lum != _9_minComp) {
_8_result = _7_lum + ((_8_result - _7_lum) * _7_lum) / (_7_lum - _9_minComp);
}
_out->sk_FragColor = float4(((((_10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
_out.sk_FragColor = float4(((((_10_maxComp > _1_alpha && _10_maxComp != _7_lum ? _7_lum + ((_8_result - _7_lum) * (_1_alpha - _7_lum)) / (_10_maxComp - _7_lum) : _8_result) + _in.dst.xyz) - _3_dsa) + _in.src.xyz) - _2_sda, (_in.src.w + _in.dst.w) - _1_alpha);
return *_out;
return _out;
}

View File

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

View File

@ -28,9 +28,8 @@ float _soft_light_component(float2 s, float2 d) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = _in.dst.w == 0.0 ? _in.src : float4(_soft_light_component(_in.src.xw, _in.dst.xw), _soft_light_component(_in.src.yw, _in.dst.yw), _soft_light_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
Outputs _out;
_out.sk_FragColor = _in.dst.w == 0.0 ? _in.src : float4(_soft_light_component(_in.src.xw, _in.dst.xw), _soft_light_component(_in.src.yw, _in.dst.yw), _soft_light_component(_in.src.zw, _in.dst.zw), _in.src.w + (1.0 - _in.src.w) * _in.dst.w);
return *_out;
return _out;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = abs(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = abs(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = acos(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = acos(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = acosh(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = acosh(_in.a);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Globals {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(all(_skGlobals.a) ? 1 : 0);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = float(all(_globals.a) ? 1 : 0);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Globals {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(any(_skGlobals.a) ? 1 : 0);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = float(any(_globals.a) ? 1 : 0);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = asin(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = asin(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = asinh(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = asinh(_in.a);
return _out;
}

View File

@ -15,11 +15,10 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = atan(_in.a);
_out->sk_FragColor.x = atan2(_in.a, _in.b);
_out->sk_FragColor = atan(_in.c);
_out->sk_FragColor = atan2(_in.c, _in.d);
return *_out;
Outputs _out;
_out.sk_FragColor.x = atan(_in.a);
_out.sk_FragColor.x = atan2(_in.a, _in.b);
_out.sk_FragColor = atan(_in.c);
_out.sk_FragColor = atan2(_in.c, _in.d);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = atanh(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = atanh(_in.a);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(popcount(_in.a));
_out->sk_FragColor.y = float(popcount(_in.b));
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(popcount(_in.a));
_out.sk_FragColor.y = float(popcount(_in.b));
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = ceil(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = ceil(_in.a);
return _out;
}

View File

@ -13,8 +13,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = clamp(_in.a, _in.b, _in.c);
return *_out;
Outputs _out;
_out.sk_FragColor.x = clamp(_in.a, _in.b, _in.c);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = cos(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = cos(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = cosh(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = cosh(_in.a);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = _in.a.x * _in.b.y - _in.a.y * _in.b.x;
Outputs _out;
_out.sk_FragColor.x = _in.a.x * _in.b.y - _in.a.y * _in.b.x;
return *_out;
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = dfdx(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = dfdx(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = dfdy(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = dfdy(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = ((_in.a) * 57.2957795);
return *_out;
Outputs _out;
_out.sk_FragColor.x = ((_in.a) * 57.2957795);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Globals {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = determinant(_skGlobals.a);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = determinant(_globals.a);
return _out;
}

View File

@ -15,9 +15,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = abs(_in.a - _in.b);
_out->sk_FragColor.x = distance(_in.c, _in.d);
return *_out;
Outputs _out;
_out.sk_FragColor.x = abs(_in.a - _in.b);
_out.sk_FragColor.x = distance(_in.c, _in.d);
return _out;
}

View File

@ -15,9 +15,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = (_in.a * _in.b);
_out->sk_FragColor.x = dot(_in.c, _in.d);
return *_out;
Outputs _out;
_out.sk_FragColor.x = (_in.a * _in.b);
_out.sk_FragColor.x = dot(_in.c, _in.d);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a == _in.b).x ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a == _in.b).x ? 1 : 0);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = exp(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = exp(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = exp2(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = exp2(_in.a);
return _out;
}

View File

@ -19,9 +19,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = ((((_in.c) * (_in.b) < 0) ? 1 : -1) * (_in.a));
_out->sk_FragColor = faceforward(_in.d, _in.e, _in.f);
return *_out;
Outputs _out;
_out.sk_FragColor.x = ((((_in.c) * (_in.b) < 0) ? 1 : -1) * (_in.a));
_out.sk_FragColor = faceforward(_in.d, _in.e, _in.f);
return _out;
}

View File

@ -11,11 +11,10 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
int _skTemp0;
uint _skTemp1;
_out->sk_FragColor.x = float((_skTemp0 = (_in.a), select(ctz(_skTemp0), int(-1), _skTemp0 == int(0))));
_out->sk_FragColor.y = float((_skTemp1 = (_in.b), select(ctz(_skTemp1), uint(-1), _skTemp1 == uint(0))));
return *_out;
_out.sk_FragColor.x = float((_skTemp0 = (_in.a), select(ctz(_skTemp0), int(-1), _skTemp0 == int(0))));
_out.sk_FragColor.y = float((_skTemp1 = (_in.b), select(ctz(_skTemp1), uint(-1), _skTemp1 == uint(0))));
return _out;
}

View File

@ -11,12 +11,11 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
int _skTemp0;
int _skTemp1;
uint _skTemp2;
_out->sk_FragColor.x = float((_skTemp0 = (_in.a), _skTemp1 = (select(_skTemp0, ~_skTemp0, _skTemp0 < 0)), select(int(clz(_skTemp1)), int(-1), _skTemp1 == int(0))));
_out->sk_FragColor.y = float((_skTemp2 = (_in.b), select(int(clz(_skTemp2)), int(-1), _skTemp2 == uint(0))));
return *_out;
_out.sk_FragColor.x = float((_skTemp0 = (_in.a), _skTemp1 = (select(_skTemp0, ~_skTemp0, _skTemp0 < 0)), select(int(clz(_skTemp1)), int(-1), _skTemp1 == int(0))));
_out.sk_FragColor.y = float((_skTemp2 = (_in.b), select(int(clz(_skTemp2)), int(-1), _skTemp2 == uint(0))));
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(as_type<int>(_in.a));
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(as_type<int>(_in.a));
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(as_type<uint>(_in.a));
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(as_type<uint>(_in.a));
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = floor(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = floor(_in.a);
return _out;
}

View File

@ -13,8 +13,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = fma(_in.a, _in.b, _in.c);
return *_out;
Outputs _out;
_out.sk_FragColor.x = fma(_in.a, _in.b, _in.c);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = fract(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = fract(_in.a);
return _out;
}

View File

@ -19,9 +19,8 @@ float _skOutParamHelper0_frexp(float _var0, thread int& b) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = _skOutParamHelper0_frexp(_in.a, _skGlobals.b);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = _skOutParamHelper0_frexp(_in.a, _globals.b);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = fwidth(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = fwidth(_in.a);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a > _in.b).x ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a > _in.b).x ? 1 : 0);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a >= _in.b).x ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a >= _in.b).x ? 1 : 0);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = as_type<float>(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = as_type<float>(_in.a);
return _out;
}

View File

@ -47,9 +47,8 @@ float4x4 float4x4_inverse(float4x4 m) {
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4x4_inverse(_skGlobals.a)[0];
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor = float4x4_inverse(_globals.a)[0];
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = rsqrt(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = rsqrt(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(isinf(_in.a) ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(isinf(_in.a) ? 1 : 0);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(isnan(_in.a) ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(isnan(_in.a) ? 1 : 0);
return _out;
}

View File

@ -13,9 +13,8 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = ldexp(_in.a, _skGlobals.b);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = ldexp(_in.a, _globals.b);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = abs(_in.a);
_out->sk_FragColor.x = length(_in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = abs(_in.a);
_out.sk_FragColor.x = length(_in.b);
return _out;
}

View File

@ -19,10 +19,9 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a < _in.b).x ? 1 : 0);
_out->sk_FragColor.y = float((_in.c < _in.d).y ? 1 : 0);
_out->sk_FragColor.z = float((_in.e < _in.f).z ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a < _in.b).x ? 1 : 0);
_out.sk_FragColor.y = float((_in.c < _in.d).y ? 1 : 0);
_out.sk_FragColor.z = float((_in.e < _in.f).z ? 1 : 0);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a <= _in.b).x ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a <= _in.b).x ? 1 : 0);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = log(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = log(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = log2(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = log2(_in.a);
return _out;
}

View File

@ -26,10 +26,9 @@ matrix<float, C, R> matrixCompMult(matrix<float, C, R> a, matrix<float, C, R> b)
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}, {}, {}, {}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.xyz = matrixCompMult(_skGlobals.a, _skGlobals.b)[0];
_out->sk_FragColor = matrixCompMult(_skGlobals.c, _skGlobals.d)[0];
return *_out;
Globals _globals{{}, {}, {}, {}};
Outputs _out;
_out.sk_FragColor.xyz = matrixCompMult(_globals.a, _globals.b)[0];
_out.sk_FragColor = matrixCompMult(_globals.c, _globals.d)[0];
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = max(_in.a, _in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = max(_in.a, _in.b);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = min(_in.a, _in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = min(_in.a, _in.b);
return _out;
}

View File

@ -13,8 +13,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = mix(_in.a, _in.b, _in.c);
return *_out;
Outputs _out;
_out.sk_FragColor.x = mix(_in.a, _in.b, _in.c);
return _out;
}

View File

@ -15,16 +15,15 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float _skTemp0;
float _skTemp1;
float4 _skTemp2;
float _skTemp3;
float4 _skTemp4;
float4 _skTemp5;
_out->sk_FragColor.x = (_skTemp0 = _in.a, _skTemp1 = _in.b, _skTemp0 - _skTemp1 * floor(_skTemp0 / _skTemp1));
_out->sk_FragColor = (_skTemp2 = _in.c, _skTemp3 = _in.b, _skTemp2 - _skTemp3 * floor(_skTemp2 / _skTemp3));
_out->sk_FragColor = (_skTemp4 = _in.c, _skTemp5 = _in.d, _skTemp4 - _skTemp5 * floor(_skTemp4 / _skTemp5));
return *_out;
_out.sk_FragColor.x = (_skTemp0 = _in.a, _skTemp1 = _in.b, _skTemp0 - _skTemp1 * floor(_skTemp0 / _skTemp1));
_out.sk_FragColor = (_skTemp2 = _in.c, _skTemp3 = _in.b, _skTemp2 - _skTemp3 * floor(_skTemp2 / _skTemp3));
_out.sk_FragColor = (_skTemp4 = _in.c, _skTemp5 = _in.d, _skTemp4 - _skTemp5 * floor(_skTemp4 / _skTemp5));
return _out;
}

View File

@ -17,8 +17,7 @@ float _skOutParamHelper0_modf(float _var0, thread float& b) {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = _skOutParamHelper0_modf(_in.a, _in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = _skOutParamHelper0_modf(_in.a, _in.b);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = sign(_in.a);
_out->sk_FragColor = normalize(_in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = sign(_in.a);
_out.sk_FragColor = normalize(_in.b);
return _out;
}

View File

@ -11,9 +11,8 @@ struct Globals {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals _skGlobals{{}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(not(_skGlobals.a).x ? 1 : 0);
return *_out;
Globals _globals{{}};
Outputs _out;
_out.sk_FragColor.x = float(not(_globals.a).x ? 1 : 0);
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float((_in.a != _in.b).x ? 1 : 0);
return *_out;
Outputs _out;
_out.sk_FragColor.x = float((_in.a != _in.b).x ? 1 : 0);
return _out;
}

View File

@ -19,25 +19,24 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = outerProduct(_in.f2, _in.f2)[1].xyyy;
_out->sk_FragColor = outerProduct(_in.f3, _in.f3)[2].xyzz;
_out->sk_FragColor = outerProduct(_in.f4, _in.f4)[3];
_out->sk_FragColor = outerProduct(_in.f3, _in.f2)[1].xyzz;
_out->sk_FragColor = outerProduct(_in.f2, _in.f3)[2].xyyy;
_out->sk_FragColor = outerProduct(_in.f4, _in.f2)[1];
_out->sk_FragColor = outerProduct(_in.f2, _in.f4)[3].xyyy;
_out->sk_FragColor = outerProduct(_in.f4, _in.f3)[2];
_out->sk_FragColor = outerProduct(_in.f3, _in.f4)[3].xyzz;
_out->sk_FragColor = outerProduct(_in.h2, _in.h2)[1].xyyy;
_out->sk_FragColor = outerProduct(_in.h3, _in.h3)[2].xyzz;
_out->sk_FragColor = outerProduct(_in.h4, _in.h4)[3];
_out->sk_FragColor = outerProduct(_in.h3, _in.h2)[1].xyzz;
_out->sk_FragColor = outerProduct(_in.h2, _in.h3)[2].xyyy;
_out->sk_FragColor = outerProduct(_in.h4, _in.h2)[1];
_out->sk_FragColor = outerProduct(_in.h2, _in.h4)[3].xyyy;
_out->sk_FragColor = outerProduct(_in.h4, _in.h3)[2];
_out->sk_FragColor = outerProduct(_in.h3, _in.h4)[3].xyzz;
return *_out;
Outputs _out;
_out.sk_FragColor = outerProduct(_in.f2, _in.f2)[1].xyyy;
_out.sk_FragColor = outerProduct(_in.f3, _in.f3)[2].xyzz;
_out.sk_FragColor = outerProduct(_in.f4, _in.f4)[3];
_out.sk_FragColor = outerProduct(_in.f3, _in.f2)[1].xyzz;
_out.sk_FragColor = outerProduct(_in.f2, _in.f3)[2].xyyy;
_out.sk_FragColor = outerProduct(_in.f4, _in.f2)[1];
_out.sk_FragColor = outerProduct(_in.f2, _in.f4)[3].xyyy;
_out.sk_FragColor = outerProduct(_in.f4, _in.f3)[2];
_out.sk_FragColor = outerProduct(_in.f3, _in.f4)[3].xyzz;
_out.sk_FragColor = outerProduct(_in.h2, _in.h2)[1].xyyy;
_out.sk_FragColor = outerProduct(_in.h3, _in.h3)[2].xyzz;
_out.sk_FragColor = outerProduct(_in.h4, _in.h4)[3];
_out.sk_FragColor = outerProduct(_in.h3, _in.h2)[1].xyzz;
_out.sk_FragColor = outerProduct(_in.h2, _in.h3)[2].xyyy;
_out.sk_FragColor = outerProduct(_in.h4, _in.h2)[1];
_out.sk_FragColor = outerProduct(_in.h2, _in.h4)[3].xyyy;
_out.sk_FragColor = outerProduct(_in.h4, _in.h3)[2];
_out.sk_FragColor = outerProduct(_in.h3, _in.h4)[3].xyzz;
return _out;
}

View File

@ -11,12 +11,11 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(packHalf2x16(_in.a));
_out->sk_FragColor.x = float(packUnorm2x16(_in.a));
_out->sk_FragColor.x = float(packSnorm2x16(_in.a));
_out->sk_FragColor.x = float(packUnorm4x8(_in.b));
_out->sk_FragColor.x = float(packSnorm4x8(_in.b));
return *_out;
Outputs _out;
_out.sk_FragColor.x = float(packHalf2x16(_in.a));
_out.sk_FragColor.x = float(packUnorm2x16(_in.a));
_out.sk_FragColor.x = float(packSnorm2x16(_in.a));
_out.sk_FragColor.x = float(packUnorm4x8(_in.b));
_out.sk_FragColor.x = float(packSnorm4x8(_in.b));
return _out;
}

View File

@ -11,8 +11,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = pow(_in.a, _in.b);
return *_out;
Outputs _out;
_out.sk_FragColor.x = pow(_in.a, _in.b);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = ((_in.a) * 0.0174532925);
return *_out;
Outputs _out;
_out.sk_FragColor.x = ((_in.a) * 0.0174532925);
return _out;
}

View File

@ -15,11 +15,10 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
Outputs _out;
float _skTemp0;
float _skTemp1;
_out->sk_FragColor.x = (_skTemp0 = _in.a, _skTemp1 = _in.b, _skTemp0 - 2 * _skTemp1 * _skTemp0 * _skTemp1);
_out->sk_FragColor = reflect(_in.c, _in.d);
return *_out;
_out.sk_FragColor.x = (_skTemp0 = _in.a, _skTemp1 = _in.b, _skTemp0 - 2 * _skTemp1 * _skTemp0 * _skTemp1);
_out.sk_FragColor = reflect(_in.c, _in.d);
return _out;
}

View File

@ -17,9 +17,8 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = (refract(float2(_in.a, 0), float2(_in.b, 0), _in.c).x);
_out->sk_FragColor = refract(_in.d, _in.e, _in.c);
return *_out;
Outputs _out;
_out.sk_FragColor.x = (refract(float2(_in.a, 0), float2(_in.b, 0), _in.c).x);
_out.sk_FragColor = refract(_in.d, _in.e, _in.c);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = round(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = round(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = rint(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = rint(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = saturate(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = saturate(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = sign(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = sign(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = sin(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = sin(_in.a);
return _out;
}

View File

@ -9,8 +9,7 @@ struct Outputs {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = sinh(_in.a);
return *_out;
Outputs _out;
_out.sk_FragColor.x = sinh(_in.a);
return _out;
}

View File

@ -13,8 +13,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = smoothstep(_in.a, _in.b, _in.c);
return *_out;
Outputs _out;
_out.sk_FragColor.x = smoothstep(_in.a, _in.b, _in.c);
return _out;
}

Some files were not shown because too many files have changed in this diff Show More