SH-3041 WIP Utilizing early object update texture data

Caching the mapping between baked texture hashes and UUIDs should be
able to be avoided if the initial texture data sent down is accuate.

This patch will use the first objectupdate message sent for your own
avatar to set the baked texture UUIDs for your avatar. These appear
to match the UUIDs sent from the hash lookup.

Testing needed to verify that you can successfully decloud before
the server sends you the hash lookup response, if your bakes are
cached locally.
meow-7.2.2
Nyx (Neal Orman) 2012-03-21 17:51:30 -04:00
parent c36acfdc83
commit 1731894cb4
2 changed files with 60 additions and 1 deletions

View File

@ -163,7 +163,8 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id,
LLVOAvatar(id, pcode, regionp),
mScreenp(NULL),
mLastRegionHandle(0),
mRegionCrossingCount(0)
mRegionCrossingCount(0),
mInitialBakesLoaded(false)
{
gAgentWearables.setAvatarObject(this);
@ -196,6 +197,7 @@ void LLVOAvatarSelf::initInstance()
{
mDebugBakedTextureTimes[i][0] = -1.0f;
mDebugBakedTextureTimes[i][1] = -1.0f;
mInitialBakeIDs[i] = LLUUID::null;
}
status &= buildMenus();
@ -794,6 +796,39 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
}
}
//virtual
U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
const EObjectUpdateType update_type,
LLDataPacker *dp)
{
U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp);
if (mInitialBakesLoaded == false && retval == 0x0)
{
// call update textures to force the images to be created
updateMeshTextures();
// unpack the texture UUIDs to the texture slots
retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
// need to trigger a few operations to get the avatar to use the new bakes
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
const LLVOAvatarDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex;
LLUUID texture_id = getTEImage(te)->getID();
setNewBakedTexture(te, texture_id);
mInitialBakeIDs[i] = texture_id;
}
mInitialBakesLoaded = true;
}
return retval;
}
void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index)
{
if (te >= TEX_NUM_INDICES)
@ -2469,6 +2504,18 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid
{
if ( mBakedTextureDatas[i].mTextureIndex == te && mBakedTextureDatas[i].mTexLayerSet)
{
if (mInitialBakeIDs[i] != LLUUID::null)
{
if (mInitialBakeIDs[i] == uuid)
{
llinfos << "baked texture correctly loaded at login! " << i << llendl;
}
else
{
llwarns << "baked texture does not match id loaded at login!" << i << llendl;
}
mInitialBakeIDs[i] = LLUUID::null;
}
mBakedTextureDatas[i].mTexLayerSet->cancelUpload();
}
}

View File

@ -93,15 +93,27 @@ public:
/*virtual*/ void updateVisualParams();
/*virtual*/ void idleUpdateAppearanceAnimation();
/*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
const EObjectUpdateType update_type,
LLDataPacker *dp);
private:
// helper function. Passed in param is assumed to be in avatar's parameter list.
BOOL setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL upload_bake = FALSE );
/** Initialization
** **
*******************************************************************************/
private:
LLUUID mInitialBakeIDs[6];
bool mInitialBakesLoaded;
/********************************************************************************
** **
** STATE