summaryrefslogtreecommitdiff
path: root/indra/llrender/llglslshader.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-03-22 16:19:10 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-03-22 16:19:10 -0400
commit0879c48d832a69050e6fc6ac67b0d5f95b52e054 (patch)
treec872ae80e13d12c3a282fd2af2c5005b0edb5e95 /indra/llrender/llglslshader.cpp
parentcbbe82b8dc08260aa4102214a7c99aeab7915371 (diff)
parent2afde26d93cc8773f5e84d187844f909347fc1bf (diff)
merge
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