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

Iago Toral Quiroga itoral at igalia.com
Thu Dec 1 07:53:15 UTC 2016

We need this lowering in Vulkan too do texture gradients with cube map textures
(and also with shadow samplers in IvyBridge).

Currently, we have the brw_lower_texture_gradients() pass that works on GLSL IR
and is called from the OpenGL driver. This pass is actually two passes in one:

1. A lowering pass for cube maps that is required in all cases.
2. A lowering pass for shadow samplers, that is only required in pre-haswell

This series ports the lowering pass to NIR and splits it into two different
passes, one for cube maps and one for shadow samplers other than cube maps.
I think this makes sense, because the implementation for both cases is
different and the conditions to activate the lowering are also different,
at least for Intel.

This fixes various Vulkan CTS failures for cube maps in this category:

The first patch just makes the existing get_texture_size() function more
generic so we can reuse it from the gradient lowering pass. The next 2 patches
port and enable the lowering for cubemaps and the next two port and enable the
lowering for shadow samplers (for pre-haswell hardware). The last patch gets
rid of the GLSL IR lowering pass.

Iago Toral Quiroga (6):
  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

 src/compiler/nir/nir.h                             |  12 +
 src/compiler/nir/nir_lower_tex.c                   | 312 +++++++++++++++++-
 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, 324 insertions(+), 363 deletions(-)
 delete mode 100644 src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp


More information about the mesa-dev mailing list