zink: fix sampler array collision in `nir_to_spirv`
authorantonino <antonino.maniscalco@collabora.com>
Fri, 7 Apr 2023 12:41:27 +0000 (14:41 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 19:25:08 +0000 (19:25 +0000)
commita782393b1aabdbcc72d0a23bc7b84c168e7b84de
treec6f3068be547d07588f5d2b9d3725042c621a3de
parent4579fe5faded21e7d56a3c710b29272c54311d46
zink: fix sampler array collision in `nir_to_spirv`

`nir_to_spirv` has flat arrays to map driver_location to sampler
variables.

Now when bindless textures are used together with non binless textures
the sampler vars are in different descriptor sets and the binding can be
the same between different descriptor sets, this causes a collision in
arrays.

This patches chamges `nir_to_spirv` to also index the array by whether
the texture is bindless.

Fixes: bc202553e9b ("zink: implement bindless textures")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c