_CameraDepthTexture strange visual artifacts

I have almost finished an outline effect which I would like to only be visible when the object is occluded.

As you can see its almost there, the issue is with how I am sampling the _CameraDepthTexture per object. I am sure its something simple.

Thanks!

Shader "Hidden/LM/Effects/GlowableMask"
{
    SubShader
    {
        Tags { "RenderType"="Opaque" }

        LOD 100

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
            };

            struct v2f
            {
                float4 vertex : SV_POSITION;
                float4 screenPos : TEXCOORD2;
            };

            v2f vert (appdata v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
                o.screenPos = ComputeScreenPos(o.vertex);
                return o;
            }
           
            fixed4 _GlowColor;

            sampler2D _CameraDepthTexture;

            fixed4 frag(v2f i) : SV_Target
            {
                float existingDepth01 = tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)).r;
                float existingDepthLinear = LinearEyeDepth(existingDepth01);

                _GlowColor.a = 1;

                if (i.screenPos.w <= existingDepthLinear)
                {
                    _GlowColor = fixed4(0, 0, 0, 0);
                }
               
                return _GlowColor;
            }
            ENDCG
        }
    }
}

I actually worked it out. Because I am rendering a mask over the original object it, it is conflicting with its depth (because they are the same) so we end up with a sort of Z-Fighting effect. By offsetting the tested depth by 0.001 it fixes the issue.

Maybe there is a more elegant way?

no