summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-02-23 16:51:33 -0600
committerDave Parks <davep@lindenlab.com>2022-02-23 16:51:33 -0600
commitd9a68339d5aa18af349e347d6ed74bc01824cec7 (patch)
treecb8dd1c146499d57daa6798495a7540c691bdddb /indra/newview
parent65a28c5d7dc54dc9e263da4b19229fb5f86a1c62 (diff)
SL-16815 and SL-16906 Avoid redundant bumpmap generation, add some assertions around ref counting and (hack) fix crash on shutdown from dangling texture reference (reduced to 1 dangling texture from several hundred, can't find the remaining reference).
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolbump.cpp4
-rw-r--r--indra/newview/llviewertexture.cpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 2b151487fd..1d5419b515 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1051,8 +1051,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
}
}
- //if (iter->second->getWidth() != src->getWidth() ||
- // iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
+ if (iter->second->getWidth() != src->getWidth() ||
+ iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
{
LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1);
U8* dst_data = dst_image->getData();
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index fa2c070ea0..e3ac56d0d3 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1619,7 +1619,6 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
mNeedsCreateTexture = TRUE;
if (preCreateTexture())
{
- ref();
#if LL_IMAGEGL_THREAD_CHECK
//grab a copy of the raw image data to make sure it isn't modified pending texture creation
U8* data = mRawImage->getData();
@@ -1635,6 +1634,7 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
auto mainq = LLImageGLThread::sEnabled ? mMainQueue.lock() : nullptr;
if (mainq)
{
+ ref();
mainq->postTo(
mImageQueue,
// work to be done on LLImageGL worker thread
@@ -1681,7 +1681,6 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
else
{
gTextureList.mCreateTextureList.insert(this);
- unref();
}
}
}