summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-06-02 17:30:34 -0400
committerLoren Shih <seraph@lindenlab.com>2010-06-02 17:30:34 -0400
commit609c389b899f3924f070dea384337bec4da0f2f4 (patch)
tree3ef29a1782bbc93462cd5c7c98aba3001087f60c /indra/newview/lltexlayer.cpp
parentb1514dc19108320fa7d9ecb2879c96bcdc401605 (diff)
EXT-7526 WIP Add baked texture information to texture view
EXT-7504 WIP Force decloud after timeout using lower res textures Better formatting for baked texture information. Also added exponential timeout for sending low res baked textures.
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r--indra/newview/lltexlayer.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 0c3c052fe3..8798cae7ac 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -87,7 +87,7 @@ LLTexLayerSetBuffer::LLTexLayerSetBuffer(LLTexLayerSet* const owner,
mNeedsUpdate(TRUE),
mNeedsUpload(FALSE),
mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates
- mDebugNumLowresUploads(0),
+ mNumLowresUploads(0),
mTexLayerSet(owner)
{
LLTexLayerSetBuffer::sGLByteCount += getSize();
@@ -141,12 +141,12 @@ void LLTexLayerSetBuffer::requestUpload()
// If we requested a new upload but haven't even uploaded
// a low res version of our last upload request, then
// keep the timer ticking instead of resetting it.
- if (mNeedsUpload && (mDebugNumLowresUploads == 0))
+ if (mNeedsUpload && (mNumLowresUploads == 0))
{
mNeedsUploadTimer.reset();
}
mNeedsUpload = TRUE;
- mDebugNumLowresUploads = 0;
+ mNumLowresUploads = 0;
mUploadPending = TRUE;
mNeedsUploadTimer.unpause();
}
@@ -289,8 +289,12 @@ BOOL LLTexLayerSetBuffer::isReadyToUpload() const
const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureTimeout");
if (texture_timeout)
{
+ // The timeout period increases exponentially between every lowres upload in order to prevent
+ // spamming the server with frequent uploads.
+ const U32 texture_timeout_threshold = texture_timeout*pow((F32)2.0,(F32)mNumLowresUploads);
+
// If we hit our timeout and have textures available at even lower resolution, then upload.
- const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout;
+ const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout_threshold;
const BOOL has_lower_lod = mTexLayerSet->isLocalTextureDataAvailable();
if (has_lower_lod && is_upload_textures_timeout) return TRUE;
}
@@ -443,7 +447,7 @@ void LLTexLayerSetBuffer::readBackAndUpload()
{
// Sending a lower level LOD for the baked texture.
// Restart the upload timer.
- mDebugNumLowresUploads++;
+ mNumLowresUploads++;
mNeedsUploadTimer.unpause();
mNeedsUploadTimer.reset();
}
@@ -2241,7 +2245,7 @@ const std::string LLTexLayerSetBuffer::dumpTextureInfo() const
if (!isAgentAvatarValid()) return "";
const BOOL is_high_res = !mNeedsUpload;
- const U32 num_low_res = mDebugNumLowresUploads;
+ const U32 num_low_res = mNumLowresUploads;
const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32();
const BOOL is_uploaded = !mUploadPending;
const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(mTexLayerSet);