diff options
author | Dave Parks <davep@lindenlab.com> | 2024-12-05 11:52:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 13:52:03 -0600 |
commit | 1120a7ccb91223df91aa92b1354dfe2c3b65a577 (patch) | |
tree | cffbc33c37f7f1ac7387ecd310de5d67dc787b62 /indra/newview/lltexturefetch.cpp | |
parent | 396b97aebfb3294287a4a598f0be3900ccada69a (diff) |
#3210 Fix for "Texture will be downscaled" happening too often. (#3212)
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 703030b978..bac0c736b1 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1761,7 +1761,10 @@ bool LLTextureFetchWorker::doWork(S32 param) mRawImage = NULL; mAuxImage = NULL; llassert_always(mFormattedImage.notNull()); - S32 discard = mHaveAllData ? 0 : mLoadedDiscard; + + // if we have the entire image data (and the image is not J2C), decode the full res image + // DO NOT decode a higher res j2c than was requested. This is a waste of time and memory. + S32 discard = mHaveAllData && mFormattedImage->getCodec() != IMG_CODEC_J2C ? 0 : mLoadedDiscard; mDecoded = false; setState(DECODE_IMAGE_UPDATE); LL_DEBUGS(LOG_TXT) << mID << ": Decoding. Bytes: " << mFormattedImage->getDataSize() << " Discard: " << discard @@ -2318,6 +2321,10 @@ void LLTextureFetchWorker::callbackDecoded(bool success, const std::string &erro mRawImage = raw; mAuxImage = aux; mDecodedDiscard = mFormattedImage->getDiscardLevel(); + if (mDecodedDiscard < mDesiredDiscard) + { + LL_WARNS_ONCE(LOG_TXT) << "Decoded higher resolution than requested" << LL_ENDL; + } LL_DEBUGS(LOG_TXT) << mID << ": Decode Finished. Discard: " << mDecodedDiscard << " Raw Image: " << llformat("%dx%d",mRawImage->getWidth(),mRawImage->getHeight()) << LL_ENDL; } |