[Piglit] [PATCH] glsl-uniform-out-of-bounds-2: work with or without [0] after array names

Ian Romanick idr at freedesktop.org
Tue Jan 29 11:50:32 PST 2013


On 01/28/2013 05:18 PM, Frank Henigman wrote:
> Ignore this.  Ian sent a better patch at the same time.

Should I count that as a Reviewed-by for my patch? :)

> On Mon, Jan 28, 2013 at 4:18 PM, Frank Henigman <fjhenigman at google.com
> <mailto:fjhenigman at google.com>> wrote:
>
>     Make glsl-uniform-out-of-bounds-2 work whether or not array names
>     that come out of glGetActiveUniform() have a "[0]" at the end.
>
>     https://bugs.freedesktop.org/show_bug.cgi?id=59688
>
>     Signed-off-by: Frank Henigman <fjhenigman at google.com
>     <mailto:fjhenigman at google.com>>
>     ---
>       tests/shaders/glsl-uniform-out-of-bounds-2.c | 9 +++++----
>       1 file changed, 5 insertions(+), 4 deletions(-)
>
>     diff --git a/tests/shaders/glsl-uniform-out-of-bounds-2.c
>     b/tests/shaders/glsl-uniform-out-of-bounds-2.c
>     index db46a1e..2ad992b 100644
>     --- a/tests/shaders/glsl-uniform-out-of-bounds-2.c
>     +++ b/tests/shaders/glsl-uniform-out-of-bounds-2.c
>     @@ -83,17 +83,18 @@ piglit_init(int argc, char **argv)
>                      glGetActiveUniform(prog, k, ARRAY_SIZE(name), NULL,
>                                         &num_active_elements,
>                                         &type, name);
>     -               if (!((name[0] == 'v' || name[0] == 'm') && name[1]
>     == 0))
>     +               if (!((name[0] == 'v' || name[0] == 'm')
>     +                               && (name[1] == 0 || name[1] == '[')))
>                              continue;
>     -               printf("array '%s' active elements %d\n",
>     -                      name, num_active_elements);
>     +               printf("array '%c' active elements %d\n",
>     +                      name[0], num_active_elements);
>
>                      /* for each index in array, plus some before and
>     after */
>                      for (i = -2; i < 6; ++i) {
>                              bool is_active = 0 <= i && i <
>     num_active_elements;
>                              GLchar element[9];
>                              GLint loc;
>     -                       sprintf(element, "%s[%d]", name, i);
>     +                       sprintf(element, "%c[%d]", name[0], i);
>                              loc = glGetUniformLocation(prog, element);
>
>                              /* does glGetUniformLocation agree with
>     --
>     1.8.1
>
>
>
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>



More information about the Piglit mailing list