From f2b32dafa4ddb7af6c2b775c51214d1ddf4fd98b Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 29 Nov 2016 12:28:21 +0200 Subject: MAINT-6729 Fix crash in LLImageGL::analyzeAlpha() --- indra/newview/llviewertexture.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 178aa1e646..3cef34445a 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1419,11 +1419,17 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) destroyRawImage(); return FALSE; } - mNeedsCreateTexture = FALSE; + mNeedsCreateTexture = FALSE; if (mRawImage.isNull()) { LL_ERRS() << "LLViewerTexture trying to create texture with no Raw Image" << LL_ENDL; } + if (mRawImage->isBufferInvalid()) + { + LL_WARNS() << "Can't create a texture: invalid image data" << LL_ENDL; + destroyRawImage(); + return FALSE; + } // LL_INFOS() << llformat("IMAGE Creating (%d) [%d x %d] Bytes: %d ", // mRawDiscardLevel, // mRawImage->getWidth(), mRawImage->getHeight(),mRawImage->getDataSize()) -- cgit v1.2.3 From 9bfcda0a5118d0a0782f2786049de411701019a4 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Thu, 10 Nov 2016 19:44:51 +0200 Subject: MAINT-6882 4k monitor with maximized window overwhelms low end GPUs and crashes viewer --- indra/newview/llviewertexture.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3cef34445a..6abd6f7b64 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -488,7 +488,7 @@ bool LLViewerTexture::isMemoryForTextureLow() LL_RECORD_BLOCK_TIME(FTM_TEXTURE_MEMORY_CHECK); - const S32Megabytes MIN_FREE_TEXTURE_MEMORY(5); //MB + const S32Megabytes MIN_FREE_TEXTURE_MEMORY(20); //MB Changed to 20 MB per MAINT-6882 const S32Megabytes MIN_FREE_MAIN_MEMORY(100); //MB bool low_mem = false; @@ -511,18 +511,17 @@ bool LLViewerTexture::isMemoryForTextureLow() } } } -#if 0 //ignore nVidia cards + //Enabled this branch per MAINT-6882 else if (gGLManager.mHasNVXMemInfo) { S32 free_memory; glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory); - if(free_memory / 1024 < MIN_FREE_TEXTURE_MEMORY) + if ((S32Megabytes)(free_memory / 1024) < MIN_FREE_TEXTURE_MEMORY) { low_mem = true; } } -#endif return low_mem; } -- cgit v1.2.3 From 19c3f47e00e348739eaf31685c8ea804704a08e5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 31 May 2017 21:24:04 +0300 Subject: MAINT-7325 Fixed issue of images being marked as missing due to uninitialized discard level --- indra/newview/llviewertexture.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6abd6f7b64..c162af371f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1462,9 +1462,17 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) } bool size_okay = true; - - U32 raw_width = mRawImage->getWidth() << mRawDiscardLevel; - U32 raw_height = mRawImage->getHeight() << mRawDiscardLevel; + + S32 discard_level = mRawDiscardLevel; + if (mRawDiscardLevel < 0) + { + LL_DEBUGS() << "Negative raw discard level when creating image: " << mRawDiscardLevel << LL_ENDL; + discard_level = 0; + } + + U32 raw_width = mRawImage->getWidth() << discard_level; + U32 raw_height = mRawImage->getHeight() << discard_level; + if( raw_width > MAX_IMAGE_SIZE || raw_height > MAX_IMAGE_SIZE ) { LL_INFOS() << "Width or height is greater than " << MAX_IMAGE_SIZE << ": (" << raw_width << "," << raw_height << ")" << LL_ENDL; -- cgit v1.2.3 From 515db9c3e6acf30d0adb58868ac0acfe684c4166 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Jun 2017 20:17:55 +0300 Subject: MAINT-7325 Fixed empty cached image being used instead of fetching --- indra/newview/llviewertexture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index c162af371f..cd8dd54fa6 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2089,7 +2089,9 @@ bool LLViewerFetchedTexture::updateFetch() { make_request = false; } - else if(mCachedRawImage.notNull() && (current_discard < 0 || current_discard > mCachedRawDiscardLevel)) + else if(mCachedRawImage.notNull() // can be empty + && mCachedRawImageReady + && (current_discard < 0 || current_discard > mCachedRawDiscardLevel)) { make_request = false; switchToCachedImage(); //use the cached raw data first -- cgit v1.2.3 From f8254a9d787ab6235c8fb076bd65dc7cd978dce9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 Aug 2017 19:57:02 +0300 Subject: MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows folder. --- indra/newview/llviewertexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index cd8dd54fa6..5de7df7b91 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3966,7 +3966,7 @@ void LLTexturePipelineTester::updateStablizingTime() } //virtual -void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) +void LLTexturePipelineTester::compareTestSessions(llofstream* os) { LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast(mBaseSessionp); LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast(mCurrentSessionp); -- cgit v1.2.3 From 6dcde6469d03b96260b1d00c22a90d76357a28ae Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 6 Jun 2017 15:30:03 +0300 Subject: [SL-711] - Eliminate some overheads in texturecache. - Eliminate memory overhead when need duplicated scaled image. - Small improvement in LLImageBase::getCodecFromExtension() --- indra/newview/llviewertexture.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5de7df7b91..e5a1bed48c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1396,8 +1396,7 @@ void LLViewerFetchedTexture::addToCreateTexture() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } } @@ -2913,8 +2912,7 @@ void LLViewerFetchedTexture::setCachedRawImage() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } mCachedRawImage = mRawImage; -- cgit v1.2.3