• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
4struct Inputs {
5    float2 vLocalCoord_Stage0  [[user(locn0)]];
6};
7struct Outputs {
8    half4 sk_FragColor [[color(0)]];
9};
10struct uniformBuffer {
11    float4 sk_RTAdjust;
12    half2 uIncrement_Stage1_c0;
13    char pad0[12];
14    array<half4, 7> uKernel_Stage1_c0;
15    char pad1[56];
16    float3x3 umatrix_Stage1_c0_c0;
17    half4 uborder_Stage1_c0_c0_c0;
18    char pad2[8];
19    float4 usubset_Stage1_c0_c0_c0;
20    float4 unorm_Stage1_c0_c0_c0;
21};
22struct Globals {
23    constant uniformBuffer* _anonInterface0;
24    texture2d<half> uTextureSampler_0_Stage1;
25    sampler uTextureSampler_0_Stage1Smplr;
26};
27half4 MatrixEffect_Stage1_c0_c0_h4h4f2(thread Globals& _globals, half4 _input, float2 _coords) {
28    float2 _1_inCoord = (_globals._anonInterface0->umatrix_Stage1_c0_c0 * float3(_coords, 1.0)).xy;
29    _1_inCoord *= _globals._anonInterface0->unorm_Stage1_c0_c0_c0.xy;
30    float2 _2_subsetCoord;
31    _2_subsetCoord.x = _1_inCoord.x;
32    _2_subsetCoord.y = _1_inCoord.y;
33    float2 _3_clampedCoord;
34    _3_clampedCoord = _2_subsetCoord;
35    half4 _4_textureColor = _globals.uTextureSampler_0_Stage1.sample(_globals.uTextureSampler_0_Stage1Smplr, _3_clampedCoord * _globals._anonInterface0->unorm_Stage1_c0_c0_c0.zw);
36    float _5_snappedX = floor(_1_inCoord.x + 0.0010000000474974513) + 0.5;
37    if (_5_snappedX < _globals._anonInterface0->usubset_Stage1_c0_c0_c0.x || _5_snappedX > _globals._anonInterface0->usubset_Stage1_c0_c0_c0.z) {
38        _4_textureColor = _globals._anonInterface0->uborder_Stage1_c0_c0_c0;
39    }
40    return _4_textureColor;
41}
42fragment 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]]) {
43    Globals _globals{&_anonInterface0, uTextureSampler_0_Stage1, uTextureSampler_0_Stage1Smplr};
44    (void)_globals;
45    Outputs _out;
46    (void)_out;
47    half4 outputColor_Stage0;
48    half4 outputCoverage_Stage0;
49    {
50        outputColor_Stage0 = half4(1.0h);
51        outputCoverage_Stage0 = half4(1.0h);
52    }
53    half4 output_Stage1;
54    half4 _6_output;
55    _6_output = half4(0.0h, 0.0h, 0.0h, 0.0h);
56    float2 _7_coord = _in.vLocalCoord_Stage0 - float2(12.0h * _globals._anonInterface0->uIncrement_Stage1_c0);
57    float2 _8_coordSampled = float2(0.0, 0.0);
58    _8_coordSampled = _7_coord;
59    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].x;
60    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
61    _8_coordSampled = _7_coord;
62    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].y;
63    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
64    _8_coordSampled = _7_coord;
65    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].z;
66    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
67    _8_coordSampled = _7_coord;
68    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[0].w;
69    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
70    _8_coordSampled = _7_coord;
71    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].x;
72    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
73    _8_coordSampled = _7_coord;
74    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].y;
75    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
76    _8_coordSampled = _7_coord;
77    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].z;
78    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
79    _8_coordSampled = _7_coord;
80    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[1].w;
81    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
82    _8_coordSampled = _7_coord;
83    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].x;
84    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
85    _8_coordSampled = _7_coord;
86    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].y;
87    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
88    _8_coordSampled = _7_coord;
89    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].z;
90    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
91    _8_coordSampled = _7_coord;
92    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[2].w;
93    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
94    _8_coordSampled = _7_coord;
95    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].x;
96    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
97    _8_coordSampled = _7_coord;
98    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].y;
99    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
100    _8_coordSampled = _7_coord;
101    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].z;
102    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
103    _8_coordSampled = _7_coord;
104    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[3].w;
105    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
106    _8_coordSampled = _7_coord;
107    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].x;
108    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
109    _8_coordSampled = _7_coord;
110    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].y;
111    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
112    _8_coordSampled = _7_coord;
113    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].z;
114    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
115    _8_coordSampled = _7_coord;
116    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[4].w;
117    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
118    _8_coordSampled = _7_coord;
119    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].x;
120    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
121    _8_coordSampled = _7_coord;
122    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].y;
123    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
124    _8_coordSampled = _7_coord;
125    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].z;
126    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
127    _8_coordSampled = _7_coord;
128    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[5].w;
129    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
130    _8_coordSampled = _7_coord;
131    _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[6].x;
132    _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0);
133    _6_output *= outputColor_Stage0;
134    output_Stage1 = _6_output;
135    {
136        _out.sk_FragColor = output_Stage1 * outputCoverage_Stage0;
137    }
138    return _out;
139}
140