diff options
| author | Dave Houlton <euclid@lindenlab.com> | 2021-02-02 06:16:53 +0000 |
|---|---|---|
| committer | Dave Houlton <euclid@lindenlab.com> | 2021-02-02 06:16:53 +0000 |
| commit | 7af677ab442b4bb28f009f3715b8913aecd565fa (patch) | |
| tree | 108e7d0dcb12f6f827d78a0a30b28e33a8cb95f0 /indra/newview/llviewertexture.cpp | |
| parent | baa81473149b9d5a6718529c4de08393e8a02b92 (diff) | |
| parent | 033d16747c7aab02e67001c210ecdb1cf953e327 (diff) | |
Merged in DV525-merge-6.4.13 (pull request #459)
DRTVWR-525, merge up to 6.4.13
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
| -rw-r--r-- | indra/newview/llviewertexture.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e811638358..ca01bb46aa 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1544,6 +1544,26 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) return FALSE; } + if (mGLTexturep->getHasExplicitFormat()) + { + LLGLenum format = mGLTexturep->getPrimaryFormat(); + S8 components = mRawImage->getComponents(); + if ((format == GL_RGBA && components < 4) + || (format == GL_RGB && components < 3)) + { + LL_WARNS() << "Can't create a texture " << mID << ": invalid image format " << std::hex << format << " vs components " << (U32)components << LL_ENDL; + // Was expecting specific format but raw texture has insufficient components for + // such format, using such texture will result in crash or will display wrongly + // if we change format. Texture might be corrupted server side, so just set as + // missing and clear cashed texture (do not cause reload loop, will retry&recover + // during new session) + setIsMissingAsset(); + destroyRawImage(); + LLAppViewer::getTextureCache()->removeFromCache(mID); + return FALSE; + } + } + res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); notifyAboutCreatingTexture(); |
