[Mesa-dev] [PATCH v2 0/8] nir: Separate samplers and textures

Jason Ekstrand jason at jlekstrand.net
Sat Feb 6 18:19:44 UTC 2016


Sorry for the immediate re-send, but I remembered this morning some
comments that Kristian had made to me some time ago about the way I
originally spun the series.  Specifically, the original verison had a weird
concept of combined textures and samplers whereby if the texture pointer
was NULL, it grabbed it from the sampler.  Kristian pointed out that this
is completely backwards because the texture is the thing you always have
and the sampler is what should be optional.  Specifically, for texelFetch
and the various query operations, a sampler isn't required at all.  This
respin gets rid of the original bit of awkwardness and makes samplers the
thing that is optional.

The reason why I went with this bit of awkwardness in the first place was
to avoid breaking the gallium users.  To avoid this problem, this version
of the series starts off with a blind rename from sampler to texture.  That
way, when samplers are added back in, the gallium drivers don't touch them
and so they won't even notice the change.  The last patch is a patch to ir3
which does, in theory, support separate samplers and textures to actually
let them get separated.  I'll let rob decide whether he wants to do that
right now or not.

Jason Ekstrand (8):
  nir/tex_instr: Rename sampler to texture
  nir: Separate texture from sampler in nir_tex_instr
  i965/fs: Add an enum for keeping track of texture instruciton sources
  i965/fs: Separate the sampler from the surface in generate_tex
  i965/fs: Plumb separate surfaces and samplers through from NIR
  i965/vec4: Separate the sampler from the surface in generate_tex
  i965/vec4: Plumb separate surfaces and samplers through from NIR
  ir3/nir: Correctly use both tex->texture_index and tex->sampler_index

 src/compiler/nir/glsl_to_nir.cpp                   |  2 +-
 src/compiler/nir/nir.c                             |  8 ++-
 src/compiler/nir/nir.h                             | 45 ++++++++++---
 src/compiler/nir/nir_clone.c                       |  7 +-
 src/compiler/nir/nir_instr_set.c                   | 15 +++--
 src/compiler/nir/nir_lower_samplers.c              | 29 ++++++---
 src/compiler/nir/nir_lower_tex.c                   |  6 +-
 src/compiler/nir/nir_opt_constant_folding.c        | 11 +++-
 src/compiler/nir/nir_print.c                       | 18 ++++--
 src/compiler/nir/nir_remove_dead_variables.c       |  5 ++
 src/compiler/nir/nir_validate.c                    |  3 +
 src/gallium/auxiliary/nir/tgsi_to_nir.c            |  7 +-
 .../drivers/freedreno/ir3/ir3_compiler_nir.c       |  6 +-
 src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c     |  6 +-
 src/gallium/drivers/vc4/vc4_program.c              |  4 +-
 src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp    |  2 +-
 src/mesa/drivers/dri/i965/brw_fs.cpp               | 75 +++++++++++++---------
 src/mesa/drivers/dri/i965/brw_fs.h                 | 18 ++++++
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp     | 20 ++++--
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp           | 26 +++++---
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       | 30 ++++++---
 src/mesa/drivers/dri/i965/brw_vec4.h               |  3 +-
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp   | 18 ++++--
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp         | 30 ++++++---
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp     | 12 ++--
 src/mesa/program/prog_to_nir.c                     |  1 +
 26 files changed, 284 insertions(+), 123 deletions(-)

-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list