glsl: simplify link_uniform_blocks()
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 27 Jun 2016 21:52:46 +0000 (07:52 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 30 Jun 2016 06:51:25 +0000 (16:51 +1000)
There is only ever one shader so simplify the input params.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/glsl/link_uniform_blocks.cpp
src/compiler/glsl/linker.cpp
src/compiler/glsl/linker.h

index 4b51d40c14b3b195a20398d89f9269ce6c06e36d..1ccd0df95370e5bfd7e10e4e92ac21e29836e660 100644 (file)
@@ -391,8 +391,7 @@ void
 link_uniform_blocks(void *mem_ctx,
                     struct gl_context *ctx,
                     struct gl_shader_program *prog,
-                    struct gl_linked_shader **shader_list,
-                    unsigned num_shaders,
+                    struct gl_linked_shader *shader,
                     struct gl_uniform_block **ubo_blocks,
                     unsigned *num_ubo_blocks,
                     struct gl_uniform_block **ssbo_blocks,
@@ -415,9 +414,7 @@ link_uniform_blocks(void *mem_ctx,
    /* Determine which uniform blocks are active.
     */
    link_uniform_block_active_visitor v(mem_ctx, block_hash, prog);
-   for (unsigned i = 0; i < num_shaders; i++) {
-      visit_list_elements(&v, shader_list[i]->ir);
-   }
+   visit_list_elements(&v, shader->ir);
 
    /* Count the number of active uniform blocks.  Count the total number of
     * active slots in those uniform blocks.
index 926520eb1b8e08270f15003eee2c8cf9f833d28a..9826368c561546fa044adac6c01d335cb3dbdd8e 100644 (file)
@@ -2312,9 +2312,8 @@ link_intrastage_shaders(void *mem_ctx,
    v.fixup_unnamed_interface_types();
 
    /* Link up uniform blocks defined within this stage. */
-   link_uniform_blocks(mem_ctx, ctx, prog, &linked, 1,
-                       &ubo_blocks, &num_ubo_blocks, &ssbo_blocks,
-                       &num_ssbo_blocks);
+   link_uniform_blocks(mem_ctx, ctx, prog, linked, &ubo_blocks,
+                       &num_ubo_blocks, &ssbo_blocks, &num_ssbo_blocks);
 
    if (!prog->LinkStatus) {
       _mesa_delete_linked_shader(ctx, linked);
index 19b14d50696756dbd00ef7421f0bfe05acce46aa..0126bcb67c8f5b7ebc0e1954108502e59db5550c 100644 (file)
@@ -57,8 +57,7 @@ extern void
 link_uniform_blocks(void *mem_ctx,
                     struct gl_context *ctx,
                     struct gl_shader_program *prog,
-                    struct gl_linked_shader **shader_list,
-                    unsigned num_shaders,
+                    struct gl_linked_shader *shader,
                     struct gl_uniform_block **ubo_blocks,
                     unsigned *num_ubo_blocks,
                     struct gl_uniform_block **ssbo_blocks,