nir: Add nir_lower_tex options to lower sampler return formats.
authorEric Anholt <eric@anholt.net>
Wed, 19 Dec 2018 21:53:39 +0000 (13:53 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 4 Jan 2019 23:59:57 +0000 (15:59 -0800)
commitf217a94542154cff8254e0ca5e5ca986c2394be3
treea974301ed83f72f875c2a927a25f0c47984b55ad
parenta74f2aeb4fcc8765571b9120a8c8b13cee59de46
nir: Add nir_lower_tex options to lower sampler return formats.

I've been doing this in the nir-to-vir and nir-to-qir backends of v3d and
vc4, but nir could potentially do some useful stuff for us (like avoiding
unpack/repacks) if we give it the information.

v2: Skip lowering for txs/query_levels
v3: Fix a crash on old-style shadow
v4: Rename to tex_packing, use nir_format_unpack_sint/uint helpers, pack
    the enum.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_tex.c