spirv: Eliminate dead input/output variables after translation.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Feb 2019 00:45:25 +0000 (16:45 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Feb 2019 19:03:56 +0000 (11:03 -0800)
commit6775665e5eec7db3f291508a8b7ba2a792f62ec0
tree9a37e26e835d81031d5ae95de1ecc060084f385b
parent39aee57523a02552e7eae7df5da488e535aeb1eb
spirv: Eliminate dead input/output variables after translation.

spirv_to_nir can generate input/output variables which are illegal
for the current shader stage, which would cause nir_validate_shader
to balk.  After my recent commit to start decorating arrays as compact,
dEQP-VK.spirv_assembly.instruction.graphics.module.same_module started
hitting validation errors due to outputs in a TCS (not intended for the
TCS at all) not being per-vertex arrays.

Thanks to Jason Ekstrand for suggesting this approach.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109573
Fixes: ef99f4c8d17 compiler: Mark clip/cull distance arrays as compact before lowering.
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
src/compiler/spirv/spirv_to_nir.c