cbd0c9eb3b
For geometry shaders, we're going to need to compile various graphics shaders down to compute shaders. This means that they'll look like compute shaders to much of the compile pipeline but ultimately get executed as graphics shaders. Most of the time, the compiler will just happily take whatever offset you give and try to load the sysval from there so you can load a graphics sysval from a compute shader just fine. However, for the common ones, we switch on the shader stage and load from a different offset for 3D vs. compute. This breaks the moment you have a compute shader that's going to actually load from a 3D sysval space. The solution here is to ensure that any common sysvals (currently just the push uniforms address and the printf buffer) are at exactly the same offset in both. This is done by adding a panvk_common_sysvals struct, some static asserts, and a bit of macro magic to keep things eurgonamic. This also changes push uniform upload to just swap in the push uniform address instead of writing it to the command buffer on every iteration. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38508>