2021-03-16 14:40:11 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
2020-11-23 19:46:55 +00:00
|
|
|
struct Inputs {
|
|
|
|
float2 vLocalCoord_Stage0 [[user(locn0)]];
|
|
|
|
};
|
|
|
|
struct Outputs {
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 sk_FragColor [[color(0)]];
|
2020-11-23 19:46:55 +00:00
|
|
|
};
|
|
|
|
struct uniformBuffer {
|
|
|
|
float4 sk_RTAdjust;
|
2021-10-30 02:34:51 +00:00
|
|
|
half2 uIncrement_Stage1_c0;
|
|
|
|
char pad0[12];
|
|
|
|
array<half4, 7> uKernel_Stage1_c0;
|
|
|
|
char pad1[56];
|
2020-11-23 19:46:55 +00:00
|
|
|
float3x3 umatrix_Stage1_c0_c0;
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 uborder_Stage1_c0_c0_c0;
|
|
|
|
char pad2[8];
|
2020-11-23 19:46:55 +00:00
|
|
|
float4 usubset_Stage1_c0_c0_c0;
|
|
|
|
float4 unorm_Stage1_c0_c0_c0;
|
|
|
|
};
|
|
|
|
struct Globals {
|
|
|
|
constant uniformBuffer* _anonInterface0;
|
2021-10-30 02:34:51 +00:00
|
|
|
texture2d<half> uTextureSampler_0_Stage1;
|
2020-11-23 19:46:55 +00:00
|
|
|
sampler uTextureSampler_0_Stage1Smplr;
|
|
|
|
};
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 MatrixEffect_Stage1_c0_c0_h4h4f2(thread Globals& _globals, half4 _input, float2 _coords) {
|
2021-03-19 13:39:44 +00:00
|
|
|
float2 _1_inCoord = (_globals._anonInterface0->umatrix_Stage1_c0_c0 * float3(_coords, 1.0)).xy;
|
|
|
|
_1_inCoord *= _globals._anonInterface0->unorm_Stage1_c0_c0_c0.xy;
|
|
|
|
float2 _2_subsetCoord;
|
|
|
|
_2_subsetCoord.x = _1_inCoord.x;
|
|
|
|
_2_subsetCoord.y = _1_inCoord.y;
|
|
|
|
float2 _3_clampedCoord;
|
|
|
|
_3_clampedCoord = _2_subsetCoord;
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 _4_textureColor = _globals.uTextureSampler_0_Stage1.sample(_globals.uTextureSampler_0_Stage1Smplr, _3_clampedCoord * _globals._anonInterface0->unorm_Stage1_c0_c0_c0.zw);
|
2021-03-19 13:39:44 +00:00
|
|
|
float _5_snappedX = floor(_1_inCoord.x + 0.0010000000474974513) + 0.5;
|
|
|
|
if (_5_snappedX < _globals._anonInterface0->usubset_Stage1_c0_c0_c0.x || _5_snappedX > _globals._anonInterface0->usubset_Stage1_c0_c0_c0.z) {
|
|
|
|
_4_textureColor = _globals._anonInterface0->uborder_Stage1_c0_c0_c0;
|
2021-03-15 22:08:38 +00:00
|
|
|
}
|
2021-03-19 13:39:44 +00:00
|
|
|
return _4_textureColor;
|
2020-11-23 19:48:06 +00:00
|
|
|
}
|
2021-10-30 02:34:51 +00:00
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<half> uTextureSampler_0_Stage1[[texture(0)]], sampler uTextureSampler_0_Stage1Smplr[[sampler(0)]], constant uniformBuffer& _anonInterface0 [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
2021-01-19 18:07:55 +00:00
|
|
|
Globals _globals{&_anonInterface0, uTextureSampler_0_Stage1, uTextureSampler_0_Stage1Smplr};
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_globals;
|
2021-01-19 18:07:55 +00:00
|
|
|
Outputs _out;
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_out;
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 outputColor_Stage0;
|
|
|
|
half4 outputCoverage_Stage0;
|
2021-03-08 18:29:15 +00:00
|
|
|
{
|
2021-10-30 02:34:51 +00:00
|
|
|
outputColor_Stage0 = half4(1.0h);
|
|
|
|
outputCoverage_Stage0 = half4(1.0h);
|
2021-03-08 18:29:15 +00:00
|
|
|
}
|
2021-10-30 02:34:51 +00:00
|
|
|
half4 output_Stage1;
|
|
|
|
half4 _6_output;
|
|
|
|
_6_output = half4(0.0h, 0.0h, 0.0h, 0.0h);
|
|
|
|
float2 _7_coord = _in.vLocalCoord_Stage0 - float2(12.0h * _globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
float2 _8_coordSampled = float2(0.0, 0.0);
|
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].y;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].z;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].w;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_8_coordSampled = _7_coord;
|
2021-03-22 15:57:41 +00:00
|
|
|
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[6].x;
|
2021-10-30 02:34:51 +00:00
|
|
|
_7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
|
2021-03-19 13:39:44 +00:00
|
|
|
_6_output *= outputColor_Stage0;
|
|
|
|
output_Stage1 = _6_output;
|
2020-11-23 19:46:55 +00:00
|
|
|
{
|
2021-03-08 18:29:15 +00:00
|
|
|
_out.sk_FragColor = output_Stage1 * outputCoverage_Stage0;
|
2020-11-23 19:46:55 +00:00
|
|
|
}
|
2021-01-19 18:07:55 +00:00
|
|
|
return _out;
|
2020-11-23 19:46:55 +00:00
|
|
|
}
|