[Mesa-dev] [PATCH 0/8] gallium: add shader buffer support

Ilia Mirkin imirkin at alum.mit.edu
Sat Jan 2 20:37:32 PST 2016


This provides enough support in TGSI to support shader buffers. I do
away with the defunct TGSI_FILE_RESOURCE (renaming it into
TGSI_FILE_IMAGE to work with pipe_image_view), and add a brand new
TGSI_FILE_BUFFER. At the declaration level, this can have an ATOMIC
qualifier (and later a SHARED qualifier for compute shaders).

I also add memory qualifiers to LOAD/STORE opcodes, which can convey
the coherent/volatile/restrict flags as specified in the GLSL. I also
modified all of the formerly resource opcodes to work on both buffers
and images. For images they will derive the format from the IMAGE
declaration, while buffers are format-less by definition.

This is still missing a way to implement memory barriers, that will
come soon, and is not going to affect anything else I do in this
series.

For the full series I'm working on, you can look at

https://github.com/imirkin/mesa/commits/atomic3

which exposes ARB_shader_atomic_counters and
ARB_shader_storage_buffer_objects on nvc0+ (but it won't work on
maxwell -- need to add emission of atomic ops and cache control).

However this is a nice self-contained chunk to start with.

Ilia Mirkin (8):
  tgsi: add ureg support for image decls
  ureg: add buffer support to ureg
  tgsi: provide a way to encode memory qualifiers for SSBO
  tgsi: add a is_store property
  tgsi: update atomic op docs
  gallium: add PIPE_SHADER_CAP_MAX_SHADER_BUFFERS
  gallium: add PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT
  gallium: add a RESQ opcode to query info about a resource

 src/gallium/auxiliary/gallivm/lp_bld_limits.h      |   1 +
 src/gallium/auxiliary/tgsi/tgsi_build.c            | 112 ++++--
 src/gallium/auxiliary/tgsi/tgsi_dump.c             |  25 +-
 src/gallium/auxiliary/tgsi/tgsi_exec.h             |   1 +
 src/gallium/auxiliary/tgsi/tgsi_info.c             | 446 ++++++++++-----------
 src/gallium/auxiliary/tgsi/tgsi_info.h             |   1 +
 src/gallium/auxiliary/tgsi/tgsi_parse.c            |   8 +-
 src/gallium/auxiliary/tgsi/tgsi_parse.h            |   3 +-
 src/gallium/auxiliary/tgsi/tgsi_strings.c          |  12 +-
 src/gallium/auxiliary/tgsi/tgsi_strings.h          |   2 +
 src/gallium/auxiliary/tgsi/tgsi_text.c             |  42 +-
 src/gallium/auxiliary/tgsi/tgsi_ureg.c             | 182 +++++++++
 src/gallium/auxiliary/tgsi/tgsi_ureg.h             |  23 ++
 src/gallium/docs/source/screen.rst                 |   8 +
 src/gallium/docs/source/tgsi.rst                   | 105 ++---
 src/gallium/drivers/freedreno/freedreno_screen.c   |   3 +
 src/gallium/drivers/i915/i915_screen.c             |   1 +
 src/gallium/drivers/ilo/ilo_screen.c               |   1 +
 src/gallium/drivers/ilo/shader/toy_tgsi.c          |   8 +-
 src/gallium/drivers/llvmpipe/lp_screen.c           |   1 +
 .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp  |  12 +-
 src/gallium/drivers/nouveau/nv30/nv30_screen.c     |   3 +
 src/gallium/drivers/nouveau/nv50/nv50_screen.c     |   2 +
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c     |   2 +
 src/gallium/drivers/r300/r300_screen.c             |   3 +
 src/gallium/drivers/r600/r600_pipe.c               |   2 +
 src/gallium/drivers/radeonsi/si_pipe.c             |   3 +
 src/gallium/drivers/softpipe/sp_screen.c           |   1 +
 src/gallium/drivers/svga/svga_screen.c             |   4 +
 src/gallium/drivers/svga/svga_tgsi_vgpu10.c        |   2 +
 src/gallium/drivers/vc4/vc4_screen.c               |   3 +
 src/gallium/drivers/virgl/virgl_screen.c           |   1 +
 src/gallium/include/pipe/p_defines.h               |   2 +
 src/gallium/include/pipe/p_shader_tokens.h         |  28 +-
 34 files changed, 729 insertions(+), 324 deletions(-)

-- 
2.4.10



More information about the mesa-dev mailing list