[Mesa-dev] [RFCv2 00/13] gallium: add support for NIR as alternate IR

Rob Clark robdclark at gmail.com
Sun Nov 8 12:12:21 PST 2015


From: Rob Clark <robclark at freedesktop.org>

Things have progressed somewhat since the initial RFC, to the point
that all sorts of common things are working (glmark2, xonotic, stk,
etc), and piglit is *mostly* working (~330 regressions or so)..

(This is with both VS and FS converted, fwiw, compared to initial RFC
which was only using glsl_to_nir for VS.)

Some of the remaining piglit regressions might be bugs in ir3.. still
tracking down some assumptions about everything being vec4's (which is
true in the glsl->tgsi->nir path but not in the glsl->nir path).

Still some cleanup needed, now that I think I have a reasonable grasp
on how things should work.  But I think not too early to start getting
some comments.

I still need to ditch the anon union in pipe_shader_state, but was
planning to leave flag-day rename-everything changes until closer to
being ready to merge to avoid getting bogged down in rebase conflicts.

This is based on top of nir_clone, nir_shader refcnt'ing and a few
other in-flight patches which are not part of this patchset.  For the
complete branch see:

https://github.com/freedreno/mesa/commits/wip-gallium-skip-tgsi

Rob Clark (13):
  gallium: refactor pipe_shader_state to support multiple IR's
  gallium: add NIR as a possible IR
  nir: allow pre-resolved sampler uniform locations
  nir: add lowering pass for y-transform
  gallium/auxiliary: introduce nir_emulate
  mesa/st: add support for NIR as possible driver IR
  freedreno/ir3: add support for NIR as preferred IR
  freedreno/ir3: fix const_index handling for uniforms
  freedreno/ir3: handle large inputs/outputs
  freedreno/ir3: support load_front_face intrinsic
  freedreno/ir3: handle tex instrs w/ const offset
  freedreno/ir3: don't ignore local vars
  HACK: freedreno/a4xx: workaround glsl_to_nir hang..

 src/gallium/auxiliary/Makefile.sources             |   2 +
 src/gallium/auxiliary/hud/hud_context.c            |  14 +-
 src/gallium/auxiliary/nir/nir_emulate.c            | 139 +++++++
 src/gallium/auxiliary/nir/nir_emulate.h            |  34 ++
 src/gallium/auxiliary/postprocess/pp_run.c         |   4 +-
 src/gallium/auxiliary/tgsi/tgsi_ureg.c             |   6 +-
 src/gallium/auxiliary/util/u_simple_shaders.c      |  42 ++-
 src/gallium/auxiliary/util/u_tests.c               |   7 +-
 src/gallium/drivers/freedreno/a4xx/fd4_program.c   |   4 +-
 src/gallium/drivers/freedreno/freedreno_screen.c   |   5 +-
 src/gallium/drivers/freedreno/freedreno_util.h     |   1 +
 .../drivers/freedreno/ir3/ir3_compiler_nir.c       | 110 ++++--
 src/gallium/drivers/freedreno/ir3/ir3_shader.c     |  16 +-
 src/gallium/include/pipe/p_defines.h               |  13 +-
 src/gallium/include/pipe/p_state.h                 |  27 +-
 src/glsl/Makefile.sources                          |   1 +
 src/glsl/nir/nir.h                                 |  12 +
 src/glsl/nir/nir_lower_samplers.c                  |  23 +-
 src/glsl/nir/nir_lower_wpos_ytransform.c           | 320 ++++++++++++++++
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp         | 410 ++++++++++++++++++++-
 src/mesa/state_tracker/st_glsl_to_tgsi.h           |   5 +
 src/mesa/state_tracker/st_program.c                | 118 +++++-
 src/mesa/state_tracker/st_program.h                |   6 +
 23 files changed, 1247 insertions(+), 72 deletions(-)
 create mode 100644 src/gallium/auxiliary/nir/nir_emulate.c
 create mode 100644 src/gallium/auxiliary/nir/nir_emulate.h
 create mode 100644 src/glsl/nir/nir_lower_wpos_ytransform.c

-- 
2.5.0



More information about the mesa-dev mailing list