Revert "mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH."
authorEric Anholt <eric@anholt.net>
Wed, 25 Aug 2010 23:38:37 +0000 (16:38 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 25 Aug 2010 23:45:31 +0000 (16:45 -0700)
This reverts commit 001a7bfdfc8b3c8930d5ced21982dbdfb8cd35b3.  I
hadn't found the section of the spec clarifying that the old behavior
was right.  Reverting fixes the new version of the testcase, and the
Humus demos that could no longer find their uniforms.

Bug #29782
Bug #29783

src/mesa/main/shaderapi.c

index 1335f0f4111f0858d627e1a0d56e766962c0c01e..cc350c93b9780f8adeb8412ec790f4dcdd979a3c 100644 (file)
@@ -644,6 +644,8 @@ get_programiv(GLcontext *ctx, GLuint program, GLenum pname, GLint *params)
       break;
    case GL_ACTIVE_UNIFORM_MAX_LENGTH:
       *params = _mesa_longest_uniform_name(shProg->Uniforms);
+      if (*params > 0)
+         (*params)++;  /* add one for terminating zero */
       break;
    case GL_PROGRAM_BINARY_LENGTH_OES:
       *params = 0;