summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2012-08-14 17:12:01 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2012-08-14 17:12:01 -0400
commite7a63cb356d49925131edfadb5a0e8d5368a9096 (patch)
treeece9740eed4327ac6145668919d44761621a0bd6
parent020980fb4cd5f2cc18b56fa795c08c153a15bd4a (diff)
SH-3310 WIP setting up architecture for switching texture baking on per-region basis
Set up an architecture to minimize the use of the baked texture debug setting. Instead concentrating on setting a per-region flag at the region handshake point. This should be processed once the new regions are using the updated handshake. The debug setting is being used in this one location as a placeholder. Builds, but not fully tested/commented yet, passing this work off to Vir.
-rwxr-xr-xindra/newview/llagent.cpp2
-rwxr-xr-xindra/newview/llagentwearables.cpp2
-rwxr-xr-xindra/newview/llappearancemgr.cpp10
-rwxr-xr-xindra/newview/llappearancemgr.h2
-rw-r--r--indra/newview/llviewerregion.cpp12
-rw-r--r--indra/newview/llviewerregion.h3
-rwxr-xr-xindra/newview/llvoavatar.cpp4
-rwxr-xr-xindra/newview/llvoavatar.h7
-rwxr-xr-xindra/newview/llvoavatarself.cpp24
-rwxr-xr-xindra/newview/llvoavatarself.h1
10 files changed, 32 insertions, 35 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f99065aa08..35280d5b5f 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3772,7 +3772,7 @@ void LLAgent::requestLeaveGodMode()
//-----------------------------------------------------------------------------
void LLAgent::sendAgentSetAppearance()
{
- if (!isAgentAvatarValid() || LLAppearanceMgr::instance().useServerTextureBaking()) return;
+ if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && gAgentAvatarp->isUsingBakedTextures()))
{
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 0a721312f3..e44b27c6af 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1597,7 +1597,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* n
void LLAgentWearables::queryWearableCache()
{
- if (!areWearablesLoaded() || LLAppearanceMgr::instance().useServerTextureBaking())
+ if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()))
{
return;
}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index e27a21f7fd..237cc0b9f3 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1743,7 +1743,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
updateIsDirty();
// Send server request for appearance update
- if (useServerTextureBaking())
+ if (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())
{
requestServerAppearanceUpdate();
}
@@ -2599,14 +2599,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base
if (inventory_changed) gInventory.notifyObservers();
}
-// Should be true iff both the appropriate debug setting is enabled
-// and the corresponding cap has been found.
-bool LLAppearanceMgr::useServerTextureBaking()
-{
- // TODO: add cap check.
- return gSavedSettings.getBOOL("UseServerTextureBaking");
-}
-
class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder
{
public:
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 45291419c7..742833211a 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -185,8 +185,6 @@ public:
bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; }
- bool useServerTextureBaking();
-
void requestServerAppearanceUpdate();
protected:
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 777475fe61..18f8e4e101 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1424,6 +1424,18 @@ void LLViewerRegion::unpackRegionHandshake()
mProductName = productName;
}
+
+ mCentralBakeVersion = (S32)gSavedSettings.getBOOL("UseServerTextureBaking");
+ /*
+ if (msg->getSize("RegionInfo4", "CentralBakesVersion") > 0)
+ {
+ msg->getS32("RegionInfo4", "CentralBakesVersion", mCentralBakeVersion);
+ }
+ else
+ {
+ mCentralBakeVersion = 0;
+ }
+ */
LLVLComposition *compp = getComposition();
if (compp)
{
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index c483c6ef52..2428f56db4 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -277,6 +277,8 @@ public:
F32 getLandHeightRegion(const LLVector3& region_pos);
+ U8 getCentralBakeVersion() { return mCentralBakeVersion; }
+
void getInfo(LLSD& info);
bool meshRezEnabled() const;
@@ -390,6 +392,7 @@ private:
F32 mBillableFactor;
U32 mMaxTasks; // max prim count
F32 mCameraDistanceSquared; // updated once per frame
+ U8 mCentralBakeVersion;
// Information for Homestead / CR-53
S32 mClassID;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 45c7a59b24..66674d8c19 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4727,7 +4727,7 @@ void LLVOAvatar::setTexEntry(const U8 index, const LLTextureEntry &te)
const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
{
std::string url = "";
- if (LLAppearanceMgr::instance().useServerTextureBaking() && !gSavedSettings.getString("AgentAppearanceServiceURL").empty())
+ if (mUseServerBakes && !gSavedSettings.getString("AgentAppearanceServiceURL").empty())
{
const LLVOAvatarDictionary::TextureEntry* texture_entry = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)te);
if (texture_entry != NULL)
@@ -7312,7 +7312,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if( isSelf() )
{
llwarns << avString() << "Received AvatarAppearance for self" << llendl;
- if( mFirstTEMessageReceived && !LLAppearanceMgr::instance().useServerTextureBaking())
+ if( mFirstTEMessageReceived && !mUseServerBakes)
{
// llinfos << "processAvatarAppearance end " << mID << llendl;
return;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 4283c0e017..15f3721c73 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -696,13 +696,14 @@ public:
//--------------------------------------------------------------------
public:
BOOL getIsAppearanceAnimating() const { return mAppearanceAnimating; }
+ BOOL isUsingBakedTextures() const { return mUseServerBakes; } // e.g. false if in appearance edit mode
private:
BOOL mAppearanceAnimating;
LLFrameTimer mAppearanceMorphTimer;
F32 mLastAppearanceBlendTime;
- BOOL mIsEditingAppearance;
- BOOL mUseLocalAppearance;
- BOOL mUseServerBakes;
+ BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode
+ BOOL mUseLocalAppearance; // flag for if we're using a local composite
+ BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads)
//--------------------------------------------------------------------
// Clothing colors (convenience functions to access visual parameters)
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index e715a0d2f1..c5eb96e740 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -887,7 +887,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE);
}
updateMeshTextures();
- if (!LLAppearanceMgr::instance().useServerTextureBaking())
+ if (getRegion() && !getRegion()->getCentralBakeVersion())
{
requestLayerSetUploads();
}
@@ -1633,7 +1633,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r
layerset->requestUpdate();
layerset->invalidateMorphMasks();
- if( upload_result && !LLAppearanceMgr::instance().useServerTextureBaking())
+ if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion()))
{
llassert(isSelf());
@@ -2616,15 +2616,6 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**)
}
}
-BOOL LLVOAvatarSelf::isUsingBakedTextures() const
-{
- // Composite textures are used during appearance mode.
- if (gAgentCamera.cameraCustomizeAvatar())
- return FALSE;
-
- return TRUE;
-}
-
void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug)
{
@@ -2725,14 +2716,15 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
// static
void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
{
- gAgentAvatarp->mIsEditingAppearance = false;
- if (!LLAppearanceMgr::instance().useServerTextureBaking())
- {
- gAgentAvatarp->mUseLocalAppearance = false;
- }
if (isAgentAvatarValid())
{
+ gAgentAvatarp->mIsEditingAppearance = false;
+ if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion())
+ {
+ gAgentAvatarp->mUseLocalAppearance = false;
+ }
+
gAgentAvatarp->invalidateAll();
if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch)
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 5354f18679..c8f8b3791a 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -229,7 +229,6 @@ public:
void setCachedBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid);
void forceBakeAllTextures(bool slam_for_debug = false);
static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
- BOOL isUsingBakedTextures() const; // e.g. false if in appearance edit mode
protected:
/*virtual*/ void removeMissingBakedTextures();