radeonsi/nir: Check for VARYING_SLOT_PRIMITIVE_ID not SYSTEM_VALUE
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 17 Dec 2021 05:20:31 +0000 (23:20 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Dec 2021 16:02:16 +0000 (16:02 +0000)
commit732b234ddba7ed697cb1ed351d56cc4a8b56539a
treeaa8553b14a2bf01abd96f8cf82c6fda3186a886f
parent41cc6a4c7f785a76a6e846f995ffdfa99f1492b5
radeonsi/nir: Check for VARYING_SLOT_PRIMITIVE_ID not SYSTEM_VALUE

This function is called on load/store_input/output.  It makes no sense
for it to get a SYSTEM_VALUE enum.  This only doesn't explode because
SYSTEM_VALUE_PRIMITIVE_ID happens to be below VARYING_SLOT_VAR0 so it
doesn't interact with any actual varyings.  The next commit is going to
add another system value which will push SYSTEM_VALUE_PRIMITIVE_ID up by
one so it will equal VARYING_SLOT_VAR0 and then the first FS input will
always get smashed to flat which isn't what we want.

Fixes: b59bb9c07ae4 ("radeonsi: force flat for PrimID early in si_nir_scan_shader")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14198>
src/gallium/drivers/radeonsi/si_shader_nir.c