             fixed4 ComputeFragment(VertexOutput vertexOutput) : SV_Target
             {
                 UNITY_SETUP_INSTANCE_ID(vertexOutput);
+
+                fixed4 color = SampleSpriteTexture(vertexOutput.TexCoord) * vertexOutput.Color;
+                color.rgb *= color.a;
 
                 int isOutlineEnabled = UNITY_ACCESS_INSTANCED_PROP(_IsOutlineEnabled);
                 fixed4 outlineColor = UNITY_ACCESS_INSTANCED_PROP(_OutlineColor);
                 int outlineSize = UNITY_ACCESS_INSTANCED_PROP(_OutlineSize);
                 float alphaThreshold = UNITY_ACCESS_INSTANCED_PROP(_AlphaThreshold);
 
-                fixed4 color = SampleSpriteTexture(vertexOutput.TexCoord) * vertexOutput.Color;
-                color.rgb *= color.a;
-
                 #ifdef SPRITE_OUTLINE_OUTSIDE
                 int shouldDrawOutline = ShouldDrawOutlineOutside(color, vertexOutput.TexCoord, isOutlineEnabled, outlineSize, alphaThreshold);
                 #else

                    float2 pixelLeftTexCoord = texCoord - float2(i * _MainTex_TexelSize.x, 0);
                    fixed pixelLeftAlpha = tex2D(_MainTex, pixelLeftTexCoord).a;
                    if (pixelLeftAlpha > alphaThreshold) return 1;
                }

                return 0;

                if (sampledColor.a > alphaThreshold) return 0;

                // Looking for an opaque pixel (sprite border from outise) around computed fragment with given depth (_OutlineSize).
                for (int i = 1; i <= SAMPLE_DEPTH_LIMIT; i++)
                {
                    float2 pixelUpTexCoord = texCoord + float2(0, i * _MainTex_TexelSize.y);
                    fixed pixelUpAlpha = tex2D(_MainTex, pixelUpTexCoord).a;
