mesa/main: validate name syntax for array variables only
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 13 May 2015 10:18:31 +0000 (12:18 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 20 May 2015 05:24:53 +0000 (07:24 +0200)
From ARB_program_interface_query:

 "Note that if an interface enumerates a single active resource list
 entry for an array variable (e.g., "a[0]"), a <name> identifying
 any array element other than the first (e.g., "a[1]") is not
 considered to match."

It doesn't apply to arrays of interface blocks but just to array
variables.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/program_resource.c

index b15a13210c01f27d38ea34b4e77a2e5a71401be2..d857b84e60de89540c76a83678f7f9e5b6697840 100644 (file)
@@ -220,12 +220,12 @@ _mesa_GetProgramResourceIndex(GLuint program, GLenum programInterface,
    case GL_PROGRAM_INPUT:
    case GL_PROGRAM_OUTPUT:
    case GL_UNIFORM:
-   case GL_UNIFORM_BLOCK:
    case GL_TRANSFORM_FEEDBACK_VARYING:
-      /* Validate name syntax for arrays. */
+      /* Validate name syntax for array variables */
       if (!valid_program_resource_index_name(name))
          return GL_INVALID_INDEX;
-
+      /* fall-through */
+   case GL_UNIFORM_BLOCK:
       res = _mesa_program_resource_find_name(shProg, programInterface, name);
       if (!res)
          return GL_INVALID_INDEX;