Explicitly track the current program binary instead of just caching it.
Trac #21270
Bug=351
Signed-off-by: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1237 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 1aed436..93a48d7 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -141,6 +141,7 @@
bindRenderbuffer(0);
mState.currentProgram = 0;
+ mCurrentProgramBinary = NULL;
mState.packAlignment = 4;
mState.unpackAlignment = 4;
@@ -185,6 +186,7 @@
}
mState.currentProgram = 0;
}
+ mCurrentProgramBinary = NULL;
while (!mFramebufferMap.empty())
{
@@ -407,7 +409,6 @@
mDitherStateDirty = true;
mFrontFaceDirty = true;
mDxUniformsDirty = true;
- mCachedCurrentProgramBinary = NULL;
}
void Context::markDxUniformsDirty()
@@ -1146,12 +1147,13 @@
{
Program *newProgram = mResourceManager->getProgram(program);
Program *oldProgram = mResourceManager->getProgram(priorProgram);
- mCachedCurrentProgramBinary = NULL;
+ mCurrentProgramBinary = NULL;
mDxUniformsDirty = true;
if (newProgram)
{
newProgram->addRef();
+ mCurrentProgramBinary = newProgram->getProgramBinary();
}
if (oldProgram)
@@ -1325,12 +1327,7 @@
ProgramBinary *Context::getCurrentProgramBinary()
{
- if (!mCachedCurrentProgramBinary)
- {
- Program *program = mResourceManager->getProgram(mState.currentProgram);
- mCachedCurrentProgramBinary = program->getProgramBinary();
- }
- return mCachedCurrentProgramBinary;
+ return mCurrentProgramBinary;
}
Texture2D *Context::getTexture2D()