From 32c410d2df2b9c9476834bf891cdcf8254bdfb4e Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 28 Jun 2016 07:52:46 +1000 Subject: [PATCH] glsl: simplify link_uniform_blocks() There is only ever one shader so simplify the input params. Reviewed-by: Iago Toral Quiroga --- src/compiler/glsl/link_uniform_blocks.cpp | 7 ++----- src/compiler/glsl/linker.cpp | 5 ++--- src/compiler/glsl/linker.h | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl/link_uniform_blocks.cpp b/src/compiler/glsl/link_uniform_blocks.cpp index 4b51d40c14b..1ccd0df9537 100644 --- a/src/compiler/glsl/link_uniform_blocks.cpp +++ b/src/compiler/glsl/link_uniform_blocks.cpp @@ -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. diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 926520eb1b8..9826368c561 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -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); diff --git a/src/compiler/glsl/linker.h b/src/compiler/glsl/linker.h index 19b14d50696..0126bcb67c8 100644 --- a/src/compiler/glsl/linker.h +++ b/src/compiler/glsl/linker.h @@ -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, -- 2.30.2