Khronos public bugtracker – Bug 717
glGetActiveUniformName length parameter uses the wrong type
Last modified: 2013-10-28 16:36:34 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: http://www.lwjgl.org/javadoc/org/lwjgl/opengl/GL31.html#glGetActiveUniformName%28int,%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.
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".
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