When does Depth/Stencil Test happen in Unity's Forward Rendering pipeline?

Hi,

Here is Unity’s official document for Culling & Depth Testing. And the illustration in this document shows that the Depth Test stage happens before Fragment Shader.

It seems different with DX Graphics pipeline. In DX Graphics pipeline, the Depth Test happens after Fragment Shader, even later than Alpha Test.

Then, I’ve got 3 questions:

  1. Does Unity ShaderLab can control the sequence of pipeline stages over DX/Open GL?
  2. Is there any document or article to show the Unity’s full Forward Rendering pipeline?
  3. When does Stencil Test stage happen? (I guess just right before Depth Test, but not sure)

I’m really confused with these questions Now.
Any reply would be appreciated.

THX

It seems different with DX Graphics pipeline. In DX Graphics pipeline, the Depth Test happens after Fragment Shader, even later than Alpha Test.

This is the spec but most (hardware) implementations actually run the tests before the pixel shader.