nir/lower_clip: make the pass compatible with Vulkan semantics
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 21 Jul 2020 10:21:39 +0000 (12:21 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 27 Jul 2020 06:25:57 +0000 (08:25 +0200)
commit17fd191eed53d0b2e599dabe38ce8e503161853c
tree5438c459a3b881bc36e6b6c61404806db5bd7e09
parent18fe130ec9e07213c5b4e1e46232e3c3c1835057
nir/lower_clip: make the pass compatible with Vulkan semantics

Vulkan allows fragment shaders to read gl_ClipDistance[], in which
case the SPIR-V compiler inserts a single compact array variable for
VARYING_SLOW_CLIP_DIST0 and the lowering should not try to inject
its own variables, but instead work in terms of the existing one.
Vulkan drivers are expected to call this with use_clipdist_array set
to true to be consistent with this setup.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6022>
src/compiler/nir/nir_lower_clip.c