On 03/18/2016 04:41 PM, Plamena Manolova wrote:
We should check whether check_explicit_uniform_locations has
failed before we pass the number of explicit uniform locations
to link_assign_uniform_locations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94549#c3
---
  src/compiler/glsl/linker.cpp | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 76b700d..a2091f4 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4324,6 +4324,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
        goto done;

     unsigned first, last, prev;
+   int result;

     first = MESA_SHADER_STAGES;
     last = 0;
@@ -4337,7 +4338,11 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
        last = i;
     }

-   num_explicit_uniform_locs = check_explicit_uniform_locations(ctx, prog);
+   result = check_explicit_uniform_locations(ctx, prog);
+

Some nitpicks:

I would remove the space between assigning result, and the 'if' below.

+   if (result > 0)
+       num_explicit_uniform_locs = result;
+
     link_assign_subroutine_types(prog);

     if (!prog->LinkStatus)


What about renaming 'result' to something like 'tmp_num_locs' or 'local_num_locs'. Naming it 'result' is a bit deceiving, since it is not a result but rather an intermediate value.

thanks!

Reviewed-by: Eduardo Lima Mitev <el...@igalia.com>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to