Storing data a pass makes with custom sample positions for a subsequent pass
Inform Metal when your app uses programmable sample positions for its depth render targets or copies MSAA depth data.
Overview
A render or compute pass usually stores its target’s depth data in a compressed format. Any subsequent pass has to use the correct sample positions to decompress the data before reading it. You can store depth data in a representation that uses arbitrary sample positions (see Positioning samples programmatically).
When your app uses custom sampling positions, inform Metal by setting the MTLRenderPassColorAttachmentDescriptor or MTLRenderPassDepthAttachmentDescriptor instance’s storeActionOptions property to customSamplePositions. This setting tells Metal that any subsequent pass that reads the attachment may not know the sample positions the current pass uses to generate the data. Examples of a pass that can use custom sample positions include the following:
A fragment shader that uses unique, programmable sample positions
A blit pass that copies MSAA depth data to another resource
In this scenario, Metal may decompress the depth render target and store the uncompressed data.