llvmpipe: fix invalid memory used in lp_fs_linear_run
authorBrian Paul <brianp@vmware.com>
Mon, 6 Jun 2022 21:06:49 +0000 (15:06 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 14 Jul 2022 19:16:07 +0000 (19:16 +0000)
commitc6f9a91015afa967987087cab8ce870a03868fb2
tree66afca2eb308ee9ca58e8da9bcafc4b90daf47d5
parent3743f74d3061e2dd95306aa36c35b99367c3c059
llvmpipe: fix invalid memory used in lp_fs_linear_run

We were saving the address of the constants[] and nir_constants[]
arrays in the jit structure.  But those arrays went out of scope
before use.

This patch moves the constants[] array to the function scope and
consolidates the TGSI/NIR paths.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
src/gallium/drivers/llvmpipe/lp_linear.c