1cb93a386Sopenharmony_cilayout(binding=0) uniform sampler2D uTextureSampler_0_Stage1; 2cb93a386Sopenharmony_cilayout (binding=0) uniform uniformBuffer 3cb93a386Sopenharmony_ci{ 4cb93a386Sopenharmony_ci layout(offset=0) float4 sk_RTAdjust; 5cb93a386Sopenharmony_ci layout(offset=16) half2 uIncrement_Stage1_c0; 6cb93a386Sopenharmony_ci layout(offset=32) half4 uKernel_Stage1_c0[7]; 7cb93a386Sopenharmony_ci layout(offset=144) float3x3 umatrix_Stage1_c0_c0; 8cb93a386Sopenharmony_ci layout(offset=192) half4 uborder_Stage1_c0_c0_c0; 9cb93a386Sopenharmony_ci layout(offset=208) float4 usubset_Stage1_c0_c0_c0; 10cb93a386Sopenharmony_ci layout(offset=224) float4 unorm_Stage1_c0_c0_c0; 11cb93a386Sopenharmony_ci}; 12cb93a386Sopenharmony_cilayout(location = 0) in float2 vLocalCoord_Stage0; 13cb93a386Sopenharmony_cilayout(location = 0, index = 0) out half4 sk_FragColor; 14cb93a386Sopenharmony_cihalf4 TextureEffect_Stage1_c0_c0_c0(half4 _input, float2 _coords) 15cb93a386Sopenharmony_ci{ 16cb93a386Sopenharmony_ci half4 _output; 17cb93a386Sopenharmony_ci float2 inCoord = _coords; 18cb93a386Sopenharmony_ci inCoord *= unorm_Stage1_c0_c0_c0.xy; 19cb93a386Sopenharmony_ci float2 subsetCoord; 20cb93a386Sopenharmony_ci subsetCoord.x = inCoord.x; 21cb93a386Sopenharmony_ci subsetCoord.y = inCoord.y; 22cb93a386Sopenharmony_ci float2 clampedCoord; 23cb93a386Sopenharmony_ci clampedCoord = subsetCoord; 24cb93a386Sopenharmony_ci half4 textureColor = sample(uTextureSampler_0_Stage1, (clampedCoord) * unorm_Stage1_c0_c0_c0.zw); 25cb93a386Sopenharmony_ci float snappedX = floor(inCoord.x + 0.001) + 0.5; 26cb93a386Sopenharmony_ci if (snappedX < usubset_Stage1_c0_c0_c0.x || snappedX > usubset_Stage1_c0_c0_c0.z) 27cb93a386Sopenharmony_ci { 28cb93a386Sopenharmony_ci textureColor = uborder_Stage1_c0_c0_c0; 29cb93a386Sopenharmony_ci } 30cb93a386Sopenharmony_ci return textureColor; 31cb93a386Sopenharmony_ci} 32cb93a386Sopenharmony_cihalf4 MatrixEffect_Stage1_c0_c0(half4 _input, float2 _coords) 33cb93a386Sopenharmony_ci{ 34cb93a386Sopenharmony_ci half4 _output; 35cb93a386Sopenharmony_ci return TextureEffect_Stage1_c0_c0_c0(_input, ((umatrix_Stage1_c0_c0) * _coords.xy1).xy); 36cb93a386Sopenharmony_ci} 37cb93a386Sopenharmony_ciinline half4 GaussianConvolution_Stage1_c0(half4 _input) 38cb93a386Sopenharmony_ci{ 39cb93a386Sopenharmony_ci half4 _output; 40cb93a386Sopenharmony_ci _output = half4(0, 0, 0, 0); 41cb93a386Sopenharmony_ci float2 coord = vLocalCoord_Stage0 - 12.0 * uIncrement_Stage1_c0; 42cb93a386Sopenharmony_ci float2 coordSampled = half2(0, 0); 43cb93a386Sopenharmony_ci coordSampled = coord; 44cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[0].x; 45cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 46cb93a386Sopenharmony_ci coordSampled = coord; 47cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[0].y; 48cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 49cb93a386Sopenharmony_ci coordSampled = coord; 50cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[0].z; 51cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 52cb93a386Sopenharmony_ci coordSampled = coord; 53cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[0].w; 54cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 55cb93a386Sopenharmony_ci coordSampled = coord; 56cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[1].x; 57cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 58cb93a386Sopenharmony_ci coordSampled = coord; 59cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[1].y; 60cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 61cb93a386Sopenharmony_ci coordSampled = coord; 62cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[1].z; 63cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 64cb93a386Sopenharmony_ci coordSampled = coord; 65cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[1].w; 66cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 67cb93a386Sopenharmony_ci coordSampled = coord; 68cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[2].x; 69cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 70cb93a386Sopenharmony_ci coordSampled = coord; 71cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[2].y; 72cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 73cb93a386Sopenharmony_ci coordSampled = coord; 74cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[2].z; 75cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 76cb93a386Sopenharmony_ci coordSampled = coord; 77cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[2].w; 78cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 79cb93a386Sopenharmony_ci coordSampled = coord; 80cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[3].x; 81cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 82cb93a386Sopenharmony_ci coordSampled = coord; 83cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[3].y; 84cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 85cb93a386Sopenharmony_ci coordSampled = coord; 86cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[3].z; 87cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 88cb93a386Sopenharmony_ci coordSampled = coord; 89cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[3].w; 90cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 91cb93a386Sopenharmony_ci coordSampled = coord; 92cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[4].x; 93cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 94cb93a386Sopenharmony_ci coordSampled = coord; 95cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[4].y; 96cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 97cb93a386Sopenharmony_ci coordSampled = coord; 98cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[4].z; 99cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 100cb93a386Sopenharmony_ci coordSampled = coord; 101cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[4].w; 102cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 103cb93a386Sopenharmony_ci coordSampled = coord; 104cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[5].x; 105cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 106cb93a386Sopenharmony_ci coordSampled = coord; 107cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[5].y; 108cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 109cb93a386Sopenharmony_ci coordSampled = coord; 110cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[5].z; 111cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 112cb93a386Sopenharmony_ci coordSampled = coord; 113cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[5].w; 114cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 115cb93a386Sopenharmony_ci coordSampled = coord; 116cb93a386Sopenharmony_ci _output += MatrixEffect_Stage1_c0_c0(_input, coordSampled) * uKernel_Stage1_c0[6].x; 117cb93a386Sopenharmony_ci coord += uIncrement_Stage1_c0; 118cb93a386Sopenharmony_ci _output *= _input; 119cb93a386Sopenharmony_ci return _output; 120cb93a386Sopenharmony_ci} 121cb93a386Sopenharmony_civoid main() 122cb93a386Sopenharmony_ci{ 123cb93a386Sopenharmony_ci half4 outputColor_Stage0; 124cb93a386Sopenharmony_ci half4 outputCoverage_Stage0; 125cb93a386Sopenharmony_ci { 126cb93a386Sopenharmony_ci // Stage 0, QuadPerEdgeAAGeometryProcessor 127cb93a386Sopenharmony_ci outputColor_Stage0 = half4(1); 128cb93a386Sopenharmony_ci outputCoverage_Stage0 = half4(1); 129cb93a386Sopenharmony_ci } 130cb93a386Sopenharmony_ci half4 output_Stage1; 131cb93a386Sopenharmony_ci output_Stage1 = GaussianConvolution_Stage1_c0(outputColor_Stage0); 132cb93a386Sopenharmony_ci { 133cb93a386Sopenharmony_ci // Xfer Processor: Porter Duff 134cb93a386Sopenharmony_ci sk_FragColor = output_Stage1 * outputCoverage_Stage0; 135cb93a386Sopenharmony_ci } 136cb93a386Sopenharmony_ci} 137