Commit 53d73e04 by zmo@google.com

glGetProgramiv(GL_ACTIVE_UNIFORM_MAX_LENGTH) should count an extra 3 if uniform…

glGetProgramiv(GL_ACTIVE_UNIFORM_MAX_LENGTH) should count an extra 3 if uniform is an array because "[0]" is appended. BUG=135 TEST=the attached htm in the bug runs ok Review URL: http://codereview.appspot.com/4287077 git-svn-id: https://angleproject.googlecode.com/svn/trunk@592 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8ea5afef
......@@ -2742,7 +2742,12 @@ GLint Program::getActiveUniformMaxLength()
{
if (!mUniforms[uniformIndex]->name.empty() && mUniforms[uniformIndex]->name.substr(0, 3) != "dx_")
{
maxLength = std::max((int)(undecorate(mUniforms[uniformIndex]->name).length() + 1), maxLength);
int length = (int)(undecorate(mUniforms[uniformIndex]->name).length() + 1);
if (mUniforms[uniform]->arraySize != 1)
{
length += 3; // Counting in "[0]".
}
maxLength = std::max(length, maxLength);
}
}
......
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