summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindow.cpp
diff options
context:
space:
mode:
authorTommyTheTerrible <81168766+TommyTheTerrible@users.noreply.github.com>2025-05-05 04:52:58 -0400
committerGitHub <noreply@github.com>2025-05-05 11:52:58 +0300
commit89512d44f82dcb9679067bb2303acc40b7b43951 (patch)
treefb7aebeaa5b5c019dca7d09516f0c0888336f475 /indra/llwindow/llwindow.cpp
parentac5d59b9392dbd107ff6e8ac05ab8a3cd48fd694 (diff)
updateImageDecodePriority - Avoid Long Face Loop (#4019, #4021)
* updateImageDecodePriority - Avoid Long Face Loop To avoid running a long loop on thousands of faces, some textures were being set to a BOOST level to avoid the updateImageDecodePriority function entirely but this was causing many of them to never be deleted over the course of a user's travels. Instead of relying on BOOST, this commit changes the logic of the texture channel loop such that the face loop will only run if the number of faces is below the threshold. To do this, we move the face_count incrementing outside of the face loop into the channel loop and increment it using the getNumFaces function instead. We then check the face_count against the maximum number of faces we want to check and if it exceeds the number we set the number of faces for the face loop to check down to zero. This avoids branch prediction misses and the long face loop issue. Later, if the face_count is above the threshold, we assign the virtual size to the maximum. I personally believe the max_faces_to_check should be lower than 1024, but I left that value in for continuity. I use 64 faces as my max on my compiled version of the viewer without any noticeable issues for memory use. * updateImageDecodePriority - Face Loop Increment Swap Looks like compilers like knowing the incrementing in the for loop information for optimizations and parallelization. Sorry for the tiny commit. * updateImageDecodePriority - Suggested Cleanup Remove trailing white-space. Co-authored-by: Andrey Lihatskiy <alihatskiy@productengine.com>
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
0 files changed, 0 insertions, 0 deletions