zink: fix tcs input reservation for user vars
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 15 Apr 2021 14:20:29 +0000 (10:20 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 19 Apr 2021 13:11:04 +0000 (13:11 +0000)
commit001c6f820164be6c80b3e0d05b84f083234c90e9
tree9ebdada76b74b614461323ae578624aa6ea6d7fd
parenta8ba8eb12f8bc03927effebd926f18952a26f13a
zink: fix tcs input reservation for user vars

tcs user vars are var_size[32], which isn't actually how many slots they need,
just how big the variable is (oops), so this needs to be divided
by MAX_PATCH_VERTICES to get the real slot count

slot mapping has always been broken for all tcs inputs, but this probably fixes
all of the related issues there, including unlimited crashes when playing Tomb Raider

Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
src/gallium/drivers/zink/zink_compiler.c