diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index 1d094cd4f4d69bdbf9d0bf425f8ab4d6b0cd51ca..60721977cdc6f2196732dff012441f394c4fc1cc 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -68,4 +68,3 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER -const LLUUID IMG_BLACK_SQUARE ("3b39cc01-c2d1-e194-1181-e4404978b20c"); // On dataserver diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 6d39aef32e487f644acb23fb55d19db6f8b205de..02f063f5e843cf2105440983e85e05d6f7e2ec98 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -205,8 +205,6 @@ LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL; LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; -LL_COMMON_API extern const LLUUID IMG_BLACK_SQUARE; - // radius within which a chat message is fully audible const F32 CHAT_NORMAL_RADIUS = 20.f; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 539881c80e8b98fa02217de778a65ab494b81d86..b5e674bd7b3a8eb672226bc850e6a68138f1bd02 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -410,6 +410,7 @@ extern BOOL gPrintMessagesThisFrame; extern LLUUID gSunTextureID; extern LLUUID gMoonTextureID; +extern LLUUID gBlackSquareID; extern BOOL gRandomizeFramerate; extern BOOL gPeriodicSlowFrame; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index d4f37e51efc32750d4322c82eb0aa64f973a0e41..f44e19dbe4917ce0a5fe2f8daf280b38d7d480a2 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -50,6 +50,7 @@ #include "llrendersphere.h" #include "llviewerpartsim.h" #include "llviewercontrol.h" // for gSavedSettings +#include "llviewertexturelist.h" static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; @@ -63,6 +64,7 @@ BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; F32 LLDrawPoolAvatar::sMinimumAlpha = 0.2f; +LLUUID gBlackSquareID; static bool is_deferred_render = false; static bool is_post_deferred_render = false; @@ -1811,12 +1813,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLViewerTexture* specular = NULL; if (LLPipeline::sImpostorRender) { - std::vector<LLViewerFetchedTexture*> found; - LLViewerTextureManager::findFetchedTextures(IMG_BLACK_SQUARE, found); - if (1 <= found.size()) - { - specular = found[0]; - } + specular = LLViewerTextureManager::findFetchedTexture(gBlackSquareID, TEX_LIST_DISCARD); + llassert(NULL != specular); } else { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e2b8ff8e80152b15365c349595c94f60628500cc..5a38ab5c9d5cdc47aa5458202650a5ed1613e5f1 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1117,6 +1117,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastCallBackActiveTime = 0.f; mForceCallbackFetch = FALSE; mInDebug = FALSE; + mUnremovable = FALSE; mFTType = FTT_UNKNOWN; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index a3f8db69076378d669f3c2c6b3a71072ecfc9b7e..8017d8260418e27b9a366af9c848535739d40771 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -346,7 +346,10 @@ public: bool updateFetch(); bool setDebugFetching(S32 debug_level); - bool isInDebug() {return mInDebug;} + bool isInDebug() const { return mInDebug; } + + void setUnremovable(BOOL value) { mUnremovable = value; } + bool isUnremovable() const { return mUnremovable; } void clearFetchedResults(); //clear all fetched results, for debug use. @@ -435,6 +438,7 @@ private: private: BOOL mFullyLoaded; BOOL mInDebug; + BOOL mUnremovable; BOOL mInFastCacheList; BOOL mForceCallbackFetch; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 9ee5ed758f9a699967b7859aa0fdb09b77c3d976..be80fab8d2a01984ead92f5c4636ffc8a8990c62 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -184,6 +184,12 @@ void LLViewerTextureList::doPreloadImages() mImagePreloads.insert(image); } + LLPointer<LLImageRaw> img_blak_square_tex(new LLImageRaw(2, 2, 3)); + memset(img_blak_square_tex->getData(), 0, img_blak_square_tex->getDataSize()); + LLPointer<LLViewerFetchedTexture> img_blak_square(new LLViewerFetchedTexture(img_blak_square_tex, FTT_DEFAULT, FALSE)); + gBlackSquareID = img_blak_square->getID(); + img_blak_square->setUnremovable(TRUE); + addImage(img_blak_square, TEX_LIST_DISCARD); } static std::string get_texture_list_name() @@ -854,7 +860,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() LLPointer<LLViewerFetchedTexture> imagep = iter->second; ++iter; // safe to increment now - if(imagep->isInDebug()) + if(imagep->isInDebug() || imagep->isUnremovable()) { update_counter--; continue; //is in debug, ignore.