nir: Separate texture from sampler in nir_tex_instr

Graphics / Mesa 3D Graphics Library / Mesa - Jason Ekstrand [intel.com] - 9 February 2016 17:00 UTC

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).

5ec4563 nir: Separate texture from sampler in nir_tex_instr
src/compiler/nir/nir.c | 7 ++++++
src/compiler/nir/nir.h | 31 +++++++++++++++++++++++++-
src/compiler/nir/nir_clone.c | 7 +++++-
src/compiler/nir/nir_instr_set.c | 15 ++++++++-----
src/compiler/nir/nir_lower_samplers.c | 13 ++++++++++-
src/compiler/nir/nir_lower_tex.c | 6 ++---
src/compiler/nir/nir_opt_constant_folding.c | 11 ++++++---
src/compiler/nir/nir_print.c | 14 +++++++++---
src/compiler/nir/nir_remove_dead_variables.c | 5 +++++
src/compiler/nir/nir_validate.c | 3 +++
src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 +
src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 3 +++
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 3 +++
src/mesa/program/prog_to_nir.c | 1 +
14 files changed, 102 insertions(+), 18 deletions(-)

Upstream: cgit.freedesktop.org


  • Share