mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 22 Nov 2011 04:47:57 +0000 (20:47 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 29 Nov 2011 19:14:28 +0000 (11:14 -0800)
commite6c314f7d2ed99714376fec6b7509a55535fa3ff
tree2c10d5f12ad2c416de6725f05b279346341d6146
parent03bbcd447cbaa28b52465ae1045013f1aff420c2
mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES

Page 77 (page 91 of the PDF) says about glGetActiveAttrib:

    "The returned attribute name can be the name of a generic
    attribute or a conventional attribute (which begin with the prefix
    "gl_", see the OpenGL Shading Language specification for a
    complete list)."

Page 261 (page 275 of the PDF) says about glGetProgramiv:

    "If pname is ACTIVE_ATTRIBUTES, the number of active attributes in
    program is returned."

It doesn't say anything about built-in vs. user-defined attributes.
From the language around glGetActiveAttrib and the lack of an
exclusion of built-in attributes, which exists other places (e.g.,
around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES
should include the active attribute count.  It should also be included
in the values returned by glGetActiveAttrib.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Yi Sun <yi.sun@intel.com>
src/mesa/main/shader_query.cpp