b=951799, cache uniforms in OGLShaderProgram, part 2 - fix LayerProgramProjectionMatrix; r=bjacob

This commit is contained in:
Vladimir Vukicevic
2014-01-29 17:53:38 -05:00
parent 8f3453c4a2
commit 3450acc2de
4 changed files with 13 additions and 10 deletions

View File

@@ -53,7 +53,6 @@ AddUniforms(ProgramProfileOGL& aProfile)
void
AddCommonArgs(ProgramProfileOGL& aProfile)
{
aProfile.mHasMatrixProj = true;
aProfile.mAttributes.AppendElement(Argument("aVertexCoord"));
}
void
@@ -323,6 +322,8 @@ ShaderProgramOGL::Initialize()
NS_ASSERTION(mProfile.mAttributes[i].mLocation >= 0, "Bad attribute location.");
}
mProfile.mHasMatrixProj = mProfile.mUniforms[KnownUniform::MatrixProj].mLocation != -1;
return true;
}
@@ -439,7 +440,7 @@ ShaderProgramOGL::Activate()
NS_ASSERTION(HasInitialized(), "Attempting to activate a program that's not in use!");
mGL->fUseProgram(mProgram);
// check and set the projection matrix
// check if we need to set the projection matrix
if (mIsProjectionMatrixStale) {
SetProjectionMatrix(mProjectionMatrix);
}