mesa/st: Fix iris regression with clip distances.
authorEmma Anholt <emma@anholt.net>
Tue, 18 May 2021 23:57:30 +0000 (16:57 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 May 2021 17:16:10 +0000 (17:16 +0000)
commita76ec17f12c39a88cf44e039a62ed74aca4a19f2
tree43346700e390f011357eb7d5d0c6c8e51ab30a3c
parenta7b1f30d1f0f169d0ba7c1c426362e59cd690162
mesa/st: Fix iris regression with clip distances.

In general gallium shaders are all SSO and it's up to the driver to handle
lining up varying storage between stages at draw time.  However, there's a
NIR option "unify_interfaces" that iris uses which applies to non-SSO (as
indicated by nir->info.separate_shader) shaders and makes the inputs_read
and outputs_written match up at GLSL-to-NIR link time, and then iris then
avoids any lowering passes that would add new varyings.

By introducing info gathering after variant creation (because all I knew
was "gallium is always SSO"), I broke the unify_interfaces link-time setup
on iris.  Just skip that when the unify_interfaces flag is set, and add
some asserts to catch anyone trying to mix unify_interfaces with known
varying-adjusting lowering passes.

Closes: #4450
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10876>
src/mesa/state_tracker/st_program.c