vulkan,nvk: Implement VK_EXT_shader_object and VK_EXT_graphics_pipeline_library
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.
One thing to note here is that the shader object framework provided in this MR is not exactly VK_EXT_shader_object. Instead, a few tweaks have been made to provide an interface suitable for both ESO and GPL. The new interface is also quite opinionated about what the shader compile flow should look like. I'm hopeful that most drivers won't mind this as it's already roughly what they're doing. I'm not really trying to re-create st_mesa_glsl_to_nir.c
here but I do want to enforce a bit of consistency over the early stages of the shader compile pipeline as well as the way that NIR optimzation, lowering, and linking all fit together.