[Mesa-dev] [PATCH 00/10] st/mesa: add shader buffer support

Ilia Mirkin imirkin at alum.mit.edu
Sun Jan 17 21:51:08 PST 2016


This series adds everything necessary to support ARB_shader_atomic_counters
and ARB_shader_storage_buffer_object. With a branch that also includes nvc0
implementation, this is passing nearly all SSBO-related dEQP tests.

In dEQP, there are 49 fails and 2106 passes, so it at least somewhat works.
Oh, and naturally this passes all of piglit's ssbo tests, but that's not saying
much (as do the more complete atomic tests). I also wrote a few tests to play
with doubles, and it also works. The full list of dEQP failures is at the
bottom.

There is no remapping table for atomic buffers, so for simplicity I just
decided to only allow a very limited number of total binding points for
atomic buffers. It should still be more than sufficient for any reasonable
usage. For nvc0, I expect to expose 32 shader buffers, of which 16 would go
towards atomic and 16 would go towards ssbo's.

Ilia Mirkin (10):
  tgsi: add MEMBAR opcode to handle memoryBarrier* GLSL intrinsics
  glsl: keep track of ssbo variable being accessed, add access params
  st/mesa: add PROGRAM_BUFFER, stop using gl_register_file
  st/mesa: add atomic counter support
  st/mesa: add support for SSBO binding and GLSL intrinsics
  st/mesa: use RESQ to find buffer size
  st/mesa: add support for memory barrier intrinsics
  st/mesa: add shader buffer barrier bit
  st/mesa: enable ARB_shader_storage_buffer_object when supported
  trace: add support for set_shader_buffers

 src/gallium/auxiliary/tgsi/tgsi_info.c        |   2 +-
 src/gallium/docs/source/tgsi.rst              |  17 ++
 src/gallium/drivers/trace/tr_context.c        |  38 +++
 src/gallium/drivers/trace/tr_dump_state.c     |  18 ++
 src/gallium/drivers/trace/tr_dump_state.h     |   2 +
 src/gallium/include/pipe/p_defines.h          |   1 +
 src/gallium/include/pipe/p_shader_tokens.h    |   2 +-
 src/glsl/lower_ubo_reference.cpp              |  23 ++
 src/glsl/nir/shader_enums.h                   |  10 +
 src/mesa/Makefile.sources                     |   2 +
 src/mesa/program/ir_to_mesa.cpp               |   4 +
 src/mesa/state_tracker/st_atom.c              |  10 +
 src/mesa/state_tracker/st_atom.h              |  10 +
 src/mesa/state_tracker/st_atom_atomicbuf.c    | 158 +++++++++++
 src/mesa/state_tracker/st_atom_storagebuf.c   | 188 ++++++++++++
 src/mesa/state_tracker/st_cb_bufferobjects.c  |   4 +
 src/mesa/state_tracker/st_cb_texturebarrier.c |   4 +
 src/mesa/state_tracker/st_context.c           |   2 +
 src/mesa/state_tracker/st_context.h           |   2 +
 src/mesa/state_tracker/st_extensions.c        |  30 ++
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp    | 392 ++++++++++++++++++++++++--
 21 files changed, 890 insertions(+), 29 deletions(-)
 create mode 100644 src/mesa/state_tracker/st_atom_atomicbuf.c
 create mode 100644 src/mesa/state_tracker/st_atom_storagebuf.c


dEQP fails for tests containing "ssbo" in the name, with annotations:

deqp-gles31/functional/compute/basic/copy_image_to_ssbo_large: fail
deqp-gles31/functional/compute/basic/copy_image_to_ssbo_small: fail
deqp-gles31/functional/compute/basic/copy_ssbo_to_image_large: fail
deqp-gles31/functional/compute/basic/copy_ssbo_to_image_small: fail

I don't have image support (working).

deqp-gles31/functional/layout_binding/ssbo/fragment_binding_array: fail
deqp-gles31/functional/layout_binding/ssbo/fragment_binding_max: fail
deqp-gles31/functional/layout_binding/ssbo/fragment_binding_max_array: fail
deqp-gles31/functional/layout_binding/ssbo/fragment_binding_multiple: fail
deqp-gles31/functional/layout_binding/ssbo/fragment_binding_single: fail
deqp-gles31/functional/layout_binding/ssbo/vertex_binding_array: fail
deqp-gles31/functional/layout_binding/ssbo/vertex_binding_max: fail
deqp-gles31/functional/layout_binding/ssbo/vertex_binding_max_array: fail
deqp-gles31/functional/layout_binding/ssbo/vertex_binding_multiple: fail
deqp-gles31/functional/layout_binding/ssbo/vertex_binding_single: fail

All these fail with "InternalError (DRM platform cannot create EGL surfaces)"

deqp-gles31/functional/shaders/opaque_type_indexing/ssbo/const_literal_vertex: fail

This one gets a GL_INVALID_FRAMEBUFFER_OPERATION somewhere...

deqp-gles31/functional/synchronization/in_invocation/ssbo_alias_overwrite: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_alias_write: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_atomic_alias_overwrite: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_atomic_alias_write: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_atomic_overwrite: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_atomic_read_write: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_atomic_write_read: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_overwrite: crash
deqp-gles31/functional/synchronization/in_invocation/ssbo_read_write: fail
deqp-gles31/functional/synchronization/in_invocation/ssbo_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_multiple_interleaved_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_multiple_unrelated_write_read_non_ordered: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_multiple_unrelated_write_read_ordered: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_multiple_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_overwrite: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_read_write: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_atomic_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_multiple_interleaved_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_multiple_unrelated_write_read_non_ordered: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_multiple_unrelated_write_read_ordered: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_multiple_write_read: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_overwrite: dmesg-fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_read_write: fail
deqp-gles31/functional/synchronization/inter_call/with_memory_barrier/ssbo_write_read: fail
deqp-gles31/functional/synchronization/inter_call/without_memory_barrier/ssbo_atomic_dispatch_100_calls_32k_invocations: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_alias_overwrite: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_alias_write: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_atomic_alias_overwrite: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_atomic_alias_write: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_atomic_overwrite: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_atomic_read_write: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_atomic_write_read: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_overwrite: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_read_write: fail
deqp-gles31/functional/synchronization/inter_invocation/ssbo_write_read: fail

I'm blaming all of these on some sort of compute-related problem rather than
SSBO's proper. But it could be there's some sort of issue with my code as well.
The crash is me killing it by hand... that test always seems to hang on nvc0.

-- 
2.4.10



More information about the mesa-dev mailing list