Additional HTTP Texture tunining

* Important fix in lltexturefetch.cpp where a 'partial' resonse was incorrectly setting mHaveAllData.
meow-7.2.2
Steve Bennetts 2009-12-18 14:42:41 -08:00
parent 4d3a6fc8d1
commit 90548a46ce
4 changed files with 33 additions and 22 deletions

View File

@ -158,7 +158,7 @@ public:
void callbackHttpGet(const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer,
bool last_block, bool success);
bool partial, bool success);
void callbackCacheRead(bool success, LLImageFormatted* image,
S32 imagesize, BOOL islocal);
void callbackCacheWrite(bool success);
@ -316,7 +316,7 @@ public:
if (HTTP_OK <= status && status < HTTP_MULTIPLE_CHOICES)
{
success = true;
if (HTTP_PARTIAL_CONTENT == status) // partial information (i.e. last block)
if (HTTP_PARTIAL_CONTENT == status) // partial information
{
partial = true;
}
@ -882,8 +882,18 @@ bool LLTextureFetchWorker::doWork(S32 param)
++mHTTPFailCount;
if (mHTTPFailCount >= max_attempts)
{
resetFormattedData();
return true; // failed
if (cur_size > 0)
{
// Use available data
mLoadedDiscard = mFormattedImage->getDiscardLevel();
mState = DECODE_IMAGE;
return false;
}
else
{
resetFormattedData();
return true; // failed
}
}
else
{
@ -1207,7 +1217,7 @@ bool LLTextureFetchWorker::processSimulatorPackets()
void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer,
bool last_block, bool success)
bool partial, bool success)
{
LLMutexLock lock(&mWorkMutex);
@ -1236,7 +1246,7 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
mBuffer = new U8[data_size];
buffer->readAfter(channels.in(), NULL, mBuffer, data_size);
mBufferSize += data_size;
if (data_size < mRequestedSize || last_block == true)
if (data_size < mRequestedSize && mRequestedDiscard == 0)
{
mHaveAllData = TRUE;
}

View File

@ -412,7 +412,7 @@ void LLGLTexMemBar::draw()
F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ;
F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
S32 h_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
S32 v_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
//----------------------------------------------------------------------------
LLGLSUIDefault gls_ui;
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
@ -428,14 +428,14 @@ void LLGLTexMemBar::draw()
cache_usage, cache_max_usage);
//, cache_entries, cache_max_entries
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*3,
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
//----------------------------------------------------------------------------
#if 0
S32 bar_left = 400;
S32 bar_width = 200;
S32 top = line_height*3 - 2 + h_offset;
S32 top = line_height*3 - 2 + v_offset;
S32 bottom = top - 6;
S32 left = bar_left;
S32 right = left + bar_width;
@ -494,18 +494,18 @@ void LLGLTexMemBar::draw()
#endif
//----------------------------------------------------------------------------
text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d RAW:%d HTP:%d CRE:%d",
text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d",
gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(),
LLAppViewer::getImageDecodeThread()->getPending(),
LLImageRaw::sRawImageCount,
LLAppViewer::getTextureFetch()->getNumHTTPRequests(),
LLAppViewer::getImageDecodeThread()->getPending(),
gTextureList.mCreateTextureList.size());
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*2,
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*2,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
@ -515,40 +515,40 @@ void LLGLTexMemBar::draw()
color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;
color[VALPHA] = text_color[VALPHA];
text = llformat("BW:%.0f/%.0f",bandwidth, max_bandwidth);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, line_height*2,
LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, v_offset + line_height*2,
color, LLFontGL::LEFT, LLFontGL::TOP);
S32 dx1 = 0;
if (LLAppViewer::getTextureFetch()->mDebugPause)
{
LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
dx1 += 8;
}
if (mTextureView->mFreezeView)
{
LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
dx1 += 8;
}
if (mTextureView->mOrderFetch)
{
LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
else
{
LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, h_offset + line_height,
LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}

View File

@ -713,7 +713,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first.
F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time
max_image_decode_time = llclamp(max_image_decode_time, 0.001f, 0.005f ); // min 1ms/frame, max 5ms/frame)
max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame)
gTextureList.updateImages(max_image_decode_time);
//remove dead textures from GL

View File

@ -1497,7 +1497,8 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
{
priority += 10000000.f;
}
else if(mAdditionalDecodePriority > 0.0f)
if(mAdditionalDecodePriority > 0.0f)
{
// 1-9
S32 additional_priority = (S32)(1.0f + mAdditionalDecodePriority*8.0f + .5f); // round