In today's new blog post, I try to provide some intuition and clear up some misconceptions about early Z cull behavior on desktop GPUs. Have a read if that interests you!

https://therealmjp.github.io/posts/to-earlyz-or-not-to-earlyz/

To Early-Z, or Not To Early-Z

Depth In The Logical Rendering Pipeline Where Does Early-Z Fit In? When Does Early-Z Have To Be Disabled? Discard/Alpha Test Pixel Shader Depth Export UAVs/Storage Textures/Storage Buffers Forcing Early-Z Forced Early-Z With UAVs And Depth Writes Rasterizer Order Views/Fragment Shader Interlock Summary and Conclusion One of the things we often take for granted on GPUs is the idea of early Z testing. It’s the main reason why Z prepasses exist at all, and it’s one of the things that has allowed forward rendering to remain viable without being completely overwhelmed by pixel shader overdraw (instead it merely gets overwhelmed by quad overshading, but I digress).

@mjp great post! tiny observation not related to content at all: the images are not clickable to open full res versions, and in the downscaled versions it is very hard to see "num PS invocations" number. Maybe the test app should use a larger font for that or something.
@mjp Great blog post! Early-Z is really great if you can leverage it. One kindof unorthodox way I have (ab)used this was for shadow "occlusion culling". Usually for occlusion culling you'd use the previous frame depth buffer and project your draws into the previous frames space and check for visibility. But for shadows you can additionally use the main view for visibility information (i.e. if the object and its shadow is not on screen it does not need to be rendered to the shadow map).
@mjp The bounds of the shadow casters are usually very long and thin and pretty bad for a traditional occlusion culling test. So I just cleared the shadow maps to the FAR value and used the main-views downsampled depth buffer (I think it was mip 5 or 6) to generate frustum slabs that I rendered into the shadowmap with depth overwrite set to NEAR. So if you had good occluders in the main view you'd also mark a good portion of the shadowmaps for much cheaper early z culling.
@mjp I wouldn't recommend doing this to anyone as it is still super inefficient, but we were weeks from launch and this saved us close to 2ms in the shadow pass 😅
@mjp wow this is great, thanks for writing it!