Depth format inconsistency

Hi,


In the application I am working on I am observing an interesting behavior. When rendering shadow maps I get different values in the depth buffer depending if the stencil attachment is present or not.

By changing the format of the depth buffer used for shadow pass from

MTLPixelFormatDepth32Float
to
MTLPixelFormatDepth32Float_Stencil8
I get different values in the depth buffer (according to the GPU Frame Capture) and of course different shadows.
The oter interesting thing is that changing between MTLPixelFormatDepth32Float_Stencil and MTLPixelFormatDepth24Unorm_Stencil has no effect, event hough the depth bias should be wrong for the latter format.

Is this someone has run into?