diff options
author | Graham Linden <graham@lindenlab.com> | 2019-07-22 15:44:35 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-07-22 15:44:35 -0700 |
commit | b3466243073c2693be4c32b3586a191c30095d01 (patch) | |
tree | 6f990c486b83c203ab67277a4a673cc3971ff84f /indra/llrender/llglslshader.cpp | |
parent | aa4b24beee1d6451370983517d7ac3755429e26f (diff) |
SL-10761
Make vograss objects set their face vert/index counts to 0 when setting
the number of blades to 0 to disable rendering so we don't allocate space
and then skip setting it up with actual index data in getGeometry.
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 902c08b6ba..782304ae41 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -344,13 +344,17 @@ void LLGLSLShader::unloadInternal() { GLhandleARB obj[1024]; GLsizei count; + glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj); - glGetAttachedObjectsARB(mProgramObject, sizeof(obj)/sizeof(obj[0]), &count, obj); for (GLsizei i = 0; i < count; i++) { - glDetachObjectARB(mProgramObject, obj[i]); + // avoid opengl errors when multiple programs link a common shader obj + if (glIsShader(obj[i])) + { + glDetachObjectARB(mProgramObject, obj[i]); glDeleteObjectARB(obj[i]); } + } glDeleteObjectARB(mProgramObject); |