[Mesa-dev] [PATCH v2 0/7] i965: port texture gradient lowering to NIR

Iago Toral Quiroga itoral at igalia.com
Mon Dec 12 13:11:41 UTC 2016

Changes in v2:
  - Add a get_ddx_ddy() helper to get correct ddx/ddy srcs (patches 2 and 4)
  - Properly swizzle away components of the texture size that we don't want
    (patches 2 and 4)
  - Lower gradients on shadow cube samplers if lower_txd_shadow is set even if
    lower_txd_cubemap isn't (new patch 7)

Ken, I also tried your suggestion to simply pass the number of components we want
in get_texture_size() instead of swizzling away the components we don't care
about, but that makes us hit assertions during code generation.
This happens for example with 1d array textures, where we need to pass 2
components instead of one for example.

Since we are swizzling away undesired components in the current GLSL IR lowering
and you gave your Rb without asking for that change I did not look too much
into it, but I can spend some more time into it if you think it is worth it.

Iago Toral Quiroga (7):
  nir/lower_tex: generalize get_texture_size()
  nir/lower_tex: add lowering for texture gradient on cube maps
  i965/nir: enable lowering of texture gradient for cube maps
  nir/lower_tex: add lowering for texture gradient on shadow samplers
  i965/nir: enable lowering of texture gradient for shadow samplers
  i965: remove brw_lower_texture_gradients
  nir/lower_tex: lower gradients on shadow cube maps if lower_txd_shadow
    is set

 src/compiler/nir/nir.h                             |  12 +
 src/compiler/nir/nir_lower_tex.c                   | 338 +++++++++++++++++++-
 src/mesa/drivers/dri/i965/Makefile.sources         |   1 -
 src/mesa/drivers/dri/i965/brw_context.h            |   2 -
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp     |   2 +-
 src/mesa/drivers/dri/i965/brw_link.cpp             |   1 -
 .../dri/i965/brw_lower_texture_gradients.cpp       | 353 ---------------------
 src/mesa/drivers/dri/i965/brw_nir.c                |   4 +
 8 files changed, 350 insertions(+), 363 deletions(-)
 delete mode 100644 src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp


More information about the mesa-dev mailing list