Khronos Vulkan Working Group Releases Shading Rate Extension to Increase Rendering Performance and Quality

The Vulkan® Working Group has just released the VK_KHR_fragment_shading_rate extension, which provides a new, flexible technique to control the fragment shading rate, enabling developers to perform shading at a lower resolution than the render targets. This fine level of control allows developers to focus shading resources where they are needed, which ultimately increases rendering performance and quality.

Figure 1: Varying Shading Rates Focuses Rendering Power to Where it is Most Needed (image courtesy of NVIDIA)

For example, in Figure 1 above seven rates are shown that are used for each frame region, including using one shading result to color four pixels (2x2), or 16 pixels (4x4), or non-square footprints such as 1x2 or 2x4. The colored overlay shows that the car, sky, and foliage have been shaded at full rate to preserve fine details, the area next to the car has been shaded once per four pixels, and the road to the far left and right periphery has been shaded once per eight pixels.

By default, Vulkan spawns at least one fragment shader invocation for each pixel covered by a primitive. This extension enables applications to request that each fragment shader invocation instead cover multiple pixels and broadcast its results to each pixel. The number of pixels covered can be set per-draw, per-primitive, based on its position in the frame, or as a combination of those. Fragments can be configured to cover between 1 and 4 pixels in each axis independently, up to a maximum of 16 pixels total (4x4). Applications can set any size they desire within these bounds, with implementations falling back to finer rates automatically when a given rate is not supported.

In addition to the API support controlling rasterization, this extension also adds Vulkan support for the SPIR-V™ SPV_KHR_fragment_shading_rate extension. That extension provides the ability to set the primitive rate from vertex, geometry, and mesh shaders, and for fragment shaders to determine the shading rate used for processing the fragment.

The extension has been published, and the rollout of tooling and other ecosystem components is being tracked here: https://github.com/KhronosGroup/Vulkan-Docs/issues/1384. Support for Variable Rate Shading for NVIDIA Turing and Ampere products can be found in Vulkan 457.00 (Windows) and 455.26.02 (Linux) drivers at developer.nvidia.com/vulkan-driver. We’re excited to have the developer and content creation communities start using this new extension and we welcome any feedback or issues. These can be shared through the Khronos Developer Slack and Vulkan GitHub Issues Tracker.

Authored by

Comments

 

Khronos® and Vulkan® are registered trademarks, and ANARI™, WebGL™, glTF™, NNEF™, OpenVX™, SPIR™, SPIR-V™, SYCL™, OpenVG™ and 3D Commerce™ are trademarks of The Khronos Group Inc. OpenXR™ is a trademark owned by The Khronos Group Inc. and is registered as a trademark in China, the European Union, Japan and the United Kingdom. OpenCL™ is a trademark of Apple Inc. and OpenGL® is a registered trademark and the OpenGL ES™ and OpenGL SC™ logos are trademarks of Hewlett Packard Enterprise used under license by Khronos. All other product names, trademarks, and/or company names are used solely for identification and belong to their respective owners.
devilish