For a lot of games, there is no depthbuffer (old games, or using DosBox for example) or a corrupted one (emulators..).
We could build a specific version of Reshade with custom DephtBuffer (somebody already did this for emulators but it's based on an old version and pretty buggy).
So, I tried to compute/correct DepthBuffers with shaders and save it to a new texture, that i then use by modifying Reshade common library (GetLinearizedDepth).
I achieved some results but it's very hacky.
So, i wondered if it would be possible to directly write to the depthbuffer so it's available without changing commons or other shaders per game basis.
Or if it's not possible to write to the DepthBuffer, add a hook to commons to enable using a custom texture as depthbuffer.
It's not possible to write to the texture shaders reference via the "DEPTH" semantic, as that generally uses a special depth-stencil format that is read-only in shaders (and can only be written to by the rasterizer).
So the only solution is to declare a custom texture with a normal format (e.g. R32F) and use that in all shaders (simply replace "DepthBufferTex" in ReShade.fxh with a full custom texture definition, instead of the current declaration with a "DEPTH" semantic; textures with the same name are shared across effect files, so that will just work). But it sounds like you are already doing something like that.