Create offscreen textures to hold intermediate rasterized data.
You don’t render data directly to the final render destination using variable rasterization rates. Instead, you allocate textures to use as intermediate targets. You get the sizes for these textures from the rate map. For example, if you specified a rate of 0.5 everywhere, the intermediate texture is half the height and width of the final render target.
The rate map’s screenSize property gives the dimensions of the final render target. Call the physicalSize(layer:): method on the rate map object to get the size for each layer. Then allocate the textures you need. For example, the following code gets the physical size and allocates a color texture and a depth texture of that size:
To use variable rasterization rates, create a render pass, specifying the intermediate textures as the render targets. Set the rasterizationRateMap property to the rate map you created, as shown below: