From 39d59396d94885f2f693fff9f58a3d4a865f0d33 Mon Sep 17 00:00:00 2001 From: Beq Date: Sat, 11 Jan 2020 21:12:10 +0000 Subject: [PATCH] BOM for OS replace static LLVOAvatar sMaxBakes with region based maxBakes() Add additional guard on skirt rendering member varts mMaxBakes and mMaxTEs on voregion OPENSIM only drive maxBakes/TEs from Sim features move rebake required detection out of voavatar, to avatartself ADDITIONAL: prevent sending of skirt bake when not required --- indra/newview/llagent.cpp | 18 ++++-- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llviewerregion.cpp | 26 ++++++++ indra/newview/llviewerregion.h | 5 +- indra/newview/llviewertexlayer.cpp | 4 +- indra/newview/llviewerwearable.cpp | 4 +- indra/newview/llvoavatar.cpp | 98 +++++++++++++++++++----------- indra/newview/llvoavatar.h | 5 +- indra/newview/llvoavatarself.cpp | 48 +++++++++++++-- indra/newview/llvoavatarself.h | 2 +- 10 files changed, 156 insertions(+), 56 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 76a582f936..e5f4ef0518 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -38,6 +38,7 @@ #include "llagentui.h" #include "llappearancemgr.h" #include "llanimationstates.h" +#include "llavatarappearancedefines.h" #include "llcallingcard.h" #include "llchannelmanager.h" #include "llchicletbar.h" @@ -5540,10 +5541,7 @@ LLAgentQueryManager::LLAgentQueryManager() : mNumPendingQueries(0), mUpdateSerialNum(0) { - // BOM fallback legacy opensim - // for (U32 i = 0; i < BAKED_NUM_INDICES; i++) - for (U32 i = 0; i < LLVOAvatar::sMaxBakes; i++) - // + for (U32 i = 0; i < BAKED_NUM_INDICES; i++) { mActiveCacheQueries[i] = 0; } @@ -5952,7 +5950,7 @@ void LLAgent::sendAgentSetAppearance() BOOL textures_current = gAgentAvatarp->areTexturesCurrent(); // BOM fallback legacy opensim // for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ ) - for(U8 baked_index = 0; baked_index < LLVOAvatar::sMaxBakes; baked_index++ ) + for(U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++ ) // { const ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); @@ -5988,7 +5986,7 @@ void LLAgent::sendAgentSetAppearance() LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; // BOM fallback for legacy opensim // for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - for (U8 baked_index = 0; baked_index < LLVOAvatar::sMaxBakes; baked_index++) + for (U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++) // { BOOL generate_valid_hash = TRUE; @@ -5997,6 +5995,13 @@ void LLAgent::sendAgentSetAppearance() generate_valid_hash = FALSE; LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; } + // Exclude BAKED_SKIRT from being sent if no skirt is worn (should only reach here if it were already baked) + if (baked_index == BAKED_SKIRT && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) + { + LL_DEBUGS("Avatar") << "Not caching baked texture for unworn skirt." << LL_ENDL; + generate_valid_hash = FALSE; + } + // const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); if (hash.notNull()) @@ -6008,6 +6013,7 @@ void LLAgent::sendAgentSetAppearance() } } msg->nextBlockFast(_PREHASH_ObjectData); + // gAgentAvatarp->dumpAvatarTEs("sendAppearance"); // useful when debugging appeanrce updates gAgentAvatarp->sendAppearanceMessage( gMessageSystem ); } else diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f174642f20..07934ba528 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2142,7 +2142,7 @@ void LLAgentWearables::queryWearableCache() S32 num_queries = 0; // BOM fallback for legacy opensim // for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - for (U8 baked_index = 0; baked_index < LLVOAvatar::sMaxBakes; baked_index++) + for (U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++) // { LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index a1591b21a3..603beffd4b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -46,6 +46,7 @@ #include "llagentcamera.h" #include "llappviewer.h" #include "llavatarrenderinfoaccountant.h" +#include "llavatarappearancedefines.h" #include "llcallingcard.h" #include "llcommandhandler.h" #include "lldir.h" @@ -580,6 +581,14 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mPaused(FALSE), mRegionCacheHitCount(0), mRegionCacheMissCount(0), +// BOM tests for OS + mMaxBakes(LLGridManager::getInstance()->isInSecondLife()? + LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES: + LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_LEFT_ARM), + mMaxTEs(LLGridManager::getInstance()->isInSecondLife()? + LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES: + LLAvatarAppearanceDefines::ETextureIndex::TEX_HEAD_UNIVERSAL_TATTOO), +// // Aurora Sim mWidth(region_width_meters), mWidthScaleFactor(region_width_meters / REGION_WIDTH_METERS) // FIRE-19563: Scaling for OpenSim VarRegions @@ -2411,6 +2420,23 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) } #endif // OPENSIM // +// limit num bakes by region support +#ifdef OPENSIM + if (mSimulatorFeatures.has("BakesOnMeshEnabled") && (mSimulatorFeatures["BakesOnMeshEnabled"].asBoolean()==true)) + { + mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES; + mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES; + } + else + { + mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_LEFT_ARM; + mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_HEAD_UNIVERSAL_TATTOO; + } +#else + mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES; + mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES; +#endif // OPENSIM +// } //this is called when the parent is not cacheable. diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 3e807eabff..61042c59a9 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -242,6 +242,8 @@ public: F32 getWidth() const { return mWidth; } F32 getWidthScaleFactor() const { return mWidthScaleFactor; } // FIRE-19563: Scaling for OpenSim VarRegions + S32 getRegionMaxBakes() const { return mMaxBakes; } // FS BOM for OS max bakes restriction + S32 getRegionMaxTEs() const { return mMaxTEs; } // FS BOM for OS max TEs restriction void idleUpdate(F32 max_update_time); void lightIdleUpdate(); bool addVisibleGroup(LLViewerOctreeGroup* group); @@ -503,7 +505,8 @@ private: F32 mTimeDilation; // time dilation of physics simulation on simulator S32 mLastUpdate; //last time called idleUpdate() F32 mWidthScaleFactor; // FIRE-19563: Scaling for OpenSim VarRegions - + S32 mMaxBakes; // store max bakes on the region + S32 mMaxTEs; // store max bakes on the region // simulator name std::string mName; std::string mZoning; diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 94fdce456f..d5ccb841da 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -209,8 +209,9 @@ void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success) { // OpenSim BOM fallback // layer_set->getAvatar()->debugBakedTextureUpload(layer_set->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish. + // doUpload(); auto bakedTexIdx = layer_set->getBakedTexIndex(); - if(bakedTexIdx <= LLVOAvatar::sMaxBakes) + if(bakedTexIdx <= layer_set->getAvatar()->getNumBakes()) { layer_set->getAvatar()->debugBakedTextureUpload(bakedTexIdx, FALSE); // FALSE for start of upload, TRUE for finish. doUpload(); @@ -219,6 +220,7 @@ void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success) { LL_DEBUGS("Avatar") << "Skipping bake for unsupported layer on this region" << LL_ENDL; } + // } else { diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index a9eb4df746..2a1d4972bd 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -51,7 +51,7 @@ public: { // OpenSim BOM fallback // U32 num_bakes = (U32) LLAvatarAppearanceDefines::BAKED_NUM_INDICES; - U32 num_bakes = (U32) LLVOAvatar::sMaxBakes; + U32 num_bakes = (U32) gAgentAvatarp->getNumBakes(); // for( U32 index = 0; index < num_bakes; ++index ) { @@ -64,7 +64,7 @@ public: { // OpenSim BOM fallback // U32 num_bakes = (U32) LLAvatarAppearanceDefines::BAKED_NUM_INDICES; - U32 num_bakes = (U32) LLVOAvatar::sMaxBakes; + U32 num_bakes = (U32) gAgentAvatarp->getNumBakes(); // for( U32 index = 0; index < num_bakes; ++index ) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e65898f014..d190d01084 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -624,9 +624,6 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; -// BOM bake limits -S32 LLVOAvatar::sMaxBakes; -// //----------------------------------------------------------------------------- // Helper functions //----------------------------------------------------------------------------- @@ -737,12 +734,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mImpostorDistance = 0; mImpostorPixelArea = 0; - // BOM constrain number of bake requests when BOM not supported - // BAKED_LEFT_ARM is equal to the pre-BOM BAKED_NUM_INDICES - sMaxBakes = gAgent.getRegion()->bakesOnMeshEnabled()?BAKED_NUM_INDICES:BAKED_LEFT_ARM; - // setNumTEs(TEX_NUM_INDICES); - mbCanSelect = TRUE; mSignaledAnimations.clear(); @@ -783,6 +775,47 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisuallyMuteSetting = FSAvatarRenderPersistence::instance().getAvatarRenderSettings(id); } +// BOM constrain number of bake requests when BOM not supported +S32 LLVOAvatar::getNumBakes() const +{ +#ifdef OPENSIM + // BAKED_LEFT_ARM is equal to the pre-BOM BAKED_NUM_INDICES + if(getRegion()) + { + // LL_INFOS("BOMOS") + // << getFullname() + // << "Using avatar region settings [" << getRegion()->getName() << "]" + // << " bakesOnMesh = " << static_cast(getRegion()->bakesOnMeshEnabled()?"True":"False") + // << LL_ENDL; + return getRegion()->getRegionMaxBakes(); + } + // LL_INFOS("BOMOS") + // << " Using fallback settings" + // << " bakesOnMesh = " << static_cast(LLGridManager::instance().isInSecondLife()?"True":"False") + // << LL_ENDL; + // fallback, in SL assume BOM, elsewhere assume not. + return LLGridManager::instance().isInSecondLife()?BAKED_NUM_INDICES:BAKED_LEFT_ARM; +#else + return BAKED_NUM_INDICES; +#endif +} + +// U8 LLVOAvatar::getNumTEs() const +// { +// #ifdef OPENSIM +// // TEX_HEAD_UNIVERSAL_TATTOO is equal to the pre-BOM TEX_NUM_INDICES +// if(!mTEImages){return 0;} +// if(getRegion()) +// { +// return getRegion()->getRegionMaxTEs(); +// } +// // fallback, in SL assume BOM, elsewhere assume not. +// return LLGridManager::instance().isInSecondLife()?TEX_NUM_INDICES:TEX_HEAD_UNIVERSAL_TATTOO; +// #else +// return TEX_NUM_INDICES; +// #endif +// } +// std::string LLVOAvatar::avString() const { if (isControlAvatar()) @@ -870,8 +903,9 @@ BOOL LLVOAvatar::isFullyBaked() { if (mIsDummy) return TRUE; if (getNumTEs() == 0) return FALSE; - - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + // OS BOM limit the tests to avoid "invalid face error" + // for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + for (U32 i = 0; i < getNumBakes(); i++) { if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)) @@ -9000,7 +9034,9 @@ void LLVOAvatar::updateMeshTextures() mBakedTextureDebugText += llformat("%06d\n",update_counter++); mBakedTextureDebugText += "indx layerset linvld ltda ilb ulkg ltid\n"; - for (U32 i=0; i < mBakedTextureDatas.size(); i++) + // BOM OS + // for (U32 i=0; i < mBakedTextureDatas.size(); i++) + for (U32 i=0; i < getNumBakes(); i++) { is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); LLViewerTexLayerSet* layerset = NULL; @@ -9048,8 +9084,10 @@ void LLVOAvatar::updateMeshTextures() use_lkg_baked_layer[i], last_id_string.c_str()); } - - for (U32 i=0; i < mBakedTextureDatas.size(); i++) + // BOM OS + // for (U32 i=0; i < mBakedTextureDatas.size(); i++) + for (U32 i=0; i < getNumBakes(); i++) + // { debugColorizeSubMeshes(i, LLColor4::white); @@ -9329,7 +9367,7 @@ void LLVOAvatar::releaseComponentTextures() // BOM constrain number of bake requests when BOM not supported // for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - for (U8 baked_index = 0; baked_index < sMaxBakes; baked_index++) + for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++) // { const LLAvatarAppearanceDictionary::BakedEntry * bakedDicEntry = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); @@ -9912,7 +9950,12 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte // prevent the overwriting of valid baked textures with invalid baked textures for (U8 baked_index = 0; baked_index < mBakedTextureDatas.size(); baked_index++) { - if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) + // refactor a little to help debug + // if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) + auto isDefined = isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex); + LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " textureDefined= " << isDefined << LL_ENDL; + if (!isDefined + // && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT && baked_index != BAKED_LEFT_ARM && baked_index != BAKED_LEFT_LEG && baked_index != BAKED_AUX1 && baked_index != BAKED_AUX2 && baked_index != BAKED_AUX3) { @@ -9937,8 +9980,8 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; - //LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID - // << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; + // LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID + // << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; if (is_first_appearance_message ) { @@ -10066,7 +10109,7 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) // BOM constrain number of bake requests when BOM not supported // prior to BOM BAKES beyond BAKED_HAIR were not supported. // if (te < 0 || te >= BAKED_NUM_INDICES) - if (te < 0 || te >= sMaxBakes) + if (te < 0 || te >= getNumBakes()) // { return NULL; @@ -10768,23 +10811,6 @@ void LLVOAvatar::removeMissingBakedTextures() //virtual void LLVOAvatar::updateRegion(LLViewerRegion *regionp) { - // BOM constrain number of bake requests when BOM not supported, - // TEX_HEAD_TATTOO and BAKED_LEFT_ARM are the first new entries - - sMaxBakes = gAgent.getRegion()->bakesOnMeshEnabled()?BAKED_NUM_INDICES:BAKED_LEFT_ARM; - - if(!gSavedSettings.getBOOL("CurrentlyUsingBakesOnMesh") != getRegion()->bakesOnMeshEnabled()) - { - // force a rebake when the last grid we were on (including previous login) had different BOM support - // This replicates forceAppearanceUpdate rather than pulling in the whole of llavatarself. - if(!LLGridManager::instance().isInSecondLife()) - { - doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.0); - } - // update the setting even if we are in SL so that switch SL to OS and back - gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", getRegion()->bakesOnMeshEnabled()); - } - // LLViewerObject::updateRegion(regionp); } @@ -11441,7 +11467,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() hud_complexity_list_t hud_complexity_list; // BOM constrain number of bake requests when BOM not supported // for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - for (U8 baked_index = 0; baked_index < sMaxBakes; baked_index++) + for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++) // { const LLAvatarAppearanceDictionary::BakedEntry *baked_dict diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 9652b8c83a..26e4e9df72 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -346,9 +346,6 @@ public: static BOOL sJointDebug; // output total number of joints being touched for each avatar static BOOL sDebugAvatarRotation; static LLPartSysData sCloud; - // BOM bake limits - static S32 sMaxBakes; - // //-------------------------------------------------------------------- // Region state @@ -368,6 +365,8 @@ public: BOOL hasGray() const; S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded. void updateRezzedStatusTimers(S32 status); + S32 getNumBakes() const;// BOM bake limits + // U8 getNumTEs() const override;// BOM bake limits S32 mLastRezzedStatus; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index addd464cfe..70a0115f73 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1258,11 +1258,32 @@ void LLVOAvatarSelf::removeMissingBakedTextures() // [Legacy Bake] } } +// Check whether the BOM capability is different to last time we changed region (even across login) +void LLVOAvatarSelf::checkBOMRebakeRequired() +{ + if(!getRegion()) + { + auto newBOMStatus = getRegion()->bakesOnMeshEnabled(); + if(!gSavedSettings.getBOOL("CurrentlyUsingBakesOnMesh") != newBOMStatus) + { + // force a rebake when the last grid we were on (including previous login) had different BOM support + // This replicates forceAppearanceUpdate rather than pulling in the whole of llavatarself. + if(!LLGridManager::instance().isInSecondLife()) + { + doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.0); + } + // update the setting even if we are in SL so that switch SL to OS and back + gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", newBOMStatus); + } + } +} +// void LLVOAvatarSelf::onSimulatorFeaturesReceived(const LLUUID& region_id) { LL_INFOS("Avatar") << "simulator features received, setting hover based on region props" << LL_ENDL; setHoverIfRegionEnabled(); + checkBOMRebakeRequired();// BOM we may have stale cache, rebake may be needed } //virtual @@ -1289,6 +1310,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (regionp->simulatorFeaturesReceived()) { setHoverIfRegionEnabled(); + checkBOMRebakeRequired();// BOM we may have stale cache, rebake may be needed } else { @@ -3186,7 +3208,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) return mHeadLayerSet; */ // BOM fallback support for OpenSim legacy // if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES) - if (baked_index >= 0 && baked_index < LLVOAvatar::sMaxBakes) + if (baked_index >= 0 && baked_index < getNumBakes()) // { return getTexLayerSet(baked_index); @@ -3278,7 +3300,18 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { const ETextureIndex index = iter->first; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - if (!texture_dict->mIsBakedTexture) + // hide the surplus bakes and universals from non-BOM + // if (!texture_dict->mIsBakedTexture) + if( (index == TEX_SKIRT || index == TEX_SKIRT_TATTOO) && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT) ) + { + // TODO(BEQ): combine this with clause below once proven it works. + LL_DEBUGS("Avatar") << "Ignoring skirt related texture at index=" << index << LL_ENDL; + LLTextureEntry &entry = getTEref((U8) index); + texture_id[index] = entry.getID(); + entry.setID(IMG_DEFAULT_AVATAR); + } + if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs()) + // { LLTextureEntry &entry = getTEref((U8) index); texture_id[index] = entry.getID(); @@ -3311,7 +3344,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const //} // - + bool success = packTEMessage(mesgsys); // unpack TEs to make sure we don't re-trigger a bake @@ -3321,7 +3354,10 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { const ETextureIndex index = iter->first; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - if (!texture_dict->mIsBakedTexture) + // hide the surplus bakes and universals from non-BOM + // if (!texture_dict->mIsBakedTexture) + if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs()) + // { LLTextureEntry &entry = getTEref((U8) index); entry.setID(texture_id[index]); @@ -3513,7 +3549,9 @@ void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedText // virtual bool LLVOAvatarSelf::hasPendingBakedUploads() const { - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + // BOMOS constrain uploads for non-BOM. + // for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + for (U32 i = 0; i < getNumBakes(); i++) { LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending()) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index dc359e65fc..417f067a75 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -449,7 +449,7 @@ private: F32 mDebugTextureLoadTimes[LLAvatarAppearanceDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - + void checkBOMRebakeRequired(); void appearanceChangeMetricsCoro(std::string url); bool mInitialMetric; S32 mMetricSequence;