summaryrefslogtreecommitdiff
path: root/indra/llrender/llglslshader.cpp
diff options
context:
space:
mode:
authorGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
committerGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
commit369cefd5b3f2f52ae0dd203fcd45a4618f74b0f3 (patch)
tree941d27a32099abaf71bae8a2865002e2b25a3512 /indra/llrender/llglslshader.cpp
parent0494a502aafac73800352dc26c4eb3a27b02a8ce (diff)
parent18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff)
pull from viewer-release
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
-rwxr-xr-xindra/llrender/llglslshader.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 0f260674ed..52b8de8365 100755
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -325,14 +325,20 @@ LLGLSLShader::~LLGLSLShader()
void LLGLSLShader::unload()
{
+ mShaderFiles.clear();
+ mDefines.clear();
+
+ unloadInternal();
+}
+
+void LLGLSLShader::unloadInternal()
+{
sInstances.erase(this);
stop_glerror();
mAttribute.clear();
mTexture.clear();
mUniform.clear();
- mShaderFiles.clear();
- mDefines.clear();
if (mProgramObject)
{
@@ -354,13 +360,13 @@ void LLGLSLShader::unload()
mProgramObject = 0;
}
-
+
if (mTimerQuery)
{
glDeleteQueriesARB(1, &mTimerQuery);
mTimerQuery = 0;
}
-
+
if (mSamplesQuery)
{
glDeleteQueriesARB(1, &mSamplesQuery);
@@ -369,7 +375,7 @@ void LLGLSLShader::unload()
//hack to make apple not complain
glGetError();
-
+
stop_glerror();
}
@@ -378,6 +384,8 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
U32 varying_count,
const char** varyings)
{
+ unloadInternal();
+
sInstances.insert(this);
//reloading, reset matrix hash values