Use depth render targets and programmable sample positions effectively.
Depth data for render targets is usually stored in a compressed format that requires evaluation at specific sample positions for proper decompression. Depth render targets can now specify a
MTLStore option that stores depth data in a sample-position-agnostic representation.
MTLStore option indicates that the depth data will be read in a subsequent render pass, or blit operation, that's unaware of the programmable sample positions used to generate the data. For example, reading per-sample depth data within a fragment function that uses different programmable sample positions; or, issuing a copy operation from the MSAA depth data to another resource.
If you specify a
MTLStore option, Metal may decompress the depth render target and store the resulting data in its decompressed form. If you don't change programmable sample positions in a subsequent render pass, specify a
MTLStore action instead with the
MTLStore option to improve performance.