nir/lower_tex: use a callback to check sampler return size packing
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 7 Aug 2023 08:48:45 +0000 (10:48 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Aug 2023 07:10:00 +0000 (07:10 +0000)
commitb2de3f71dc516fb0e44d3d1ea4d4930649104e97
treea0c47d69346d03e9e6879cebddd1a03579e3a8a3
parent374c660582c4b40702f91fa8c1e9ca247d275efc
nir/lower_tex: use a callback to check sampler return size packing

The lower_tex_packing pass relies on the sampler index to access packing
information, but this is only valid for tex instructions that have sampler
state (so not txf, etc). Instead, let backends provide a callback to inform
the lowering about the packing used with a given texture instruction which
is more flexible.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_tex.c