Skip to content

zink: use GPL to handle (simple) separate shader objects

Mike Blumenkrantz requested to merge zmike/mesa:zink-sso into main

apps/games using separate shader objects end up passing the separable shaders to the link_shader hook individually, which is still not ideal for zink's usage since the more optimal path is to have all the shaders and create a RAST+FS GPL stage that can run all the inter-stage io handlers

it IS technically possible to handle this for simple VS+FS pipelines using GPL, however, but it's kinda gross. such shaders now use descriptor buffer to create their own pipelines/layouts/descriptors async, and then a "separable" variant of the gfx program can be created by fast-linking these together

the "separable" gfx program can't handle shader variants, but it can do basic pipeline caching for PSO state changes, which makes it flexible enough to sorta kinda maybe handle the most basic cases of separate shader objects

descriptor buffer is used because having to create and manage a separate architecture for sets/pools/templates is too nightmarish even for me

this is, at best, a partial solution, but it's the best the vulkan api can currently do

Merge request reports