preserveInvariance
A Boolean value that indicates whether the compiler compiles vertex shaders conservatively to generate consistent position calculations.
Declaration
var preserveInvariance: Bool { get set }Discussion
The default value is false. When true, the Metal shader compiler looks at the position value in all vertex output structures that it compiles. If the position value also has the [[invariant]] attribute, the compiler compiles the corresponding vertex shader conservatively to guarantee that the GPU performs the calculations the same way. You need to preserve invariance when your renderer contains multiple render passes and requires the same position calculations in each render pass.