From f9cf9179122d06782f0c968ba84adc1e44dd1e21 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 11 Aug 2011 18:16:21 -0600 Subject: fix for SH-2194: viewer UI is visible on the login progress screen --- indra/newview/llstartup.cpp | 32 +++++++++++++++++++++----------- indra/newview/llviewertexture.cpp | 22 +++++++++++++++------- indra/newview/llviewertexture.h | 1 + 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e4bf668275..9855326093 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2557,22 +2557,32 @@ void init_start_screen(S32 location_id) else if(!start_image_bmp->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; - return; + gStartTexture = NULL; } + else + { + gStartImageWidth = start_image_bmp->getWidth(); + gStartImageHeight = start_image_bmp->getHeight(); - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + LLPointer raw = new LLImageRaw; + if (!start_image_bmp->decode(raw, 0.0f)) + { + LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; + gStartTexture = NULL; + } + else + { + raw->expandToPowerOfTwo(); + gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ; + } + } - LLPointer raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if(gStartTexture.isNull()) { - LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; - gStartTexture = NULL; - return; + gStartTexture = LLViewerTexture::sBlackImagep ; + gStartImageWidth = gStartTexture->getWidth() ; + gStartImageHeight = gStartTexture->getHeight() ; } - - raw->expandToPowerOfTwo(); - gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5fcc57bc91..70509f9a9f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -66,6 +66,7 @@ // statics LLPointer LLViewerTexture::sNullImagep = NULL; +LLPointer LLViewerTexture::sBlackImagep = NULL; LLPointer LLViewerFetchedTexture::sMissingAssetImagep = NULL; LLPointer LLViewerFetchedTexture::sWhiteImagep = NULL; LLPointer LLViewerFetchedTexture::sDefaultImagep = NULL; @@ -295,17 +296,23 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromHost(const void LLViewerTextureManager::init() { - LLPointer raw = new LLImageRaw(1,1,3); - raw->clear(0x77, 0x77, 0x77, 0xFF); - LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE) ; - -#if 1 - LLPointer imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT); - LLViewerFetchedTexture::sDefaultImagep = imagep; + { + LLPointer raw = new LLImageRaw(1,1,3); + raw->clear(0x77, 0x77, 0x77, 0xFF); + LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE) ; + } const S32 dim = 128; LLPointer image_raw = new LLImageRaw(dim,dim,3); U8* data = image_raw->getData(); + + memset(data, 0, dim * dim * 3) ; + LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ; + +#if 1 + LLPointer imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT); + LLViewerFetchedTexture::sDefaultImagep = imagep; + for (S32 i = 0; i sNullImagep; // Null texture for non-textured objects. + static LLPointer sBlackImagep; // Texture to show NOTHING (pure black) }; -- cgit v1.2.3 From b5f1ee387848e56cb2cd42195056ff5cd7baa01e Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 16 Aug 2011 17:00:12 -0600 Subject: fix for SH-2023: Brightness Bump maps don't load when shadows are enabled --- indra/newview/lldrawpoolbump.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 6f71c54f79..eb78e28306 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1078,6 +1078,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText { src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ; src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL ); + src_image->forceToSaveRawImage(0) ; } } } -- cgit v1.2.3 From dfcc0849495d40459bce60d4eb754128d6ea53db Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Aug 2011 15:16:02 -0600 Subject: fix for SH-1142: HUD objects do not display bumpmaps when Lighting and Shadows are enabled. --- indra/newview/llspatialpartition.cpp | 9 +++++++++ indra/newview/llspatialpartition.h | 2 ++ indra/newview/llvovolume.cpp | 7 ++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index e23b431457..fd17781a2e 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -523,6 +523,11 @@ void LLSpatialGroup::clearDrawMap() mDrawMap.clear(); } +BOOL LLSpatialGroup::isHUDGroup() +{ + return mSpatialPartition && mSpatialPartition->isHUDPartition() ; +} + BOOL LLSpatialGroup::isRecentlyVisible() const { return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < LLDrawable::getMinVisFrameRange() ; @@ -4155,6 +4160,10 @@ void LLSpatialGroup::drawObjectBox(LLColor4 col) drawBox(mObjectBounds[0], size); } +bool LLSpatialPartition::isHUDPartition() +{ + return mPartitionType == LLViewerRegion::PARTITION_HUD ; +} BOOL LLSpatialPartition::isVisible(const LLVector3& v) { diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 54d5d36f6e..11955540c6 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -282,6 +282,7 @@ public: LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part); + BOOL isHUDGroup() ; BOOL isDead() { return isState(DEAD); } BOOL isState(U32 state) const; BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; } @@ -470,6 +471,7 @@ public: S32 cull(LLCamera &camera, std::vector* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum BOOL isVisible(const LLVector3& v); + bool isHUDPartition() ; virtual LLSpatialBridge* asBridge() { return NULL; } virtual BOOL isBridge() { return asBridge() != NULL; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index eb3ed3c379..528c7acbc8 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4490,6 +4490,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: std::sort(faces.begin(), faces.end(), LLFace::CompareDistanceGreater()); } + bool hud_group = group->isHUDGroup() ; std::vector::iterator face_iter = faces.begin(); LLSpatialGroup::buffer_map_t buffer_map; @@ -4760,7 +4761,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } - else if (LLPipeline::sRenderDeferred) + else if (LLPipeline::sRenderDeferred && !hud_group) { //deferred rendering if (te->getFullbright()) { //register in post deferred fullbright shiny pass @@ -4798,7 +4799,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: else if (fullbright || bake_sunlight) { //fullbright registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && !hud_group && LLPipeline::sRenderBump && te->getBumpmap()) { //if this is the deferred render and a bump map is present, register in post deferred bump registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); } @@ -4824,7 +4825,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 - if (!is_alpha && !LLPipeline::sRenderDeferred) + if (!is_alpha && (hud_group || !LLPipeline::sRenderDeferred)) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); facep->setPoolType((fullbright) ? LLDrawPool::POOL_FULLBRIGHT : LLDrawPool::POOL_SIMPLE); -- cgit v1.2.3 From c3327eba03972fdda60a14cc0125bb70298fd3da Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Aug 2011 15:33:18 -0600 Subject: fix for SH-1069: [REGRESSION] Sometimes bumpmaps load only partially --- indra/newview/lldrawpoolbump.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index eb78e28306..0742250b0b 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -155,6 +155,7 @@ void LLStandardBumpmap::addstandard() LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id)); gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setBoostLevel(LLViewerTexture::BOOST_BUMP) ; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL, NULL ); + gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->forceToSaveRawImage(0) ; LLStandardBumpmap::sStandardBumpmapCount++; } -- cgit v1.2.3 From fe46a8e012e41ca449096897e4f91551c467cd51 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 17 Aug 2011 18:12:25 -0600 Subject: fix for sh-2307: crash at LLImageGL::setCategory(int) line 1890 --- indra/llrender/llimagegl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 9ca3a23d52..4892a292cf 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1887,6 +1887,7 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) void LLImageGL::setCategory(S32 category) { +#if 0 //turn this off temporarily because it is not in use now. if(!gAuditTexture) { return ; @@ -1907,6 +1908,7 @@ void LLImageGL::setCategory(S32 category) mCategory = -1 ; } } +#endif } //for debug use -- cgit v1.2.3 From 24a0ec9286170bdcd7fd3989f223d4043c2a133d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 18 Aug 2011 17:12:35 -0600 Subject: fix for SH-2315: crash at LLVOCacheEntry::~LLVOCacheEntry() line 138 --- indra/newview/llviewerregion.cpp | 1 + indra/newview/llvocache.cpp | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index db2dc531db..17f908d73f 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1193,6 +1193,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec eCacheUpdateResult result = CACHE_UPDATE_ADDED; if (mImpl->mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES) { + delete mImpl->mCacheMap.begin()->second ; mImpl->mCacheMap.erase(mImpl->mCacheMap.begin()); result = CACHE_UPDATE_REPLACED; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index f0b5b50feb..6d457434b5 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -621,16 +621,20 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca S32 num_entries; success = check_read(&apr_file, &num_entries, sizeof(S32)) ; - for (S32 i = 0; success && i < num_entries; i++) + if(success) { - LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); - if (!entry->getLocalID()) + for (S32 i = 0; i < num_entries; i++) { - llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; - delete entry ; - success = false ; + LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); + if (!entry->getLocalID()) + { + llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; + delete entry ; + success = false ; + break ; + } + cache_entry_map[entry->getLocalID()] = entry; } - cache_entry_map[entry->getLocalID()] = entry; } } } -- cgit v1.2.3 From 428c762a3ea6caec277d915b8b175403cf3f52dd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 19 Aug 2011 13:27:51 -0600 Subject: fix for SH-1498: crash at LLImageGL::deleteDeadTextures() line 1429 --- indra/llrender/llimagegl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 4892a292cf..7188b0fa44 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1424,7 +1424,7 @@ void LLImageGL::deleteDeadTextures() { LLTexUnit* tex_unit = gGL.getTexUnit(i); - if (tex_unit->getCurrTexture() == tex) + if (tex_unit && tex_unit->getCurrTexture() == tex) { tex_unit->unbind(tex_unit->getCurrType()); stop_glerror(); -- cgit v1.2.3