NVK Vulkan Driver Lands Shader Object & Graphics Pipeline Library

Written by Michael Larabel in Nouveau on 28 February 2024 at 06:38 AM EST. 4 Comments
NOUVEAU
The open-source NVIDIA "NVK" Vulkan driver within the Mesa codebase has merged support for the important VK_EXT_shader_object and VK_EXT_graphics_pipeline_library extensions. Additionally, as part of supporting these new extensions, this introduces the code for a common Vulkan runtime to Mesa.

From back in January you may recall Faith Ekstrand's proposal for Mesa Vulkan drivers to be more like Gallium3D and beginning to work on common Vulkan runtime code that can be shared amongst Mesa Vulkan drivers. With the merging of VK_EXT_shader_object and VK_EXT_graphics_pipeline_library support, the very early bits of this common runtime code have landed. Ekstrand explained in the merge request:
"This MR implements both VK_EXT_shader_object and VK_EXT_graphics_pipeline_library for NVK. It also adds a common framework to the runtime which makes implementing shader object as well as all variations of pipelines a whole lot easier. With this framework, everything looks like VK_EXT_shader_object except that a struct vk_graphics_pipeline_state may be provided at shader compile time, in which case the driver is free to bake state into shaders as long as it also hashes said state in vk_driver_shader_ops::hash_graphics_pipeline_state().

My intention is for this MR to serve as the MR for the common Vulkan runtime code. I'll be pulling a bunch of the NVK bits out into a separate MR and merging them ahead of time, at which point I'll rebase this MR. I may also try to land some of the more clean-up type vulkan runtime patches separately, leaving the bulk of the shader object framework here."

So this merge is a double win in beginning to allow more Vulkan driver code sharing in Mesa and also getting the important ESO and GPL features implemented for the NVK driver.

NVIDIA RTX 30 graphics cards


VK_EXT_shader_object introduces the VkShaderEXT object type for representing a single compiled shader stage. Vulkan shader objects are intended to be more flexible than Vulkan pipeline objects and a fundamental change to address pipeline abstraction issues that have come up within Vulkan's original design.

The VK_EXT_graphics_pipeline_library extension allows for more flexibility over compiling of graphics pipelines and to compile the stages separately and as needed/available rather than a full pipeline state object. This can be useful for game engines to reduce draw time hitching and other practical benefits.

It's great seeing NVK quickly catch-up in supporting all of the important Vulkan extensions along with the ongoing Nouveau kernel driver improvements to yield better performance for the NVIDIA open-source driver stack. These new extensions and common Vulkan runtime code will be part of next quarter's Mesa 24.1 release.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week