Direct3D 11 Conservative Depth Output Details and Demo
Here is an article about one of the little-known Direct3D 11 features: conservative depth output. What is it?
Conservative depth output: this is something you use for pixel shaders that manually output a depth value. Basically rather than using SV_Depth, you use a variant that also specifiea an inequality. For instance SV_DepthGreater, or SV_DepthLessEqual. The depth you output from the shader must then satisfy the inequality relative to the interpolated depth of the rasterized triangle (if you don’t, the depth value is clamped for you). This allows the GPU to still use early-z cull, since it can still trivially reject pixels for cases where the depth test will always fail for the specified upper/lower bound. So for instance if you render a quad and output DepthGreaterEqual, the GPU can cull pixels where the quad’s depth is greater than the depth buffer value. Don’t bother looking for this one in the documentation…it’s not in there.
You can find the complete article (covering also other lesser-known D3D11 features) as well as the demo HERE.
And if I’m not wrong, AMD provides a similar feature for OpenGL developpers with the