A compiled read-only object that determines how to apply variable rasterization rates when rendering.
- iOS 13.0+
- macOS 10.15.4+Beta
- Mac Catalyst 13.4+Beta
Use a rasterization rate map to reduce rendering quality in less-important or less-sampled regions of the render target, such as areas affected by blur effects or a far-away cascade of a shadow map.
By default, a render pass does not have a rasterization rate map, and the viewport coordinate system maps exactly to physical pixels in the targeted textures. If you apply a rasterization rate map to a render pass, the viewport coordinate system becomes a logical coordinate system, and the rate map describes how to map logical coordinates to physical pixels in the render pass’s targets. You can specify different rasterization rates in different regions of the logical coordinate system. When you do, those logical units map to fewer physical pixels, which means you can use smaller render targets and render fewer pixels, saving both memory and processing time. For more information, see Rendering at Different Rasterization Rates.
MTLRasterization object can be used only with the
MTLDevice that created it. Don’t implement this protocol yourself; instead, create a
MTLRasterization object, configure it, and then call the
new on a device object.
To apply a rasterization rate map to a render pass, set the render pass descriptor’s
Configuring the Rate Map
A rasterization rate map specifies the size of the viewport coordinate space in logical units and one or more layer maps. A layer map partitions the viewport coordinate space into a 2D grid of cells and defines the rasterization rate for each cell. If you aren’t using layered rendering, provide a single layer map; otherwise, provide one layer map for each layer. (For more information about layered rendering, see Rendering to Multiple Texture Slices in a Draw Command).
You can query the physical size requirements for each layer in the render pass by calling the
physical method. Your render targets must be at least this large.