Generate valid Metal code when globals reference one another.

`globalStruct` is now named `_skGlobals` and is passed around directly
by reference, with no additional helper variable (`_globals`) at all.

Change-Id: Icc5566d2212afd14a4d43700e89f50bedcc8b45f
Bug: skia:11168
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355717
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-01-19 11:14:54 -05:00 committed by Skia Commit-Bot
parent 0c5c3498bc
commit f8dfc3b518
27 changed files with 147 additions and 197 deletions

View File

@ -312,7 +312,7 @@ String MetalCodeGenerator::getOutParamHelper(const FunctionCall& call,
this->writeLine(";");
}
// [int _skResult = ] myFunction(inputs, outputs, globals, _var0, _var1, _var2, _var3);
// [int _skResult = ] myFunction(inputs, outputs, _skGlobals, _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 "_globals->" when writing these variables since
// names. We never want to prepend "_in." or "_skGlobals." when writing these variables since
// we're actually targeting the clones.
if (fIgnoreVariableReferenceModifiers) {
this->writeName(ref.variable()->name());
@ -1172,7 +1172,7 @@ void MetalCodeGenerator::writeVariableReference(const VariableReference& ref) {
var.type().typeKind() != Type::TypeKind::kSampler) {
this->write("_uniforms.");
} else {
this->write("_globals->");
this->write("_skGlobals.");
}
}
this->writeName(var.name());
@ -1201,7 +1201,7 @@ void MetalCodeGenerator::writeFieldAccess(const FieldAccess& f) {
this->write("_out->sk_PointSize");
} else {
if (FieldAccess::OwnerKind::kAnonymousInterfaceBlock == f.ownerKind()) {
this->write("_globals->");
this->write("_skGlobals.");
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("_globals");
this->write("_skGlobals");
separator = ", ";
}
if (requirements & kFragCoord_Requirement) {
@ -1439,7 +1439,7 @@ void MetalCodeGenerator::writeFunctionRequirementParams(const FunctionDeclaratio
}
if (requirements & kGlobals_Requirement) {
this->write(separator);
this->write("thread Globals* _globals");
this->write("thread Globals& _skGlobals");
separator = ", ";
}
if (requirements & kFragCoord_Requirement) {
@ -1450,7 +1450,7 @@ void MetalCodeGenerator::writeFunctionRequirementParams(const FunctionDeclaratio
}
bool MetalCodeGenerator::writeFunctionDeclaration(const FunctionDeclaration& f) {
fRTHeightName = fProgram.fInputs.fRTHeight ? "_globals->_anonInterface0->u_skRTHeight" : "";
fRTHeightName = fProgram.fInputs.fRTHeight ? "_skGlobals._anonInterface0->u_skRTHeight" : "";
const char* separator = "";
if ("main" == f.name()) {
switch (fProgram.fKind) {
@ -2174,7 +2174,7 @@ void MetalCodeGenerator::writeGlobalInit() {
}
void addElement() {
if (fFirst) {
fCodeGen->write(" Globals globalStruct{");
fCodeGen->write(" Globals _skGlobals{");
fFirst = false;
} else {
fCodeGen->write(", ");
@ -2183,8 +2183,6 @@ void MetalCodeGenerator::writeGlobalInit() {
void finish() {
if (!fFirst) {
fCodeGen->writeLine("};");
fCodeGen->writeLine(" thread Globals* _globals = &globalStruct;");
fCodeGen->writeLine(" (void)_globals;");
}
}
MetalCodeGenerator* fCodeGen = nullptr;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,12 +26,10 @@ 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 globalStruct{{}, {}, {}, {}};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{{}, {}, {}, {}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.xyz = matrixCompMult(_globals->a, _globals->b)[0];
_out->sk_FragColor = matrixCompMult(_globals->c, _globals->d)[0];
_out->sk_FragColor.xyz = matrixCompMult(_skGlobals.a, _skGlobals.b)[0];
_out->sk_FragColor = matrixCompMult(_skGlobals.c, _skGlobals.d)[0];
return *_out;
}

View File

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

View File

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

View File

@ -17,11 +17,9 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{{}, 123, {}, float4(4.0, 5.0, 6.0, 7.0)};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{{}, 123, {}, float4(4.0, 5.0, 6.0, 7.0)};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_globals->attr1, float(_globals->attr2), _globals->attr3, _globals->attr4.x);
_out->sk_FragColor = float4(_skGlobals.attr1, float(_skGlobals.attr2), _skGlobals.attr3, _skGlobals.attr4.x);
return *_out;
}

View File

@ -15,11 +15,9 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<float> texA[[texture(1)]], sampler texASmplr[[sampler(1)]], texture2d<float> texB[[texture(0)]], sampler texBSmplr[[sampler(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{texA, texASmplr, texB, texBSmplr};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{texA, texASmplr, texB, texBSmplr};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = _globals->texA.sample(_globals->texASmplr, float2(0.0)) * _globals->texB.sample(_globals->texBSmplr, float2(0.0));
_out->sk_FragColor = _skGlobals.texA.sample(_skGlobals.texASmplr, float2(0.0)) * _skGlobals.texB.sample(_skGlobals.texBSmplr, float2(0.0));
return *_out;
}

View File

@ -9,33 +9,31 @@ struct Outputs {
struct Globals {
float2 glob;
};
float4 fn(thread Outputs* _out, thread Globals* _globals, float a, thread float2& b, thread float2& c, thread float3& d);
float4 _skOutParamHelper0_fn(thread Outputs* _out, thread Globals* _globals, float _var0, thread float3& b, thread float2& glob, thread float3x3& d) {
float4 fn(thread Outputs* _out, thread Globals& _skGlobals, float a, thread float2& b, thread float2& c, thread float3& d);
float4 _skOutParamHelper0_fn(thread Outputs* _out, thread Globals& _skGlobals, float _var0, thread float3& b, thread float2& glob, thread float3x3& d) {
float2 _var1;
float2 _var2 = glob.yx;
float3 _var3 = d[1].zyx;
float4 _skResult = fn(_out, _globals, _var0, _var1, _var2, _var3);
float4 _skResult = fn(_out, _skGlobals, _var0, _var1, _var2, _var3);
b.yz = _var1;
glob.yx = _var2;
d[1].zyx = _var3;
return _skResult;
}
float4 fn(thread Outputs* _out, thread Globals* _globals, float a, thread float2& b, thread float2& c, thread float3& d) {
float4 fn(thread Outputs* _out, thread Globals& _skGlobals, float a, thread float2& b, thread float2& c, thread float3& d) {
a = _out->sk_FragColor.x + a;
b = _out->sk_FragColor.yz - _globals->glob.y;
b = _out->sk_FragColor.yz - _skGlobals.glob.y;
c *= a;
d = _out->sk_FragColor.www / d;
return float4(a, b.x, c.y, d.x);
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{float2(1.0)};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{float2(1.0)};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float3 b = float3(2.0);
float3x3 d = float3x3(4.0);
_out->sk_FragColor = _skOutParamHelper0_fn(_out, _globals, 1.0, b, _globals->glob, d);
_out->sk_FragColor = _skOutParamHelper0_fn(_out, _skGlobals, 1.0, b, _skGlobals.glob, d);
return *_out;
}

View File

@ -16,12 +16,10 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], texture2d<float> s[[texture(0)]], sampler sSmplr[[sampler(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{s, sSmplr};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{s, sSmplr};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 tmpColor;
_out->sk_FragColor = (tmpColor = _globals->s.sample(_globals->sSmplr, float2(1.0)) , _uniforms.colorXform != float4x4(1.0) ? float4(clamp((_uniforms.colorXform * float4(tmpColor.xyz, 1.0)).xyz, 0.0, tmpColor.w), tmpColor.w) : tmpColor);
_out->sk_FragColor = (tmpColor = _skGlobals.s.sample(_skGlobals.sSmplr, float2(1.0)) , _uniforms.colorXform != float4x4(1.0) ? float4(clamp((_uniforms.colorXform * float4(tmpColor.xyz, 1.0)).xyz, 0.0, tmpColor.w), tmpColor.w) : tmpColor);
return *_out;
}

View File

@ -24,109 +24,107 @@ struct Globals {
};
float4 MatrixEffect_Stage1_c0_c0(thread Globals* _globals, float4 _input, float2 _coords) {
float2 _1_coords = (_globals->_anonInterface0->umatrix_Stage1_c0_c0 * float3(_coords, 1.0)).xy;
float4 MatrixEffect_Stage1_c0_c0(thread Globals& _skGlobals, float4 _input, float2 _coords) {
float2 _1_coords = (_skGlobals._anonInterface0->umatrix_Stage1_c0_c0 * float3(_coords, 1.0)).xy;
float2 _2_inCoord = _1_coords;
_2_inCoord *= _globals->_anonInterface0->unorm_Stage1_c0_c0_c0.xy;
_2_inCoord *= _skGlobals._anonInterface0->unorm_Stage1_c0_c0_c0.xy;
float2 _3_subsetCoord;
_3_subsetCoord.x = _2_inCoord.x;
_3_subsetCoord.y = _2_inCoord.y;
float2 _4_clampedCoord;
_4_clampedCoord = _3_subsetCoord;
float4 _5_textureColor = _globals->uTextureSampler_0_Stage1.sample(_globals->uTextureSampler_0_Stage1Smplr, _4_clampedCoord * _globals->_anonInterface0->unorm_Stage1_c0_c0_c0.zw);
float4 _5_textureColor = _skGlobals.uTextureSampler_0_Stage1.sample(_skGlobals.uTextureSampler_0_Stage1Smplr, _4_clampedCoord * _skGlobals._anonInterface0->unorm_Stage1_c0_c0_c0.zw);
float _6_snappedX = floor(_2_inCoord.x + 0.0010000000474974513) + 0.5;
if (_6_snappedX < _globals->_anonInterface0->usubset_Stage1_c0_c0_c0.x || _6_snappedX > _globals->_anonInterface0->usubset_Stage1_c0_c0_c0.z) {
_5_textureColor = _globals->_anonInterface0->uborder_Stage1_c0_c0_c0;
if (_6_snappedX < _skGlobals._anonInterface0->usubset_Stage1_c0_c0_c0.x || _6_snappedX > _skGlobals._anonInterface0->usubset_Stage1_c0_c0_c0.z) {
_5_textureColor = _skGlobals._anonInterface0->uborder_Stage1_c0_c0_c0;
}
return _5_textureColor;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<float> uTextureSampler_0_Stage1[[texture(0)]], sampler uTextureSampler_0_Stage1Smplr[[sampler(0)]], constant uniformBuffer& _anonInterface0 [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{&_anonInterface0, uTextureSampler_0_Stage1, uTextureSampler_0_Stage1Smplr};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{&_anonInterface0, uTextureSampler_0_Stage1, uTextureSampler_0_Stage1Smplr};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float4 output_Stage1;
float4 _8_output;
_8_output = float4(0.0, 0.0, 0.0, 0.0);
float2 _9_coord = _in.vLocalCoord_Stage0 - 12.0 * _globals->_anonInterface0->uIncrement_Stage1_c0;
float2 _9_coord = _in.vLocalCoord_Stage0 - 12.0 * _skGlobals._anonInterface0->uIncrement_Stage1_c0;
float2 _10_coordSampled = float2(0.0, 0.0);
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[0].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[0].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[0].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[0].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[0].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[0].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[0].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[0].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[1].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[1].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[1].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[1].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[1].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[1].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[1].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[1].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[2].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[2].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[2].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[2].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[2].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[2].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[2].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[2].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[3].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[3].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[3].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[3].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[3].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[3].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[3].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[3].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[4].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[4].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[4].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[4].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[4].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[4].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[4].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[4].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[5].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[5].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[5].y;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[5].y;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[5].z;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[5].z;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[5].w;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[5].w;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
_10_coordSampled = _9_coord;
_8_output += MatrixEffect_Stage1_c0_c0(_globals, float4(1.0), _10_coordSampled) * _globals->_anonInterface0->uKernel_Stage1_c0[6].x;
_9_coord += _globals->_anonInterface0->uIncrement_Stage1_c0;
_8_output += MatrixEffect_Stage1_c0_c0(_skGlobals, float4(1.0), _10_coordSampled) * _skGlobals._anonInterface0->uKernel_Stage1_c0[6].x;
_9_coord += _skGlobals._anonInterface0->uIncrement_Stage1_c0;
output_Stage1 = _8_output;
{

View File

@ -12,6 +12,6 @@ struct sksl_synthetic_uniforms {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant sksl_synthetic_uniforms& _anonInterface0 [[buffer(1)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float4(_fragCoord.x, _anonInterface0.u_skRTHeight - _fragCoord.y, 0.0, _fragCoord.w).y / _globals->sk_Height;
_out->sk_FragColor.x = float4(_fragCoord.x, _anonInterface0.u_skRTHeight - _fragCoord.y, 0.0, _fragCoord.w).y / _skGlobals.sk_Height;
return *_out;
}

View File

@ -16,11 +16,9 @@ struct Globals {
constant testBlock* _anonInterface0;
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant testBlock& _anonInterface0 [[buffer(789)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{&_anonInterface0};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{&_anonInterface0};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_globals->_anonInterface0->x, _globals->_anonInterface0->y[0], _globals->_anonInterface0->y[1], 0.0);
_out->sk_FragColor = float4(_skGlobals._anonInterface0->x, _skGlobals._anonInterface0->y[0], _skGlobals._anonInterface0->y[1], 0.0);
return *_out;
}

View File

@ -13,9 +13,7 @@ struct Globals {
constant testBlock* test;
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant testBlock& test [[buffer(123)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{&test};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{&test};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_uniforms.test[1].x);

View File

@ -13,9 +13,7 @@ struct Globals {
constant testBlock* test;
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant testBlock& test [[buffer(456)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{&test};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{&test};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor = float4(_uniforms.test.x);

View File

@ -27,19 +27,17 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{true, true, true, 1.2300000190734863, 1.0, 1.0, 1, 1, 1};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{true, true, true, 1.2300000190734863, 1.0, 1.0, 1, 1, 1};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = float(_globals->BF);
_out->sk_FragColor.x = float(_globals->BI);
_out->sk_FragColor.x = float(_globals->BB);
_out->sk_FragColor.x = _globals->FF;
_out->sk_FragColor.x = _globals->FI;
_out->sk_FragColor.x = _globals->FB;
_out->sk_FragColor.x = float(_globals->IF);
_out->sk_FragColor.x = float(_globals->II);
_out->sk_FragColor.x = float(_globals->IB);
_out->sk_FragColor.x = float(_skGlobals.BF);
_out->sk_FragColor.x = float(_skGlobals.BI);
_out->sk_FragColor.x = float(_skGlobals.BB);
_out->sk_FragColor.x = _skGlobals.FF;
_out->sk_FragColor.x = _skGlobals.FI;
_out->sk_FragColor.x = _skGlobals.FB;
_out->sk_FragColor.x = float(_skGlobals.IF);
_out->sk_FragColor.x = float(_skGlobals.II);
_out->sk_FragColor.x = float(_skGlobals.IB);
return *_out;
}

View File

@ -93,12 +93,10 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{true, short(sqrt(1.0)), int(sqrt(1.0)), ushort(sqrt(1.0)), uint(sqrt(1.0)), sqrt(1.0), sqrt(1.0), _globals->s, short(_globals->i), short(_globals->us), short(_globals->ui), short(_globals->h), short(_globals->f), short(_globals->b), int(_globals->s), _globals->i, int(_globals->us), int(_globals->ui), int(_globals->h), int(_globals->f), int(_globals->b), ushort(_globals->s), ushort(_globals->i), _globals->us, ushort(_globals->ui), ushort(_globals->h), ushort(_globals->f), ushort(_globals->b), uint(_globals->s), uint(_globals->i), uint(_globals->us), _globals->ui, uint(_globals->h), uint(_globals->f), uint(_globals->b), float(_globals->s), float(_globals->i), float(_globals->us), float(_globals->ui), _globals->h, _globals->f, float(_globals->b)};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{true, short(sqrt(1.0)), int(sqrt(1.0)), ushort(sqrt(1.0)), uint(sqrt(1.0)), sqrt(1.0), sqrt(1.0), _skGlobals.s, short(_skGlobals.i), short(_skGlobals.us), short(_skGlobals.ui), short(_skGlobals.h), short(_skGlobals.f), short(_skGlobals.b), int(_skGlobals.s), _skGlobals.i, int(_skGlobals.us), int(_skGlobals.ui), int(_skGlobals.h), int(_skGlobals.f), int(_skGlobals.b), ushort(_skGlobals.s), ushort(_skGlobals.i), _skGlobals.us, ushort(_skGlobals.ui), ushort(_skGlobals.h), ushort(_skGlobals.f), ushort(_skGlobals.b), uint(_skGlobals.s), uint(_skGlobals.i), uint(_skGlobals.us), _skGlobals.ui, uint(_skGlobals.h), uint(_skGlobals.f), uint(_skGlobals.b), float(_skGlobals.s), float(_skGlobals.i), float(_skGlobals.us), float(_skGlobals.ui), _skGlobals.h, _skGlobals.f, float(_skGlobals.b)};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = (((((((((((((((((((((float(_globals->s) + float(_globals->i)) + float(_globals->us)) + float(_globals->ui)) + _globals->h) + _globals->f) + float(_globals->s2s)) + float(_globals->i2s)) + float(_globals->us2s)) + float(_globals->ui2s)) + float(_globals->h2s)) + float(_globals->f2s)) + float(_globals->b2s)) + float(_globals->s2i)) + float(_globals->i2i)) + float(_globals->us2i)) + float(_globals->ui2i)) + float(_globals->h2i)) + float(_globals->f2i)) + float(_globals->b2i)) + float(_globals->s2us)) + float(_globals->i2us)) + float(_globals->us2us);
_out->sk_FragColor.x = _out->sk_FragColor.x + ((((((((((((((((float(_globals->ui2us) + float(_globals->h2us)) + float(_globals->f2us)) + float(_globals->b2us)) + float(_globals->s2ui)) + float(_globals->i2ui)) + float(_globals->us2ui)) + float(_globals->ui2ui)) + float(_globals->h2ui)) + float(_globals->f2ui)) + float(_globals->b2ui)) + _globals->s2f) + _globals->i2f) + _globals->us2f) + _globals->ui2f) + _globals->h2f) + _globals->f2f) + _globals->b2f;
_out->sk_FragColor.x = (((((((((((((((((((((float(_skGlobals.s) + float(_skGlobals.i)) + float(_skGlobals.us)) + float(_skGlobals.ui)) + _skGlobals.h) + _skGlobals.f) + float(_skGlobals.s2s)) + float(_skGlobals.i2s)) + float(_skGlobals.us2s)) + float(_skGlobals.ui2s)) + float(_skGlobals.h2s)) + float(_skGlobals.f2s)) + float(_skGlobals.b2s)) + float(_skGlobals.s2i)) + float(_skGlobals.i2i)) + float(_skGlobals.us2i)) + float(_skGlobals.ui2i)) + float(_skGlobals.h2i)) + float(_skGlobals.f2i)) + float(_skGlobals.b2i)) + float(_skGlobals.s2us)) + float(_skGlobals.i2us)) + float(_skGlobals.us2us);
_out->sk_FragColor.x = _out->sk_FragColor.x + ((((((((((((((((float(_skGlobals.ui2us) + float(_skGlobals.h2us)) + float(_skGlobals.f2us)) + float(_skGlobals.b2us)) + float(_skGlobals.s2ui)) + float(_skGlobals.i2ui)) + float(_skGlobals.us2ui)) + float(_skGlobals.ui2ui)) + float(_skGlobals.h2ui)) + float(_skGlobals.f2ui)) + float(_skGlobals.b2ui)) + _skGlobals.s2f) + _skGlobals.i2f) + _skGlobals.us2f) + _skGlobals.ui2f) + _skGlobals.h2f) + _skGlobals.f2f) + _skGlobals.b2f;
return *_out;
}

View File

@ -15,14 +15,12 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<float> test2D[[texture(0)]], sampler test2DSmplr[[sampler(0)]], texture2d<float> test2DRect[[texture(1)]], sampler test2DRectSmplr[[sampler(1)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{test2D, test2DSmplr, test2DRect, test2DRectSmplr};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{test2D, test2DSmplr, test2DRect, test2DRectSmplr};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float3 _skTemp0;
_out->sk_FragColor = _globals->test2D.sample(_globals->test2DSmplr, float2(0.5));
_out->sk_FragColor = _globals->test2DRect.sample(_globals->test2DRectSmplr, float2(0.5));
_out->sk_FragColor = _globals->test2DRect.sample(_globals->test2DRectSmplr, (_skTemp0 = float3(0.5), _skTemp0.xy / _skTemp0.z));
_out->sk_FragColor = _skGlobals.test2D.sample(_skGlobals.test2DSmplr, float2(0.5));
_out->sk_FragColor = _skGlobals.test2DRect.sample(_skGlobals.test2DRectSmplr, float2(0.5));
_out->sk_FragColor = _skGlobals.test2DRect.sample(_skGlobals.test2DRectSmplr, (_skTemp0 = float3(0.5), _skTemp0.xy / _skTemp0.z));
return *_out;
}

View File

@ -17,27 +17,25 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{1.0, 1, 1u, true};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{1.0, 1, 1u, true};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float f1 = _globals->f;
float f2 = float(_globals->i);
float f3 = float(_globals->u);
float f4 = float(_globals->b);
int i1 = int(_globals->f);
int i2 = _globals->i;
int i3 = int(_globals->u);
int i4 = int(_globals->b);
uint u1 = uint(_globals->f);
uint u2 = uint(_globals->i);
uint u3 = _globals->u;
uint u4 = uint(_globals->b);
bool b1 = bool(_globals->f);
bool b2 = bool(_globals->i);
bool b3 = bool(_globals->u);
bool b4 = _globals->b;
float f1 = _skGlobals.f;
float f2 = float(_skGlobals.i);
float f3 = float(_skGlobals.u);
float f4 = float(_skGlobals.b);
int i1 = int(_skGlobals.f);
int i2 = _skGlobals.i;
int i3 = int(_skGlobals.u);
int i4 = int(_skGlobals.b);
uint u1 = uint(_skGlobals.f);
uint u2 = uint(_skGlobals.i);
uint u3 = _skGlobals.u;
uint u4 = uint(_skGlobals.b);
bool b1 = bool(_skGlobals.f);
bool b2 = bool(_skGlobals.i);
bool b3 = bool(_skGlobals.u);
bool b4 = _skGlobals.b;
_out->sk_FragColor.x = ((f1 + f2) + f3) + f4;
_out->sk_FragColor.x = float(((i1 + i2) + i3) + i4);
_out->sk_FragColor.x = float(((u1 + u2) + u3) + u4);

View File

@ -22,13 +22,11 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{{}, {}};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{{}, {}};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_globals->a1.x = 0;
_globals->b1.x = 0.0;
_out->sk_FragColor.x = float(_globals->a1.x) + _globals->b1.x;
_skGlobals.a1.x = 0;
_skGlobals.b1.x = 0.0;
_out->sk_FragColor.x = float(_skGlobals.a1.x) + _skGlobals.b1.x;
return *_out;
}

View File

@ -12,14 +12,12 @@ struct Globals {
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<float> tex[[texture(0)]], sampler texSmplr[[sampler(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{tex, texSmplr};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{tex, texSmplr};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
float3 _skTemp0;
float4 a = _globals->tex.sample(_globals->texSmplr, float2(0.0));
float4 b = _globals->tex.sample(_globals->texSmplr, (_skTemp0 = float3(0.0), _skTemp0.xy / _skTemp0.z));
float4 a = _skGlobals.tex.sample(_skGlobals.texSmplr, float2(0.0));
float4 b = _skGlobals.tex.sample(_skGlobals.texSmplr, (_skTemp0 = float3(0.0), _skTemp0.xy / _skTemp0.z));
_out->sk_FragColor = float4(a.xy, b.zw);
return *_out;
}

View File

@ -43,11 +43,9 @@ struct Globals {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Globals globalStruct{float2(1.0), float2(1.0, 2.0), float2(1.0), float3(float2(1.0), 1.0), int2(1), int2(float2(1.0, 2.0)), float2(int2(1, 2)), float2(_globals->v5), float4(float(_globals->v6.x), sqrt(2.0), float2(int2(3, 4))), int2(3, int(_globals->v1.x)), bool4(bool2(true, false), true, false), float2(1.0, 0.0), float2(0.0), float2(bool2(false)), bool2(true), bool2(float2(1.0)), bool3(true, bool2(int2(77)))};
thread Globals* _globals = &globalStruct;
(void)_globals;
Globals _skGlobals{float2(1.0), float2(1.0, 2.0), float2(1.0), float3(float2(1.0), 1.0), int2(1), int2(float2(1.0, 2.0)), float2(int2(1, 2)), float2(_skGlobals.v5), float4(float(_skGlobals.v6.x), sqrt(2.0), float2(int2(3, 4))), int2(3, int(_skGlobals.v1.x)), bool4(bool2(true, false), true, false), float2(1.0, 0.0), float2(0.0), float2(bool2(false)), bool2(true), bool2(float2(1.0)), bool3(true, bool2(int2(77)))};
Outputs _outputStruct;
thread Outputs* _out = &_outputStruct;
_out->sk_FragColor.x = (((((((((((((((_globals->v1.x + _globals->v2.x) + _globals->v3.x) + _globals->v4.x) + float(_globals->v5.x)) + float(_globals->v6.x)) + _globals->v7.x) + _globals->v8.x) + _globals->v9.x) + float(_globals->v10.x)) + float(_globals->v11.x)) + _globals->v12.x) + _globals->v13.x) + _globals->v14.x) + float(_globals->v15.x)) + float(_globals->v16.x)) + float(_globals->v17.x);
_out->sk_FragColor.x = (((((((((((((((_skGlobals.v1.x + _skGlobals.v2.x) + _skGlobals.v3.x) + _skGlobals.v4.x) + float(_skGlobals.v5.x)) + float(_skGlobals.v6.x)) + _skGlobals.v7.x) + _skGlobals.v8.x) + _skGlobals.v9.x) + float(_skGlobals.v10.x)) + float(_skGlobals.v11.x)) + _skGlobals.v12.x) + _skGlobals.v13.x) + _skGlobals.v14.x) + float(_skGlobals.v15.x)) + float(_skGlobals.v16.x)) + float(_skGlobals.v17.x);
return *_out;
}

View File

@ -9,6 +9,6 @@ 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 = float4(_fragCoord.x, _fragCoord.y, 0.0, _fragCoord.w).x / _globals->sk_Width;
_out->sk_FragColor.x = float4(_fragCoord.x, _fragCoord.y, 0.0, _fragCoord.w).x / _skGlobals.sk_Width;
return *_out;
}