What it does
Early-Z tests depth early so the GPU can skip shading fragments hidden behind nearer surfaces. It can avoid expensive invisible work, subject to the draw's conditions.
How to use it
Early depth testing can reject hidden fragments before expensive shader work. Eligibility depends on depth state, order, shader side effects and depth output.
A concrete example
Drawing an opaque wall before expensive hidden geometry can avoid work. Transparent overlap and alpha clipping do not guarantee identical early-rejection behavior.
How to check it
- Inspect depth state and compare GPU pass cost.
Testing and writing are separate settings - Do not assume adding one shader instruction forces identical early-Z behavior across devices.
Testing and writing are separate settings
Limitations
Clipping/depth writes can impose constraints; it is not a guaranteed 100% toggle.