Texfetch/cache changes:

Added SEND_UDP_REQ and	WAIT_UDP_REQ fetch states.
Parse 'content-range' from headers.
Purge 'complete' textures from the cache if they lack 'end of codestream' marker.
Added boostlevel/category to textureview display.
More diagnostic output.
Discard handling tweaks/bugfixes from v3.
This commit is contained in:
Shyotl
2013-09-23 17:19:44 -05:00
parent 55f43c5fcd
commit c47f6405d2
8 changed files with 612 additions and 235 deletions

View File

@@ -133,6 +133,26 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
parameters.cp_reduce = base.getRawDiscardLevel();
if(parameters.cp_reduce == 0 && *(U16*)(base.getData() + base.getDataSize() - 2) != 0xD9FF)
{
bool failed = true;
for(S32 i = base.getDataSize()-1; i > 42; --i)
{
if(base.getData()[i] != 0x00)
{
failed = *(U16*)(base.getData()+i-1) != 0xD9FF;
break;
}
}
if(failed)
{
opj_image_destroy(image);
base.decodeFailed();
return TRUE;
}
}
/* decode the code-stream */
/* ---------------------- */
@@ -212,7 +232,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
if(image->numcomps <= first_channel)
{
llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl;
LL_WARNS("Texture") << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl;
if (image)
{
opj_image_destroy(image);