[Mesa-dev] [PATCH 0/4] Implement separate index spaces for UBOs and SSBOs

Iago Toral Quiroga itoral at igalia.com
Fri Oct 9 06:23:33 PDT 2015


See the rationale for this in [1], no piglit regressions observed in my
IvyBridge laptop.

Patch 1: Renames {Num}UniformBlocks to {Num}BufferInterfaceBlocks. This is
more consistent with the current implementation, since right now
UniformBlocks contains both UBOs and SSBOs.

Patch 2: Adds separate UniformBlocks and ShaderStorageBlocks arrays.

Patch 3: Changes lower_ubo_reference pass to use UniformBlocks and
         ShaderStorageBlocks instead of BufferInterfaceBlocks so we get
         block indices in separate index spaces.

Patch 4: Changes i965 to work with separate index spaces.

I think there are other places that use BufferInterfaceBlocks after
linking that can be rewritten to use UniformBlocks or ShaderStorageBlocks
more efficiently. I'd like to tackle that too, but I think it makes sense
to land this first I think.

[1] http://lists.freedesktop.org/archives/mesa-dev/2015-October/095951.html

Iago Toral Quiroga (4):
  mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocks
  mesa: Add {Num}UniformBlocks and {Num}ShaderStorageBlocks to
    gl_shader{_program}
  glsl/lower_ubo_reference: lower UBOs and SSBOs to separate index
    spaces
  i965: Adapt SSBOs to work with their own separate index space

 src/glsl/link_uniform_initializers.cpp           |   4 +-
 src/glsl/link_uniforms.cpp                       |  22 ++---
 src/glsl/linker.cpp                              | 105 ++++++++++++++++++-----
 src/glsl/lower_ubo_reference.cpp                 |  22 +++--
 src/glsl/nir/glsl_to_nir.cpp                     |   2 +-
 src/glsl/standalone_scaffolding.cpp              |  11 ++-
 src/mesa/drivers/dri/i965/brw_context.h          |   4 +-
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp         |  24 +++---
 src/mesa/drivers/dri/i965/brw_shader.cpp         |   7 +-
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp       |  24 +++---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |  79 +++++++++--------
 src/mesa/main/mtypes.h                           |  53 +++++++++++-
 src/mesa/main/shader_query.cpp                   |   4 +-
 src/mesa/main/shaderapi.c                        |   4 +-
 src/mesa/main/shaderobj.c                        |   4 +-
 src/mesa/main/uniforms.c                         |  12 +--
 src/mesa/state_tracker/st_atom_constbuf.c        |   4 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp       |   4 +-
 18 files changed, 257 insertions(+), 132 deletions(-)

-- 
1.9.1



More information about the mesa-dev mailing list