Microsoft has just added variable rate shading support to its DirectX 12 graphics API. DirectX 12 variable rate shading (VRS) can see significant performance gains in games over their non-variable rate shading variant. The addition of VRS to DirectX 12 makes it the first graphics API to natively support the feature.
Microsoft announced the addition on March 18, and it is available to developers now. Variable rate shading does exactly what it sounds like, allows developers to set specific shading rates for different pixels being rendered. Higher shading rates allow for more visual fidelity alongside higher GPU costs whereas a lower shading rate means lower visual fidelity at a lower GPU cost.
VRS lets developers treat different pixels and parts of an image differently, focusing processing power on the parts of an image that need to be higher quality. The DirectX 12 variable rate shading lets developers set the shading rate in three ways: per draw, within a draw by using a screenspace image, or within a draw but per primitive. Alongside that, there are Tier 1 and Tier 2 hardware VRS support. Tier 1 hardware can support per-draw VRS while Tier 2 hardware can support per-draw and within-draw variable rate shading.
Tier 1 hardware can have developer specified per-draw shading rates, meaning individual assets can be shaded at a lower rate. This technique is useful for faraway obscured assets. Tier 2 hardware is where DirectX 12 variable rate shading gets more impressive. Microsoft described a number of VRS techniques developers can use to increase performance while maintaining image quality in the blog post detailing the addition. Different VRS techniques can also be combined with one another.
Microsoft worked with Firaxis to show off the DirectX 12 variable rate shading support in Civilization VI. Tier 1 hardware was able to increase framerate on an RTX 2060 at 4K by 20 percent but had visual artifacts from the VRS implementation. Tier 2 hardware, using a mix of techniques, saw a 14 percent performance increase without any noticeable quality loss.
Microsoft has a lot more information regarding DirectX 12 variable rate shading, including developer, game engine, app, and hardware support over at the blog post. MachineGames added variable rate shading to the Vulkan-powered Wolfenstein II: The New Colossus, which Digital Foundry took a deep dive into last year.