Khronos Public Bugzilla
Bug 717 - glGetActiveUniformName length parameter uses the wrong type
glGetActiveUniformName length parameter uses the wrong type
Product: OpenGL
Classification: Unclassified
Component: Registry
All All
: P3 normal
: ---
Assigned To: Jon Leech
Depends on:
  Show dependency treegraph
Reported: 2012-09-23 12:22 PDT by Alfonse
Modified: 2013-10-28 16:36 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Alfonse 2012-09-23 12:22:22 PDT
The length parameter of glGetActiveUniformName is stated to be an "array". What it really should be is a "reference", such as with glGetProgramResourceName.

This has a material impact, because various automated binding generators (such as for JOGL and LWJGL) will produce incorrect bindings here. Here is the LWJGL documentation for glGetActiveUniformName:,%20int,%20java.nio.IntBuffer,%20java.nio.ByteBuffer%29

Note that the length uses an IntBuffer, which is an *array*. That's wrong, and it makes it difficult to use the API function. JOGL has similar problems.
Comment 1 Jon Leech 2013-07-11 01:41:54 PDT
In the XML files, we currently don't have 'array' vs 'reference' notation
captured, and we also don't have any array length annotation on
the <length> parameter of glGetProgramResourceName, because none was
present in the .spec file. Perhaps the binding generators should try
to interpret a non-const array parameter as a reference from the Java
perspective? Open to discussing how to enhance this but the 'reference'
notation appears in just a handful of places in the .spec files and
TBH I never tried to maintain that as things were added. The old Perl
generator scripts acting on .spec just said "array or reference, they
both translated into a pointer".
Comment 2 Jon Leech 2013-10-28 16:36:34 PDT
Closing this for lack of ideas on what to do about it. If a <param>
in the XML file is a pointer type and does not have a declared
len= attribute, then it should probably be assumed that it is
a reference to a single value, but I'm not convinced that every
<param> that deserves len= attributes actually has them at present,
so that's probably not an error-free approach to this either. I also
have no idea if JOGL/LWJGL generators have moved to using the XML
or not.