Why does "Xcode GPU Frame Capture" shows that "PreZ Test Fails" percent is zero.

Xcode GPU Frame Capture shows that "PreZ Test Fails" percent is zero. I can't understand what is wrong.. I drawed the opaque primitives with depth test, no alpha test, no alpha blend.

I thought that "Hidden Surface Removal" removes hidden surfaces, so There is no killed fragments by "PreZ Test Kill". But I couldn't find the column about "Hidden Surface Removal". It looks that xcode gpu frame capture doesn't show the data about hidden surface removal.

I tested it on iphone 13 mini(ios 16.3), M1 Mac Ventura

Replies

When I debugged the shader on the hidden fragment, it shows "No thread execution data for the draw call" message. I think that hidden fragments is culled properly.. But I couldn't find any data that shows about it.

The PreZ test (sometimes referred to as the EarlyZ test) is a test against the depth buffer before the fragment shader is executed. Since you haven't enabled depth testing nothing is failing.

HSR refers to fragments that will not be generated due to render order. In other words. the fragment shader is not getting executed because, even though it passed EarlyZ, a triangle occupying the same pixel location is drawn later, which hides that fragment.

There is an "FS Invocations" stat which tells you the number of fragments passing both PreZ and HSR.