OSDN Git Service

glsl/linker: skip inactive explicit locations.
authorDave Airlie <airlied@redhat.com>
Wed, 18 May 2016 07:06:41 +0000 (17:06 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 23 May 2016 06:19:57 +0000 (16:19 +1000)
This fixes a crash in:
GL45-CTS.explicit_uniform_location.subroutine-loc-negative-link-max-num-of-locations

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/compiler/glsl/linker.cpp

index 4c567fc..2374c01 100644 (file)
@@ -3088,6 +3088,9 @@ link_calculate_subroutine_compat(struct gl_shader_program *prog)
          continue;
 
       for (unsigned j = 0; j < sh->NumSubroutineUniformRemapTable; j++) {
+         if (sh->SubroutineUniformRemapTable[j] == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
+            continue;
+
          struct gl_uniform_storage *uni = sh->SubroutineUniformRemapTable[j];
 
          if (!uni)