glsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checks
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 16 Sep 2021 11:11:30 +0000 (13:11 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 28 Oct 2021 18:01:04 +0000 (18:01 +0000)
commit95ded68984684c72a1f7313a9c0c699f62796c04
treec9a62702b41e17decba2537d9823d469f23644d1
parentc0fc76a17211891dba2ee408748f7515f1eb4e91
glsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checks

The GLSL spec says it's an error if a shader statically writes to these
2 variables.

Until this commit, Mesa refused to link a shader if it had an unused
function writing to one of these variables while another (used) function
wrote to the other.

This commit adds an option to perform dead function elimination after
the intra-stage linking step but before performing these checks.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12897>
src/compiler/glsl/linker.cpp
src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
src/gallium/auxiliary/util/u_driconf.c
src/gallium/include/frontend/api.h
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_extensions.c
src/util/driconf.h