nir: check shader type before writing to shaderinfo.tess union
authorMark Janes <markjanes@swizzler.org>
Tue, 31 Mar 2020 23:40:57 +0000 (16:40 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Apr 2020 20:25:55 +0000 (20:25 +0000)
commit90a8b458acea4231a921962bee220ba76e6517a2
tree316c2a2baf1ed58b4e9200491382b1f5fd221a5d
parente47bf7dadff612694cf61eedbabc7b313766053f
nir: check shader type before writing to shaderinfo.tess union

If the shader is not a tesselation shader, then writing to the tess
member of the shaderinfo union will overwrite other members and crash.

Closes: #2722
Fixes: f1dd81ae104 ("nir: Collect if shader uses cross-invocation or indirect I/O.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4408>
src/compiler/nir/nir_gather_info.c