From f90beef498640a2f7fd083eac687acac16e28613 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Tue, 12 Oct 2010 18:21:07 +0200 Subject: Don't try to fetch http-textures past end of file Treat http texture requests that returned less data than requsted as indication that we have the whole file, even if we did not specifically requested the whole file by using a very large range yet. IMPORTANT: This will fail to load past 599 bytes in OpenSim <= 0.7.0.2, as it has buggy handling of ranged requests. But OpenSim http texture breakage is not new. http://opensimulator.org/mantis/view.php?id=5081 --- linden/indra/newview/lltexturefetch.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index 5cad14c..bf97584 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -317,7 +317,7 @@ public: mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } - lldebugs << "HTTP COMPLETE: " << mID << llendl; + LL_DEBUGS("TextureFetch") << "HTTP COMPLETE: " << mID << " with status: " << status << LL_ENDL; mFetcher->lockQueue(); LLTextureFetchWorker* worker = mFetcher->getWorker(mID); if (worker) @@ -882,10 +882,11 @@ bool LLTextureFetchWorker::doWork(S32 param) mLoaded = FALSE; mGetStatus = 0; mGetReason.clear(); - lldebugs << "HTTP GET: " << mID << " Offset: " << offset + LL_DEBUGS("TextureFetch") << "HTTP GET: " << mID << " Offset: " << offset << " Bytes: " << mRequestedSize + << " Range: " << offset << "-" << offset+mRequestedSize-1 << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << max_bandwidth - << llendl; + << LL_ENDL; setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); mState = WAIT_HTTP_REQ; @@ -1322,18 +1323,18 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, gImageList.sTextureBits += data_size * 8; // Approximate - does not include header bits - //llinfos << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << llendl; + LL_DEBUGS("TextureFetch") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << " mRequestedSize: " << mRequestedSize << LL_ENDL; if (data_size > 0) { // *TODO: set the formatted image data here directly to avoid the copy mBuffer = new U8[data_size]; buffer->readAfter(channels.in(), NULL, mBuffer, data_size); mBufferSize += data_size; - if (data_size < mRequestedSize && - (mRequestedDiscard == 0 || mRequestedSize >= MAX_IMAGE_DATA_SIZE) ) + if (data_size < mRequestedSize) { // We requested whole image (by discard or by size,) so assume we got it mHaveAllData = TRUE; + mRequestedDiscard = 0; } else if (data_size > mRequestedSize) { -- cgit v1.1 From 202deea1a2480f5a18553f6e60e797a5f2582eb6 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Thu, 14 Oct 2010 20:22:23 +0200 Subject: More robust handling of http texture responses. Specifically allow for status 416 (unsatisfiable range) and scuessful responses without status 216 (i.e. whole file at once). This *should* allow this to work on different servers, as long as they comply with RFC 2616 WRT range requests. --- linden/indra/newview/lltexturefetch.cpp | 97 +++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 29 deletions(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index bf97584..80e3bfc 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -157,7 +157,7 @@ public: void callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, - bool last_block, bool success); + bool partial, bool unsatisfiable, bool success); void callbackCacheRead(bool success, LLImageFormatted* image, S32 imagesize, BOOL islocal); void callbackCacheWrite(bool success); @@ -324,6 +324,7 @@ public: { bool success = false; bool partial = false; + bool unsatisfiable = false; if (200 <= status && status < 300) { success = true; @@ -332,18 +333,19 @@ public: partial = true; } } - else + else if (status == HTTP_REQUESTED_RANGE_NOT_SATISFIABLE) { - worker->setGetStatus(status, reason); -// llwarns << status << ": " << reason << llendl; + LL_DEBUGS("TextureFetch") << "Request was an unsatisfiable range: mRequestedSize=" << mRequestedSize << " mOffset=" << mOffset << " for: " << mID << LL_ENDL; + unsatisfiable = true; } + if (!success) { worker->setGetStatus(status, reason); // llwarns << "CURL GET FAILED, status:" << status << " reason:" << reason << llendl; } mFetcher->removeFromHTTPQueue(mID); - worker->callbackHttpGet(channels, buffer, partial, success); + worker->callbackHttpGet(channels, buffer, partial, unsatisfiable, success); } else { @@ -1301,7 +1303,9 @@ bool LLTextureFetchWorker::processSimulatorPackets() void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, - bool last_block, bool success) + bool partial, + bool unsatisfiable, + bool success) { LLMutexLock lock(&mWorkMutex); @@ -1316,56 +1320,91 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, llwarns << "Duplicate callback for " << mID.asString() << llendl; return; // ignore duplicate callback } + + S32 data_size = 0; if (success) { // get length of stream: - S32 data_size = buffer->countAfter(channels.in(), NULL); + data_size = buffer->countAfter(channels.in(), NULL); gImageList.sTextureBits += data_size * 8; // Approximate - does not include header bits LL_DEBUGS("TextureFetch") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << " mRequestedSize: " << mRequestedSize << LL_ENDL; + if (data_size > 0) { - // *TODO: set the formatted image data here directly to avoid the copy - mBuffer = new U8[data_size]; - buffer->readAfter(channels.in(), NULL, mBuffer, data_size); - mBufferSize += data_size; - if (data_size < mRequestedSize) + bool clean_data = false; + bool done = false; + if (!partial) { - // We requested whole image (by discard or by size,) so assume we got it - mHaveAllData = TRUE; - mRequestedDiscard = 0; + // we got the whole image in one go + done = true; + clean_data = true; + } + else if (data_size < mRequestedSize) + { + // we have the whole image + done = true; + } + else if (data_size == mRequestedSize) + { + if (mRequestedDiscard <= 0) + { + done = true; + } + else + { + // this is the normal case where we get the data we requested, + // but still need to request more data. + } } else if (data_size > mRequestedSize) { // *TODO: This shouldn't be happening any more llwarns << "data_size = " << data_size << " > requested: " << mRequestedSize << llendl; - mHaveAllData = TRUE; + done = true; + clean_data = true; llassert_always(mDecodeHandle == 0); - mFormattedImage = NULL; // discard any previous data we had - mBufferSize = data_size; } - mRequestedSize = data_size; - } - else - { - // We requested data but received none (and no error), - if (mFormattedImage.notNull() && mFormattedImage->getDataSize() > 0) + + if (clean_data) { - // but have earlier data, so presumably we have it all. - mRequestedSize = 0; - mHaveAllData = TRUE; + resetFormattedData(); // discard any previous data we had + llassert(mBufferSize == 0); } - else + if (done) { - mRequestedSize = -1; // treat this fetch as if it failed. + mHaveAllData = TRUE; + mRequestedDiscard = 0; } + + // *TODO: set the formatted image data here directly to avoid the copy + mBuffer = new U8[data_size]; + buffer->readAfter(channels.in(), NULL, mBuffer, data_size); + mBufferSize += data_size; + mRequestedSize = data_size; + } + } + + if ((success && (data_size == 0)) || unsatisfiable) + { + if (mFormattedImage.notNull() && mFormattedImage->getDataSize() > 0) + { + // we already have some data, so we'll assume we have it all + mRequestedSize = 0; + mRequestedDiscard = 0; + mHaveAllData = TRUE; + } + else + { + mRequestedSize = -1; // treat this fetch as if it failed. } } else { mRequestedSize = -1; // error } + mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); } -- cgit v1.1 From 4d9f3db24601091947611aa20efbb8432e4f2aa7 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Thu, 14 Oct 2010 20:34:04 +0200 Subject: Work around for buggy range responses in OpenSim Ugly work around for http://opensimulator.org/mantis/view.php?id=5081 by adding 1 to the http request range when on affected versions, and always requesting ranges that start with 0 (viewer2 style). --- linden/indra/newview/lltexturefetch.cpp | 53 ++++++++++++++++++++++++++++++++- linden/indra/newview/lltexturefetch.h | 2 ++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index 80e3bfc..bd1812e 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -871,6 +871,16 @@ bool LLTextureFetchWorker::doWork(S32 param) return false; } } + + // *TODO: remove this hack when not needed anymore + S32 buggy_range_fudge = 0; + if (LLTextureFetch::hasBuggyHTTPRange()) + { + buggy_range_fudge = 1; + resetFormattedData(); // discard any previous data we had + cur_size = 0 ; + } + mRequestedSize = mDesiredSize; mRequestedDiscard = mDesiredDiscard; mRequestedSize -= cur_size; @@ -896,7 +906,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // Will call callbackHttpGet when curl request completes std::vector headers; headers.push_back("Accept: image/x-j2c"); - res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, + res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize + buggy_range_fudge, new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset)); } if (!res) @@ -2258,3 +2268,44 @@ void LLTextureFetch::dump() } } +// This tries to detect if the sim has this bug: +// http://opensimulator.org/mantis/view.php?id=5081 +// +// *TODO: This is a *HACK and may not work if the grid is heterogenous. +// Remove it once OpenSim versions in the wild are > 0.7.0.2! +#include "hippoGridManager.h" +#include +//static +bool LLTextureFetch::hasBuggyHTTPRange() +{ + static std::string s_version; + static bool buggy = false; + if ((s_version != gLastVersionChannel) && !gLastVersionChannel.empty()) + { + s_version = gLastVersionChannel; + buggy = true; + if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_OPENSIM) + { + std::string ver_string; + try + { + const boost::regex re(".*OpenSim.*?([0-9.]+).+"); + ver_string = regex_replace(s_version, re, "\\1", boost::match_default); + } + catch(std::runtime_error) + { + ver_string = "0.0"; + } + LLStringUtil::replaceChar(ver_string, '.', '0'); + ver_string = "0." + ver_string; + F64 version = atof(ver_string.c_str()); + // we look for "0.6.8" < version < "0.7.0.3" + if ((version > 0.00608) && (version < 0.0070003)) + { + buggy = true; + llwarns << "Setting buggy http ranges mode for current sim, because we're on " << s_version << llendl; + } + } + } + return buggy; +} diff --git a/linden/indra/newview/lltexturefetch.h b/linden/indra/newview/lltexturefetch.h index 5eca0ba..61f76bc 100644 --- a/linden/indra/newview/lltexturefetch.h +++ b/linden/indra/newview/lltexturefetch.h @@ -86,6 +86,8 @@ public: LLTextureInfo* getTextureInfo() { return &mTextureInfo; } + static bool hasBuggyHTTPRange(); // *TODO: remove this *HACK once buggy OpenSim versions are gone + protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); -- cgit v1.1 From 7b0ce8e12ac68bfc1eb7524a394aaf3a485b559b Mon Sep 17 00:00:00 2001 From: thickbrick Date: Fri, 15 Oct 2010 01:21:53 +0200 Subject: Fix typo in buggy OpenSim version detection. --- linden/indra/newview/lltexturefetch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index bd1812e..e307aff 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -896,7 +896,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mGetReason.clear(); LL_DEBUGS("TextureFetch") << "HTTP GET: " << mID << " Offset: " << offset << " Bytes: " << mRequestedSize - << " Range: " << offset << "-" << offset+mRequestedSize-1 + << " Range: " << offset << "-" << offset+mRequestedSize-1+buggy_range_fudge << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << max_bandwidth << LL_ENDL; setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); @@ -2283,7 +2283,7 @@ bool LLTextureFetch::hasBuggyHTTPRange() if ((s_version != gLastVersionChannel) && !gLastVersionChannel.empty()) { s_version = gLastVersionChannel; - buggy = true; + buggy = false; if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_OPENSIM) { std::string ver_string; -- cgit v1.1 From f99462872fd9d54658f8702929583bd4a607b21a Mon Sep 17 00:00:00 2001 From: thickbrick Date: Sat, 16 Oct 2010 03:11:19 +0200 Subject: Fix the fix - bad logic for failed http requests --- linden/indra/newview/lltexturefetch.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index e307aff..a39e2df 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -1395,6 +1395,10 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, mRequestedSize = data_size; } } + else + { + mRequestedSize = -1; // error + } if ((success && (data_size == 0)) || unsatisfiable) { @@ -1410,11 +1414,7 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, mRequestedSize = -1; // treat this fetch as if it failed. } } - else - { - mRequestedSize = -1; // error - } - + mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); } -- cgit v1.1 From ee23c250612b9b2da34472c47c740746232c6104 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Sat, 16 Oct 2010 03:16:14 +0200 Subject: Port of SNOW-802: Use UDP for baked textures. Port of SNOW-802 from SG1. Originally ported by Robin cornelius from SG 2.1. Also added a paramter can_use_http to the LLTextureFetchWorker constructor, to avoid messing with locks. --- linden/indra/newview/lltexturefetch.cpp | 12 +++++++----- linden/indra/newview/lltexturefetch.h | 2 +- linden/indra/newview/llviewerimage.cpp | 6 ++++-- linden/indra/newview/llviewerimage.h | 4 ++++ linden/indra/newview/llvoavatar.cpp | 1 + 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index a39e2df..f63deb8 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -176,7 +176,7 @@ protected: LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host, F32 priority, S32 discard, S32 size); LLTextureFetchWorker(LLTextureFetch* fetcher, const std::string& url, const LLUUID& id, const LLHost& host, - F32 priority, S32 discard, S32 size); + F32 priority, S32 discard, S32 size, bool can_use_http); private: /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD) @@ -390,7 +390,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, const LLHost& host, // Simulator host F32 priority, // Priority S32 discard, // Desired discard - S32 size) // Desired size + S32 size, // Desired size + bool can_use_http) // Try HTTP first : LLWorkerClass(fetcher, "TextureFetch"), mState(INIT), mWriteToCacheState(NOT_WRITE), @@ -422,7 +423,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mNeedsAux(FALSE), mHaveAllData(FALSE), mInLocalCache(FALSE), - mCanUseHTTP(true), + mCanUseHTTP(can_use_http), mHTTPFailCount(0), mRetryAttempt(0), mActiveCount(0), @@ -1556,7 +1557,7 @@ LLTextureFetch::~LLTextureFetch() } bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux) + S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) { if (mDebugPause) { @@ -1618,6 +1619,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con worker->lockWorkMutex(); worker->setImagePriority(priority); worker->setDesiredDiscard(desired_discard, desired_size); + worker->setCanUseHTTP(can_use_http); worker->unlockWorkMutex(); if (!worker->haveWork()) { @@ -1633,7 +1635,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con } else { - worker = new LLTextureFetchWorker(this, url, id, host, priority, desired_discard, desired_size); + worker = new LLTextureFetchWorker(this, url, id, host, priority, desired_discard, desired_size, can_use_http); mRequestMap[id] = worker; } worker->mActiveCount++; diff --git a/linden/indra/newview/lltexturefetch.h b/linden/indra/newview/lltexturefetch.h index 61f76bc..5fa2d1c 100644 --- a/linden/indra/newview/lltexturefetch.h +++ b/linden/indra/newview/lltexturefetch.h @@ -60,7 +60,7 @@ public: /*virtual*/ S32 update(U32 max_time_ms); bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 discard, bool needs_aux); + S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool use_http); void deleteRequest(const LLUUID& id, bool cancel); bool getRequestFinished(const LLUUID& id, S32& discard_level, LLPointer& raw, LLPointer& aux); diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp index 400fb2f..4f23a05 100644 --- a/linden/indra/newview/llviewerimage.cpp +++ b/linden/indra/newview/llviewerimage.cpp @@ -346,6 +346,8 @@ void LLViewerImage::init(bool firstinit) mForceToSaveRawImage = FALSE ; mSavedRawDiscardLevel = -1 ; mDesiredSavedRawDiscardLevel = -1 ; + + mCanUseHTTP = true; //default on if cap/settings allows us } // virtual @@ -1213,7 +1215,7 @@ bool LLViewerImage::updateFetch() // bypass texturefetch directly by pulling from LLTextureCache bool fetch_request_created = false; fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), decode_priority, - w, h, c, desired_discard, needsAux()); + w, h, c, desired_discard, needsAux(), mCanUseHTTP); if (fetch_request_created) { @@ -1292,7 +1294,7 @@ BOOL LLViewerImage::forceFetch() c = getComponents(); } fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), maxDecodePriority(), - w, h, c, desired_discard, needsAux()); + w, h, c, desired_discard, needsAux(), mCanUseHTTP); if (fetch_request_created) { diff --git a/linden/indra/newview/llviewerimage.h b/linden/indra/newview/llviewerimage.h index c82b68b..3bee51c 100644 --- a/linden/indra/newview/llviewerimage.h +++ b/linden/indra/newview/llviewerimage.h @@ -314,6 +314,8 @@ public: void addFace(LLFace* facep) ; void removeFace(LLFace* facep) ; + void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}; + friend class LocalBitmap; // tag: vaa emerald local_asset_browser private: @@ -418,6 +420,8 @@ private: typedef std::list ll_face_list_t ; ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture + bool mCanUseHTTP; // can this image be fetched by http + public: static const U32 sCurrentFileVersion; // Default textures diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index d2aa3d8..7bbaf48 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -5196,6 +5196,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep, void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { + imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures. mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); mMinPixelArea = llmin(pixel_area, mMinPixelArea); imagep->addTextureStats(pixel_area / texel_area_ratio); -- cgit v1.1 From 0297f5d55f2ba5975ed3869f387d404638aec88f Mon Sep 17 00:00:00 2001 From: thickbrick Date: Sat, 16 Oct 2010 16:03:31 +0200 Subject: More SNOW-802: disable http for bakes earlier. --- linden/indra/newview/llviewerimage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp index 4f23a05..671a359 100644 --- a/linden/indra/newview/llviewerimage.cpp +++ b/linden/indra/newview/llviewerimage.cpp @@ -256,6 +256,10 @@ LLViewerImage::LLViewerImage(const LLUUID& id, const LLHost& host, BOOL usemipma { init(true); sImageCount++; + if (host != LLHost::invalid) + { + mCanUseHTTP = false; // this is a baked texture + } } LLViewerImage::LLViewerImage(const std::string& url, const LLUUID& id, BOOL usemipmaps) -- cgit v1.1 From ccf5b667663b01c724014f19c28022498d1b3bb6 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Sun, 17 Oct 2010 23:50:42 +0200 Subject: Ask for at least 512^2 pixels of local texture before bake Not sure this helps with non-baking, but it looked wrong. Also, only bind local texture before they are covered by a bake. --- linden/indra/newview/llvoavatar.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 7bbaf48..9937ed9 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -5129,12 +5129,6 @@ void LLVOAvatar::updateTextures() if (texture_dict->mIsLocalTexture) { addLocalTextureStats((ETextureIndex)index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); - // SNOW-8 : temporary snowglobe1.0 fix for baked textures - if (render_avatar && !gGLManager.mIsDisabled ) - { - // bind the texture so that its boost level won't be slammed - gGL.getTexUnit(0)->bind(imagep); - } } else if (texture_dict->mIsBakedTexture) { @@ -5171,8 +5165,14 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep, F32 desired_pixels; if( mIsSelf ) { - desired_pixels = llmin(mPixelArea, (F32)TEX_IMAGE_AREA_SELF ); + desired_pixels = llmax(mPixelArea, (F32)TEX_IMAGE_AREA_SELF ); imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_AVATAR_SELF); + // SNOW-8 : temporary snowglobe1.0 fix for baked textures + if (render_avatar && !gGLManager.mIsDisabled ) + { + // bind the texture so that its boost level won't be slammed + gGL.getTexUnit(0)->bind(imagep); + } } else { -- cgit v1.1