SL-18221 Water texture does not load after clearing cache

Water texture should load only after having caps.
Prefetch textures should load only after having caps.
Prefetch list is now per grid
master
Andrey Kleshchev 2022-09-22 23:33:48 +03:00
parent d9d9edfa6d
commit 5fc91f6911
4 changed files with 36 additions and 14 deletions

View File

@ -1286,9 +1286,6 @@ bool idle_startup()
// Initialize classes w/graphics stuff.
//
LLViewerStatsRecorder::instance(); // Since textures work in threads
gTextureList.doPrefetchImages();
display_startup();
LLSurface::initClasses();
display_startup();
@ -1433,6 +1430,12 @@ bool idle_startup()
if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
{
display_startup();
// These textures are not warrantied to be cached, so needs
// to hapen with caps granted
gTextureList.doPrefetchImages();
display_startup();
update_texture_fetch();
display_startup();

View File

@ -1291,10 +1291,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
if ( use_http && mCanUseHTTP && mUrl.empty())//get http url.
{
LLViewerRegion* region = NULL;
if (mHost.isInvalid())
region = gAgent.getRegion();
else
region = LLWorld::getInstance()->getRegion(mHost);
if (mHost.isInvalid())
{
region = gAgent.getRegion();
}
else if (LLWorld::instanceExists())
{
region = LLWorld::getInstance()->getRegion(mHost);
}
if (region)
{

View File

@ -50,6 +50,7 @@
#include "llviewercontrol.h"
#include "llviewertexture.h"
#include "llviewermedia.h"
#include "llviewernetwork.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "pipeline.h"
@ -155,12 +156,6 @@ void LLViewerTextureList::doPreloadImages()
image->setAddressMode(LLTexUnit::TAM_WRAP);
mImagePreloads.insert(image);
}
image = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, FTT_DEFAULT, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
if (image)
{
image->setAddressMode(LLTexUnit::TAM_WRAP);
mImagePreloads.insert(image);
}
image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
0, 0, IMG_TRANSPARENT);
if (image)
@ -193,13 +188,31 @@ void LLViewerTextureList::doPreloadImages()
static std::string get_texture_list_name()
{
return gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + ".xml");
if (LLGridManager::getInstance()->isInProductionGrid())
{
return gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
"texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + ".xml");
}
else
{
const std::string& grid_id_str = LLGridManager::getInstance()->getGridId();
const std::string& grid_id_lower = utf8str_tolower(grid_id_str);
return gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
"texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + "." + grid_id_lower + ".xml");
}
}
void LLViewerTextureList::doPrefetchImages()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, FTT_DEFAULT, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
if (imagep)
{
imagep->setAddressMode(LLTexUnit::TAM_WRAP);
mImagePreloads.insert(imagep);
}
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point

View File

@ -127,7 +127,9 @@ public:
S32 getNumImages() { return mImageList.size(); }
// Local UI images
void doPreloadImages();
// Network images. Needs caps and cache to work
void doPrefetchImages();
void clearFetchingRequests();