nir: Separate texture from sampler in nir_tex_instr
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 Nov 2015 01:58:29 +0000 (17:58 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Feb 2016 23:00:17 +0000 (15:00 -0800)
commit5ec456375e4fdd0b6c7d797f99191044e19ead74
treec34b2d2e4560f516ef3ab10bd798a6a3b7c469c1
parentee85014b90af1d94d637ec763a803479e9bac5dc
nir: Separate texture from sampler in nir_tex_instr

This commit adds the capability to NIR to support separate textures and
samplers.  As it currently stands, glsl_to_nir only sets the texture deref
and leaves the sampler deref alone as it did before and nir_lower_samplers
assumes this.  Backends can still assume that they are combined and only
look at only at the texture index.  Or, if they wish, they can assume that
they are separate because nir_lower_samplers, tgsi_to_nir, and prog_to_nir
all set both texture and sampler index whenever a sampler is required (the
two indices are the same in this case).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
14 files changed:
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_instr_set.c
src/compiler/nir/nir_lower_samplers.c
src/compiler/nir/nir_lower_tex.c
src/compiler/nir/nir_opt_constant_folding.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_remove_dead_variables.c
src/compiler/nir/nir_validate.c
src/gallium/auxiliary/nir/tgsi_to_nir.c
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
src/mesa/program/prog_to_nir.c