Quoting the Khronos OpenGL documentation pages for the glGetProgramResourceiv() function:

For the property GL_TYPE, a single integer identifying the type of an active variable is written to params. The integer returned is one of the values found in table 2.16.

But, there is no "table 2.16" in that page, there is no "table 2.16" in the specification document (where the language also appears), and several search engines failed to return any other references to such a table.

So, where is it? What are the full list of type codes that can be returned by this introspection function (which can presumably represent all GLSL types)?

(I'm using GL core 4.3)

  • $\begingroup$ "there is no "table 2.16" in the specification document (where the language also appears)" What "specification document" are you looking at? Because that language does not appear in the GL 4.3 specification; it cites a different table. $\endgroup$ Oct 19 '19 at 4:54
  • $\begingroup$ khronos.org/registry/OpenGL/specs/gl/glspec43.core.pdf 4.2 Core also doesn't seem to have it (though Nicol evidently saw some version of it that does...) $\endgroup$
    – BadZen
    Oct 20 '19 at 4:56
  • 1
    $\begingroup$ As with most documentation, the OpenGL reference pages are not always correct. If you find a mistake, you can open an issue in the corresponding GitHub repository. It is better if the issue gets fixed at the source, so I think you should do that. $\endgroup$
    – wychmaster
    Nov 15 '21 at 8:11

For whatever reason, the text for that function documentation was copied from the GL_ARB_program_interface_query extension. Extensions in OpenGL are always defined relative to a specific version of the OpenGL specification. So if an extension references something in a specification, it's talking about that version of the spec.

However, the OpenGL specification was massively restructured between 4.2 and 4.3, with whole chapters moved around. This means that table references in 4.2 become completely wrong relative to 4.3 and above.

Program interface query was written against the 4.2 specification. Oddly enough, there is no table 2.16 in that spec; the correct number for that table is 2.13 (so it's likely a typo, since 3 is right below 6 on a number-pad). But even if the extension did mention the right table number, that table moved to a whole different chapter in 4.3+ versions. It's been renumbered and moved since then, so you'll have to look at a particular specification's definition of glGetProgramResourceiv to find it.

In general, if you find something incongruous in the documentation pages, you should look at the actual OpenGL specification to see what it says about the function's behavior.

  • 1
    $\begingroup$ Perfect, the wiki has got it. Looks like it also appears on the "resource" page for glGetActiveUniform. But the 4.2 core specification only has 2.1 through 2.15, oddly. Maybe we're looking at different versions of the document? Weird. $\endgroup$
    – BadZen
    Oct 20 '19 at 4:54
  • $\begingroup$ Can you update the link? It does not point to the wiki anymore $\endgroup$ Nov 13 '21 at 2:25
  • $\begingroup$ @GuillaumeRacicot: The wiki automatically redirects to the man page. $\endgroup$ Nov 13 '21 at 4:34
  • $\begingroup$ @NicolBolas the problem is that the man page don't show the table 2.16, which this question is all about. Also the answer don't contain the table, so the answer has become useless because of the redirect. $\endgroup$ Nov 14 '21 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.