[Mesa-dev] [PATCH 2/6] glsl: remove unused buffer block splitting function

Timothy Arceri timothy.arceri at collabora.com
Sun Apr 3 11:16:29 UTC 2016


---
 src/compiler/glsl/linker.cpp | 70 --------------------------------------------
 1 file changed, 70 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 75a2afa..2f152d6 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4122,49 +4122,6 @@ link_assign_subroutine_types(struct gl_shader_program *prog)
 }
 
 static void
-split_ubos_and_ssbos(void *mem_ctx,
-                     struct gl_uniform_block **s_blks,
-                     struct gl_uniform_block *p_blks,
-                     unsigned num_blocks,
-                     struct gl_uniform_block ***ubos,
-                     unsigned *num_ubos,
-                     struct gl_uniform_block ***ssbos,
-                     unsigned *num_ssbos)
-{
-   unsigned num_ubo_blocks = 0;
-   unsigned num_ssbo_blocks = 0;
-
-   /* Are we spliting the list of blocks for the shader or the program */
-   bool is_shader = p_blks == NULL;
-
-   for (unsigned i = 0; i < num_blocks; i++) {
-      if (is_shader ? s_blks[i]->IsShaderStorage : p_blks[i].IsShaderStorage)
-         num_ssbo_blocks++;
-      else
-         num_ubo_blocks++;
-   }
-
-   *ubos = ralloc_array(mem_ctx, gl_uniform_block *, num_ubo_blocks);
-   *num_ubos = 0;
-
-   *ssbos = ralloc_array(mem_ctx, gl_uniform_block *, num_ssbo_blocks);
-   *num_ssbos = 0;
-
-   for (unsigned i = 0; i < num_blocks; i++) {
-      struct gl_uniform_block *blk = is_shader ? s_blks[i] : &p_blks[i];
-      if (blk->IsShaderStorage) {
-         (*ssbos)[*num_ssbos] = blk;
-         (*num_ssbos)++;
-      } else {
-         (*ubos)[*num_ubos] = blk;
-         (*num_ubos)++;
-      }
-   }
-
-   assert(*num_ubos + *num_ssbos == num_blocks);
-}
-
-static void
 set_always_active_io(exec_list *ir, ir_variable_mode io_mode)
 {
    assert(io_mode == ir_var_shader_in || io_mode == ir_var_shader_out);
@@ -4701,33 +4658,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
                              has_xfb_qualifiers))
       goto done;
 
-   /* Split BufferInterfaceBlocks into UniformBlocks and ShaderStorageBlocks
-    * for gl_shader_program and gl_shader, so that drivers that need separate
-    * index spaces for each set can have that.
-    */
-   for (unsigned i = MESA_SHADER_VERTEX; i < MESA_SHADER_STAGES; i++) {
-      if (prog->_LinkedShaders[i] != NULL) {
-         gl_shader *sh = prog->_LinkedShaders[i];
-         split_ubos_and_ssbos(sh,
-                              sh->BufferInterfaceBlocks,
-                              NULL,
-                              sh->NumBufferInterfaceBlocks,
-                              &sh->UniformBlocks,
-                              &sh->NumUniformBlocks,
-                              &sh->ShaderStorageBlocks,
-                              &sh->NumShaderStorageBlocks);
-      }
-   }
-
-   split_ubos_and_ssbos(prog,
-                        NULL,
-                        prog->BufferInterfaceBlocks,
-                        prog->NumBufferInterfaceBlocks,
-                        &prog->UniformBlocks,
-                        &prog->NumUniformBlocks,
-                        &prog->ShaderStorageBlocks,
-                        &prog->NumShaderStorageBlocks);
-
    update_array_sizes(prog);
    link_assign_uniform_locations(prog, ctx->Const.UniformBooleanTrue,
                                  num_explicit_uniform_locs,
-- 
2.5.5



More information about the mesa-dev mailing list