This was caused by missing depth of objects. The old implementation was relying on the external engine to provide the correct depth of the objects. This patch does exactly this. The downside is that, if overlays are present, the prepass will be also drawn by the overlay engine. Pull Request: https://projects.blender.org/blender/blender/pulls/138004