zink: ARB_gl_spirv discussion
Issues
There's some stuff going on in these tests that I haven't seen anywhere else:
- xfb outputs which dump an entire struct into a buffer without the writes being broken into components (spec@arb_gl_spirv@execution@xfb@vs_block_array)
- block SSBOs with valid
nir_variable::data.binding
values (these are usually mangled beyond use by gl_nir_lower_buffers, but for spirv shaders they're valid without providing any hint of this)- this is potentially fixed, at least in part, by rewriting all the UBO/SSBO code to not let gl_nir_lower_buffers run, but that's a longer-term project given how much rewriting and testing would need to be done
It seems like there's some nir pass that glsl shaders run to break down xfb writes and avoid the first part of this, but I'm not sure which one.
The second issue I don't know what to do short of trying the rewrite and seeing what happens, but it seems like probably explicit_binding
should be unset for all BOs processed by gl_nir_lower_buffers
?
Overall
More generally though, it seems fairly stupid to be taking spirv, converting it to nir, converting it back to spirv, converting it again to nir, and only then passing it to the vulkan driver. If anyone has more general ideas on this, it seems like something that could be improved.
cc probably @airlied @jekstrand other compiler-type people?