nir/opt_varyings: Better handle potentially per-primitive FS inputs when linking MS and FS.
The following builtin fragment shader inputs:
- Primitive ID
- Layer
- Viewport
are not defined by the spec as per-primitive inputs, but they are effectively per-primitive when the fragment shader is used together with a mesh shader. Improve nir_opt_varyings
to handle that properly when linking MS and FS. Previously, this would only work in RADV thanks to manually hacking the primitive ID, layer and viewport to be per-primitive. I would like to remove that hack soon, hence this MR.