When saving textures to the fast cache, which only supports 16x16 textures at 4 bytes per pixel, the system will force scale down textures to fit, even beyond the allowed MAX_DISCARD_LEVEL, such as 1024x1024 having Discard = 6 and 2048x2048 texture having Discard = 7 and writing it to the headers.
Updated the readFromFastCache to expand invalid textures to be at the MAX_DISCARD_LEVEL(5) discard instead of at 6, 7 or 8. Scale up the 16x16 textures to match the requirements for the textures at MAX_DISCARD_LEVEL.
Mostly for re-loading after high bias scenario as these can cause crashes in the KDU decoder codebase. Which can possibly lead to deadlocked threads as well as bad textures clogging up the fetch system.
Example Firestorm.log output of the error in action.
2025-02-21T13:47:43Z INFO LLKDUMessage::put_text : KDU Error: Attempting to access a non-existent resolution level within some tile-component. Problem almost certainly caused by trying to discard more resolution levels than the number of DWT levels used to compress a tile-component.
Exception thrown at 0x00007FFA77A1BB0A in firestorm-bin.exe: Microsoft C++ exception: boost::wrapexcept<`anonymous namespace'::KDUError> at memory location 0x000000C3985FF470.
2025-02-21T13:47:43Z WARNING LLTextureFetchWorker::callbackDecoded : DECODE FAILED: 0c699ab7-dd72-bfc9-d695-267e1a3f936a Discard: 6, reason: LLKDUMessageError::flush()
2025-02-21T13:47:43Z WARNING _ll_apr_warn_status : APR: firestorm\phoenix-firestorm-foreverfps\indra\llcommon\llapr.cpp:651 The system cannot find the file specified.
2025-02-21T13:47:43Z WARNING LLAPRFile::remove : Attempting to remove filename: AppData\Local\FirestormOS_x64\texturecache\0\0c699ab7-dd72-bfc9-d695-267e1a3f936a.texture
2025-02-21T13:47:43Z INFO LLKDUMessage::put_text : KDU Error: Kakadu Core Error:
Added to the llgltexture a second boost level which will be used to properly restore the boost level after an object is right clicked on as the BOOST_SELECTED code does not restore the value the previous value. This does now and on all the child objects assigned to the object.
Also fixed up the lltextureview.cpp as it had some merge issues from a long time ago and was missed.
A workaround, hopefully temporary.
First test returns half the throughput, do two tests. May be caused by
driver, may be some 'energy saving', will need to be checked later.
It was working the same way prior to ExtraFPS, but viewer was running
an extra CPU test.
Technically what appears to be happening is that the renderer is identifying the object as wnating to show the BP textures because the BP tab was selected.
This fix tries to correctly select the BP tab by default only when no PBR faces are present. It also triggers a rebuild of the selected objects to force them updated draw because the selection even occurs before the tab change and they would otherwise by displayed using whatever the previous mode was.