diff options
author | Oz Linden <oz@lindenlab.com> | 2015-08-18 15:05:01 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-08-18 15:05:01 -0400 |
commit | 2efe91ef64a963ef488d6018d04196753fe815ca (patch) | |
tree | 09b198468fcc4b7a9405e68f355413aafde1d1b9 /indra/llrender/llrender.cpp | |
parent | dff79705eddd4ce92fbb3d8a3b3b47a734b4837b (diff) | |
parent | 1be63209331d509396bd7ee79302d511fe83d72e (diff) |
merge changes for 3.8.3-release
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rwxr-xr-x | indra/llrender/llrender.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 1ca6e99ecf..69420dd0bb 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -104,10 +104,10 @@ LLTexUnit::LLTexUnit(S32 index) mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR), mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA), mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), - mHasMipMaps(false) + mHasMipMaps(false), + mIndex(index) { llassert_always(index < (S32)LL_NUM_TEXTURE_LAYERS); - mIndex = index; } //static @@ -227,33 +227,34 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) stop_glerror(); if (mIndex >= 0) { - gGL.flush(); + gGL.flush(); + + LLImageGL* gl_tex = NULL ; - LLImageGL* gl_tex = NULL ; if (texture != NULL && (gl_tex = texture->getGLTexture())) - { - if (gl_tex->getTexName()) //if texture exists - { - //in audit, replace the selected texture by the default one. - if ((mCurrTexture != gl_tex->getTexName()) || forceBind) - { - activate(); - enable(gl_tex->getTarget()); - mCurrTexture = gl_tex->getTexName(); - glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture); - if(gl_tex->updateBindStats(gl_tex->mTextureMemory)) - { - texture->setActive() ; - texture->updateBindStatsForTester() ; - } - mHasMipMaps = gl_tex->mHasMipMaps; - if (gl_tex->mTexOptionsDirty) { - gl_tex->mTexOptionsDirty = false; - setTextureAddressMode(gl_tex->mAddressMode); - setTextureFilteringOption(gl_tex->mFilterOption); - } - } + if (gl_tex->getTexName()) //if texture exists + { + //in audit, replace the selected texture by the default one. + if ((mCurrTexture != gl_tex->getTexName()) || forceBind) + { + activate(); + enable(gl_tex->getTarget()); + mCurrTexture = gl_tex->getTexName(); + glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture); + if(gl_tex->updateBindStats(gl_tex->mTextureMemory)) + { + texture->setActive() ; + texture->updateBindStatsForTester() ; + } + mHasMipMaps = gl_tex->mHasMipMaps; + if (gl_tex->mTexOptionsDirty) + { + gl_tex->mTexOptionsDirty = false; + setTextureAddressMode(gl_tex->mAddressMode); + setTextureFilteringOption(gl_tex->mFilterOption); + } + } } else { |