Take the previous rendered depth buffer from the scene
Pass it to the forward rendering shader
All shaders, except the fragment shader, are default pass through shaders
The fragment shader calculates the screen space coordinate from the current rendered fragment
The fragment shader compares the value from the previous rendered depth buffer with the current rendered fragments depth
The fragment shader skips the fragment, if the fragments depth is higher then the previous depth value (Skip it with keyword "discard")