diff options
author | Mark Palange <palange@lindenlab.com> | 2008-12-23 19:39:58 +0000 |
---|---|---|
committer | Mark Palange <palange@lindenlab.com> | 2008-12-23 19:39:58 +0000 |
commit | fb793870fe95f1951d7c30ea6068e187b9dededd (patch) | |
tree | 6d11632353ff4fb07133625ec5031b135b1e2882 /indra/llrender/llrender.cpp | |
parent | d182b9fb82b9c63f41d81bc80dbbfe627475facf (diff) |
QAR-1142 merging 1.22 RC0-RC4 changes.
svn merge -c 106471 svn+ssh://svn.lindenlab.com/svn/linden/qa/viewer_1-22-106055_merge
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 969bfe608e..76762a1967 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -175,7 +175,7 @@ void LLTexUnit::disable(void) } } -bool LLTexUnit::bind(const LLImageGL* texture) +bool LLTexUnit::bind(const LLImageGL* texture, bool forceBind) { if (mIndex < 0) return false; @@ -183,25 +183,27 @@ bool LLTexUnit::bind(const LLImageGL* texture) if (texture == NULL) { - return texture->bindError(mIndex); + llwarns << "NULL LLTexUnit::bind texture" << llendl; + return false; } - if (!texture->isInitialized()) + if (!texture->isInitialized() && !forceBind) { return texture->bindDefaultImage(mIndex); } - // Disabled caching of binding state. - if (texture != NULL) + if (!texture->getTexName()) //if texture does not exist { - activate(); - enable(texture->getTarget()); - mCurrTexture = texture->getTexName(); - glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); - texture->updateBindStats(); - return true; + return texture->bindDefaultImage(mIndex); } - return false; + + // Disabled caching of binding state. + activate(); + enable(texture->getTarget()); + mCurrTexture = texture->getTexName(); + glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); + texture->updateBindStats(); + return true; } bool LLTexUnit::bind(LLCubeMap* cubeMap) |