diff options
author | Paul Berry <stereotype441@gmail.com> | 2013-07-27 15:07:08 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2013-07-27 15:13:22 -0700 |
commit | 15b6e381abdfe599014dfe3d04a87b4259762e8b (patch) | |
tree | 1132ac244e2cdfe5c4c1a079784d2951af2c9e35 | |
parent | 4d7899fe81b6ffc521c6f9688e25bcde4012e556 (diff) |
glsl: Remove bogus check on return value of link_uniform_blocks().
A comment in link_intrastage_shaders(), and an if-test that followed
it, seemed to indicate that link_uniform_blocks() would return a
negative value in the event of an error. But this is not the
case--all error checking has already been performed by
validate_intrastage_interface_blocks(), and link_uniform_blocks() can
only return unsigned values.
So get rid of the if-test and change the return type of
link_intrastage_shaders() to clarify that it can only return unsigned
values.
-rw-r--r-- | src/glsl/link_uniform_blocks.cpp | 2 | ||||
-rw-r--r-- | src/glsl/linker.cpp | 6 | ||||
-rw-r--r-- | src/glsl/linker.h | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/glsl/link_uniform_blocks.cpp b/src/glsl/link_uniform_blocks.cpp index c72d1d8f1d..1083653c7d 100644 --- a/src/glsl/link_uniform_blocks.cpp +++ b/src/glsl/link_uniform_blocks.cpp @@ -137,7 +137,7 @@ struct block { bool has_instance_name; }; -int +unsigned link_uniform_blocks(void *mem_ctx, struct gl_shader_program *prog, struct gl_shader **shader_list, diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index ac010cfbb6..4ffd40e652 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -964,12 +964,10 @@ link_intrastage_shaders(void *mem_ctx, num_shaders)) return NULL; - /* Check that uniform blocks between shaders for a stage agree. */ - const int num_uniform_blocks = + /* Link up uniform blocks defined within this stage. */ + const unsigned num_uniform_blocks = link_uniform_blocks(mem_ctx, prog, shader_list, num_shaders, &uniform_blocks); - if (num_uniform_blocks < 0) - return NULL; /* Check that there is only a single definition of each function signature * across all shaders. diff --git a/src/glsl/linker.h b/src/glsl/linker.h index 2fe2410c22..85a6817d98 100644 --- a/src/glsl/linker.h +++ b/src/glsl/linker.h @@ -53,7 +53,7 @@ extern bool link_uniform_blocks_are_compatible(const gl_uniform_block *a, const gl_uniform_block *b); -extern int +extern unsigned link_uniform_blocks(void *mem_ctx, struct gl_shader_program *prog, struct gl_shader **shader_list, |