All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFCv0 0/8] gallium: add support for NIR as alternate IR
@ 2015-10-19 19:47 Rob Clark
  2015-10-19 19:47 ` [PATCH 1/8] nir: add nir_var_all enum Rob Clark
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Rob Clark @ 2015-10-19 19:47 UTC (permalink / raw)
  To: dri-devel; +Cc: Rob Clark, Jason Ekstrand

From: Rob Clark <robclark@freedesktop.org>

Still quite rough around the edges, but now it's at the point of sorta-
kinda-working-sometimes.  So I guess time to get wider feedback.

The initial goal is to figure out things that glsl_to_nir does
differently from tgsi_to_nir, so we can fix them up and have better
likelyhood of drivers being able to consume NIR from multiple sources.
Eventually I'd like to be able to re-use spriv->nir for compute/
clover support, for example.  And at some point I'd like to be able to
bypass the conversion from glsl->tgsi for mesa st.  But for now, being
able to track down and fix differences between glsl_to_nir vs tgsi_to_nir
is a good start.

With what I've added to pipe_shader_state (which is, I suppose, missing
some doc updates), the intention is that drivers can ask for an IR
other than TGSI.  And what they actually get will be either TGSI or
their preferred IR.  Drivers will have to always handle the TGSI case,
so the intention isn't to port all the different state trackers (or
internally generated shaders, etc).

I suppose pipe_compute_state needs similar treatment, but I've skipped
that for now.

Currently only the direct GLSL->NIR path is implemented for vertex
shaders, which results in a huge hack at the end of the series.  It
isn't ever intended for drivers to mix/match glsl->nir vs glsl->tgsi->
nir across shader stages.  But this is sufficient for now for me to
debug other issues.

Shader variant handling will be completely broken at the moment, without
having a nir_clone()[1]. (Ian, depending on how far that is from the top
of your TODO list, I can take a stab at that, since I might be the first
consumer.)

Also, there is some trivial shader variant handling in mesa st which
would have to be ported to NIR.  Or, perhaps, just somehow expose the
shader key to the driver.  (Currently most drivers are doing much more
variant handling within the driver, and having two levels of variants
does seem a bit silly.)

[1] https://bugs.freedesktop.org/show_bug.cgi?id=89436

(First patch isn't actually RFC.. just an issue that I noticed in the
process.)

Rob Clark (8):
  nir: add nir_var_all enum
  gallium: refactor pipe_shader_state to support multiple IR's
  gallium: add NIR as a possible IR
  mesa/st: add support for NIR as possible driver IR
  freedreno/ir3: drop tokens arg
  freedreno/ir3: add support for NIR as preferred IR
  freedreno/ir3: fix const_index handling for uniforms
  HACK: freedreno/ir3: hack for mismatch on varying slots for
    glsl->tgsi->nir vs glsl->nir

 src/gallium/auxiliary/hud/hud_context.c            |  14 +-
 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/freedreno_screen.c   |   5 +-
 src/gallium/drivers/freedreno/freedreno_util.h     |   1 +
 .../drivers/freedreno/ir3/ir3_compiler_nir.c       |  38 +++-
 src/gallium/drivers/freedreno/ir3/ir3_shader.c     |  30 ++-
 src/gallium/drivers/freedreno/ir3/ir3_shader.h     |   3 +
 src/gallium/include/pipe/p_defines.h               |  13 +-
 src/gallium/include/pipe/p_state.h                 |  21 +-
 src/glsl/nir/nir.c                                 |   4 +
 src/glsl/nir/nir.h                                 |   1 +
 src/glsl/nir/nir_lower_io.c                        |   2 +-
 src/mesa/drivers/dri/i965/brw_nir.c                |   3 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp         | 223 ++++++++++++++++++++-
 src/mesa/state_tracker/st_program.c                |  43 +++-
 18 files changed, 422 insertions(+), 38 deletions(-)

-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-19 19:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 19:47 [RFCv0 0/8] gallium: add support for NIR as alternate IR Rob Clark
2015-10-19 19:47 ` [PATCH 1/8] nir: add nir_var_all enum Rob Clark
2015-10-19 19:47 ` [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's Rob Clark
2015-10-19 19:47 ` [RFCv0 3/8] gallium: add NIR as a possible IR Rob Clark
2015-10-19 19:47 ` [RFCv0 4/8] mesa/st: add support for NIR as possible driver IR Rob Clark
2015-10-19 19:47 ` [RFCv0 5/8] freedreno/ir3: drop tokens arg Rob Clark
2015-10-19 19:47 ` [RFCv0 6/8] freedreno/ir3: add support for NIR as preferred IR Rob Clark
2015-10-19 19:48 ` [RFCv0 7/8] freedreno/ir3: fix const_index handling for uniforms Rob Clark
2015-10-19 19:48 ` [RFCv0 8/8] freedreno/ir3: hack for mismatch on varying slots for glsl->tgsi->nir vs glsl->nir Rob Clark
2015-10-19 19:51 ` [RFCv0 0/8] gallium: add support for NIR as alternate IR Ilia Mirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.