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

Iago Toral itoral at igalia.com
Fri Oct 9 06:35:27 PDT 2015


On Fri, 2015-10-09 at 15:23 +0200, Iago Toral Quiroga wrote:
> 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.

For the sake of being complete, other things to do after landing this:

- Fix NIR to use the right counts for UBOs and SSBOs, which is trivial
with this series. Right now we are taking the counts from the combined
list of blocks, which is wrong.

- Now that we use separate index spaces in i965, we might want to define
BRW_NEW_SHADER_STORAGE_BUFFER as well (right now we always upload
UBO/SSBO surfaces together)

Iago

> [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(-)
> 




More information about the mesa-dev mailing list