hlsl – SSAO in my Unity games has flickering lines at the top and right of the screen

I tried both the integrated unity ambient occlusion that comes with the post-processing stack and another one that someone ported from the Microsoft MiniEngine: https://github.com/keijiro/MiniEngineAO.
Both have the same problem shown with these dark lines below, and the occlusion on the faces around the lines appears to flicker when the camera moves.

image

I tried solving this problem with Microsoft MiniEngine AO ​​and changing the compute shader. In one of my attempts, I changed the shader's output from the calculated occlusion:
Occlusion(OutPixel) = lerp(1, ao, gIntensity);
to be scanned for the deep texture UV:
Occlusion(OutPixel) = QuadCenterUV.x;

(QuadCenterUV is probably the center of the UV radiation that should be scanned for the 4 deep texture samples πŸ™‚

// Fetch four depths and store them in LDS
#ifdef INTERLEAVE_RESULT
    float4 depths = DepthTex.Gather(samplerDepthTex, float3(QuadCenterUV, 
DTid.z));
#else
    float4 depths = DepthTex.Gather(samplerDepthTex, QuadCenterUV);

and that was the output:
Enter image description here

With a similar effect on the Y axis. I think that could be the cause because the distortion of the UVs matches the distortion of the effect.
I don't know how to fix this because I don't have enough knowledge about RWBuffer or compute shaders.
My terrain is generated by a noise function as a 2D array, in which a mesh is built, the mesh runs Mesh.RecalculateNormals()and is then sent to the line filter.

What is the problem here and how can I fix it or can someone fix it for me?

Shader – correctly implement SSAO

I am trying to implement Normal Oriented SSAO and I have a problem with the results. Parts of the screen are inverted / wrong, usually in the middle of the screen, but not always, it seems to be camera-bound, but it can be anything, lol. Here is the resulting rendering:
Enter image description here

And here is the SSAO shader:

void main()
{

  vec3 WorldPosition = texture(GPositionsTexture, In_TexCoords).xyz;
  vec3 WorldNormal = normalize(UnScaleNormal( texture( GNormalsTexture, In_TexCoords ).xyz ));

  vec3 Random = texture(KernalNoiseTexture, In_TexCoords * KernelNoiseScale).xyz;
  vec3 Tangent = normalize(Random - WorldNormal * dot(Random, WorldNormal));
  vec3 BiTangent = cross(WorldNormal, Tangent);
  mat3 TBN = mat3(Tangent, BiTangent, WorldNormal);

  float Occlusion = 0.0;
  for (int i = 0; i < KERNEL_SIZE; ++i)
  {
    // get sample position:
    vec3 Sample = TBN * Kernel(i);
    Sample = Sample * Radius + WorldPosition;

    // project sample position:
    vec4 Offset = vec4(Sample, 1.0);
    Offset = CamData.Projection * CamData.View * Offset;
    Offset.xy /= Offset.w;
    Offset.xy = Offset.xy * 0.5 + 0.5;

    // get sample depth:
    float SampleDepth = texture(GPositionsTexture, Offset.xy).z;

    // range check & accumulate:
    float RangeCheck= abs(WorldPosition.z - SampleDepth) < Radius ? 1.0 : 0.0;
    Occlusion += (SampleDepth <= Sample.z ? 1.0 : 0.0) * RangeCheck;
  }

Occlusion = 1 - (Occlusion / KERNEL_SIZE);

Out_Diffuse = pow(Occlusion, Power);
}

OpenGL – NVIDIA SSAO visible errors

I'm trying to add a sao effect to a visualization application, but the resulting image contains errors. I use code from https://github.com/nvpro-samples/gl_ssao.
Errors occur with rapidly changing illumination near the edges of the image. Enter the image description here

The only change to the code was to remove the basic shading and just pass "white" from the scene.frag shader to make the error clearer. I also added obj input to import the Sponzaszene. However, the error is also visible in the included example scene when the camera is moved close to the object.
In this implementation, it is only possible to display objects at a relative distance. As you move closer to objects, these errors appear.

What causes this error and is there to fix?