Fix querying active attributes.

TRAC #14849 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@509 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 41b2fbdd
......@@ -2582,16 +2582,22 @@ void Program::getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shade
void Program::getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
{
unsigned int attribute = 0;
for (unsigned int i = 0; i < index; i++)
// Skip over inactive attributes
unsigned int activeAttribute = 0;
unsigned int attribute;
for (attribute = 0; attribute < MAX_VERTEX_ATTRIBS; attribute++)
{
do
if (mLinkedAttribute[attribute].name.empty())
{
attribute++;
continue;
}
ASSERT(attribute < MAX_VERTEX_ATTRIBS); // index must be smaller than getActiveAttributeCount()
if (activeAttribute == index)
{
break;
}
while (mLinkedAttribute[attribute].name.empty());
activeAttribute++;
}
if (bufsize > 0)
......@@ -2649,9 +2655,9 @@ void Program::getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, G
unsigned int uniform;
for (uniform = 0; uniform < mUniforms.size(); uniform++)
{
while (mUniforms[uniform]->name.substr(0, 3) == "dx_")
if (mUniforms[uniform]->name.substr(0, 3) == "dx_")
{
uniform++;
continue;
}
if (activeUniform == index)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment