summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2021-10-11 16:03:40 +0000
committerDave Parks <davep@lindenlab.com>2021-10-11 16:03:40 +0000
commitd00272e0cc9974f35a46f0c313ee2c0e11cddbda (patch)
tree48e1e3cc9c89107c28e58b69a35e25802c84014c /indra/newview/llviewertexturelist.cpp
parent2238f89db70a754614b01bb85adc5f16a63e7eb4 (diff)
SL-16099 Multi-threaded OpenGL usage on Windows, enable Core Profile and VAOs by default.
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 12495078e9..db740b69e9 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -114,6 +114,7 @@ void LLViewerTextureList::init()
void LLViewerTextureList::doPreloadImages()
{
+ LL_PROFILE_ZONE_SCOPED;
LL_DEBUGS("ViewerImages") << "Preloading images..." << LL_ENDL;
llassert_always(mInitialized) ;
@@ -205,6 +206,7 @@ static std::string get_texture_list_name()
void LLViewerTextureList::doPrefetchImages()
{
+ LL_PROFILE_ZONE_SCOPED;
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point
@@ -258,6 +260,7 @@ LLViewerTextureList::~LLViewerTextureList()
void LLViewerTextureList::shutdown()
{
+ LL_PROFILE_ZONE_SCOPED;
// clear out preloads
mImagePreloads.clear();
@@ -333,6 +336,7 @@ void LLViewerTextureList::shutdown()
void LLViewerTextureList::dump()
{
+ LL_PROFILE_ZONE_SCOPED;
LL_INFOS() << "LLViewerTextureList::dump()" << LL_ENDL;
for (image_priority_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it)
{
@@ -377,6 +381,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string&
LLGLenum primary_format,
const LLUUID& force_id)
{
+ LL_PROFILE_ZONE_SCOPED;
if(!mInitialized)
{
return NULL ;
@@ -404,6 +409,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string&
LLGLenum primary_format,
const LLUUID& force_id)
{
+ LL_PROFILE_ZONE_SCOPED;
if(!mInitialized)
{
return NULL ;
@@ -492,6 +498,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
LLGLenum primary_format,
LLHost request_from_host)
{
+ LL_PROFILE_ZONE_SCOPED;
if(!mInitialized)
{
return NULL ;
@@ -554,6 +561,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
LLGLenum primary_format,
LLHost request_from_host)
{
+ LL_PROFILE_ZONE_SCOPED;
static LLCachedControl<bool> fast_cache_fetching_enabled(gSavedSettings, "FastCacheFetchEnabled", true);
LLPointer<LLViewerFetchedTexture> imagep ;
@@ -609,6 +617,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
void LLViewerTextureList::findTexturesByID(const LLUUID &image_id, std::vector<LLViewerFetchedTexture*> &output)
{
+ LL_PROFILE_ZONE_SCOPED;
LLTextureKey search_key(image_id, TEX_LIST_STANDARD);
uuid_map_t::iterator iter = mUUIDMap.lower_bound(search_key);
while (iter != mUUIDMap.end() && iter->first.textureId == image_id)
@@ -634,6 +643,7 @@ LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id, E
void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image)
{
+ LL_PROFILE_ZONE_SCOPED;
assert_main_thread();
llassert_always(mInitialized) ;
llassert(image);
@@ -653,6 +663,7 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image)
void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
{
+ LL_PROFILE_ZONE_SCOPED;
assert_main_thread();
llassert_always(mInitialized) ;
llassert(image);
@@ -701,6 +712,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image, ETexListType tex_type)
{
+ LL_PROFILE_ZONE_SCOPED;
if (!new_image)
{
return;
@@ -724,6 +736,7 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image, ETexListTy
void LLViewerTextureList::deleteImage(LLViewerFetchedTexture *image)
{
+ LL_PROFILE_ZONE_SCOPED;
if( image)
{
if (image->hasCallbacks())
@@ -845,6 +858,7 @@ void LLViewerTextureList::updateImages(F32 max_time)
void LLViewerTextureList::clearFetchingRequests()
{
+ LL_PROFILE_ZONE_SCOPED;
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
{
return;
@@ -862,6 +876,7 @@ void LLViewerTextureList::clearFetchingRequests()
void LLViewerTextureList::updateImagesDecodePriorities()
{
+ LL_PROFILE_ZONE_SCOPED;
// Update the decode priority for N images each frame
{
F32 lazy_flush_timeout = 30.f; // stop decoding
@@ -977,6 +992,7 @@ void LLViewerTextureList::updateImagesDecodePriorities()
void LLViewerTextureList::setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level)
{
+ LL_PROFILE_ZONE_SCOPED;
if(!tex->setDebugFetching(debug_level))
{
return;
@@ -1025,6 +1041,7 @@ void LLViewerTextureList::setDebugFetching(LLViewerFetchedTexture* tex, S32 debu
F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
{
+ LL_PROFILE_ZONE_SCOPED;
if (gGLManager.mIsDisabled) return 0.0f;
//
@@ -1041,6 +1058,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
enditer = iter;
LLViewerFetchedTexture *imagep = *curiter;
imagep->createTexture();
+ imagep->postCreateTexture();
if (create_timer.getElapsedTimeF32() > max_time)
{
break;
@@ -1052,6 +1070,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
F32 LLViewerTextureList::updateImagesLoadingFastCache(F32 max_time)
{
+ LL_PROFILE_ZONE_SCOPED;
if (gGLManager.mIsDisabled) return 0.0f;
if(mFastCacheList.empty())
{
@@ -1082,6 +1101,7 @@ F32 LLViewerTextureList::updateImagesLoadingFastCache(F32 max_time)
void LLViewerTextureList::forceImmediateUpdate(LLViewerFetchedTexture* imagep)
{
+ LL_PROFILE_ZONE_SCOPED;
if(!imagep)
{
return ;
@@ -1101,6 +1121,7 @@ void LLViewerTextureList::forceImmediateUpdate(LLViewerFetchedTexture* imagep)
F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)
{
+ LL_PROFILE_ZONE_SCOPED;
LLTimer image_op_timer;
// Update fetch for N images each frame
@@ -1176,6 +1197,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)
void LLViewerTextureList::updateImagesUpdateStats()
{
+ LL_PROFILE_ZONE_SCOPED;
if (mForceResetTextureStats)
{
for (image_priority_list_t::iterator iter = mImageList.begin();
@@ -1190,6 +1212,7 @@ void LLViewerTextureList::updateImagesUpdateStats()
void LLViewerTextureList::decodeAllImages(F32 max_time)
{
+ LL_PROFILE_ZONE_SCOPED;
LLTimer timer;
//loading from fast cache
@@ -1259,6 +1282,7 @@ BOOL LLViewerTextureList::createUploadFile(const std::string& filename,
const std::string& out_filename,
const U8 codec)
{
+ LL_PROFILE_ZONE_SCOPED;
// Load the image
LLPointer<LLImageFormatted> image = LLImageFormatted::createFromType(codec);
if (image.isNull())
@@ -1312,6 +1336,7 @@ BOOL LLViewerTextureList::createUploadFile(const std::string& filename,
// note: modifies the argument raw_image!!!!
LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImageRaw> raw_image)
{
+ LL_PROFILE_ZONE_SCOPED;
raw_image->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C();
@@ -1345,6 +1370,7 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage
// Returns min setting for TextureMemory (in MB)
S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
{
+ LL_PROFILE_ZONE_SCOPED;
U32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB();
//min texture mem sets to 64M if total physical mem is more than 1.5GB
return (system_ram > U32Megabytes(1500)) ? S32Megabytes(64) : gMinVideoRam ;
@@ -1354,6 +1380,7 @@ S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
// Returns max setting for TextureMemory (in MB)
S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_multiplier)
{
+ LL_PROFILE_ZONE_SCOPED;
S32Megabytes max_texmem;
if (gGLManager.mVRAM != 0)
{
@@ -1407,6 +1434,7 @@ const S32Megabytes VIDEO_CARD_FRAMEBUFFER_MEM(12);
const S32Megabytes MIN_MEM_FOR_NON_TEXTURE(512);
void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem)
{
+ LL_PROFILE_ZONE_SCOPED;
// Initialize the image pipeline VRAM settings
S32Megabytes cur_mem(gSavedSettings.getS32("TextureMemory"));
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
@@ -1647,6 +1675,7 @@ void LLUIImageList::cleanUp()
LLUIImagePtr LLUIImageList::getUIImageByID(const LLUUID& image_id, S32 priority)
{
+ LL_PROFILE_ZONE_SCOPED;
// use id as image name
std::string image_name = image_id.asString();
@@ -1665,6 +1694,7 @@ LLUIImagePtr LLUIImageList::getUIImageByID(const LLUUID& image_id, S32 priority)
LLUIImagePtr LLUIImageList::getUIImage(const std::string& image_name, S32 priority)
{
+ LL_PROFILE_ZONE_SCOPED;
// look for existing image
uuid_ui_image_map_t::iterator found_it = mUIImages.find(image_name);
if (found_it != mUIImages.end())
@@ -1682,6 +1712,7 @@ LLUIImagePtr LLUIImageList::loadUIImageByName(const std::string& name, const std
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
LLUIImage::EScaleStyle scale_style)
{
+ LL_PROFILE_ZONE_SCOPED;
if (boost_priority == LLGLTexture::BOOST_NONE)
{
boost_priority = LLGLTexture::BOOST_UI;
@@ -1694,6 +1725,7 @@ LLUIImagePtr LLUIImageList::loadUIImageByID(const LLUUID& id,
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
LLUIImage::EScaleStyle scale_style)
{
+ LL_PROFILE_ZONE_SCOPED;
if (boost_priority == LLGLTexture::BOOST_NONE)
{
boost_priority = LLGLTexture::BOOST_UI;
@@ -1705,6 +1737,7 @@ LLUIImagePtr LLUIImageList::loadUIImageByID(const LLUUID& id,
LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect,
LLUIImage::EScaleStyle scale_style)
{
+ LL_PROFILE_ZONE_SCOPED;
if (!imagep) return NULL;
imagep->setAddressMode(LLTexUnit::TAM_CLAMP);
@@ -1742,6 +1775,7 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLUIImage::EScaleStyle scale_style)
{
+ LL_PROFILE_ZONE_SCOPED;
// look for existing image
uuid_ui_image_map_t::iterator found_it = mUIImages.find(name);
if (found_it != mUIImages.end())
@@ -1756,6 +1790,7 @@ LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::s
//static
void LLUIImageList::onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* user_data )
{
+ LL_PROFILE_ZONE_SCOPED;
if(!success || !user_data)
{
return;
@@ -1857,6 +1892,7 @@ struct UIImageDeclarations : public LLInitParam::Block<UIImageDeclarations>
bool LLUIImageList::initFromFile()
{
+ LL_PROFILE_ZONE_SCOPED;
// Look for textures.xml in all the right places. Pass
// constraint=LLDir::ALL_SKINS because we want to overlay textures.xml
// from all the skins directories.