summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-07-09 08:09:24 -0400
committerGitHub <noreply@github.com>2026-07-09 08:09:24 -0400
commita937b237de3651e79cdb517f14381a5bdd4c844b (patch)
tree6ea93458c9a92b8660719b5346828583c7e7aefe /indra/llrender/llimagegl.cpp
parent4452ec69732310c02ee20fb225806f489785789c (diff)
Geenz/texture loading speed (#5985)
* Add more controls for texture loading budgets. Should yield much faster loading within a given FPS target - should generally self regulate depending on your framerate. * Harden texture pipeline against stalls and OOM. Generally makes texture loading faster, at the expense of some budgeting (which we weren't doing a great job at anyways).
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index c8a23d873e..b3cd8d2896 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1507,7 +1507,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
// Drain stale GL errors so an OOM detected below belongs to this alloc.
// Otherwise a failed glTexImage2D is swallowed in release while
// alloc_tex_image still counts the bytes, inflating the used-VRAM figure.
- while (glGetError() != GL_NO_ERROR) {}
+ drain_glerror();
const bool use_sub_image = should_stagger_image_set(compress);
if (!use_sub_image)
@@ -1919,7 +1919,8 @@ bool LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
//-----------------------------------------------------------------------------------------------
GLenum error ;
- while((error = glGetError()) != GL_NO_ERROR)
+ S32 error_count = 0 ;
+ while((error = glGetError()) != GL_NO_ERROR && ++error_count <= 16)
{
LL_WARNS() << "GL Error happens before reading back texture. Error code: " << error << LL_ENDL ;
}
@@ -1979,7 +1980,8 @@ bool LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ;
imageraw->deleteData() ;
- while((error = glGetError()) != GL_NO_ERROR)
+ error_count = 0 ;
+ while((error = glGetError()) != GL_NO_ERROR && ++error_count <= 16)
{
LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ;
}
@@ -2548,8 +2550,10 @@ bool LLImageGL::scaleDown(S32 desired_discard)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- // Don't let eviction re-arm visibility: the glGenerateMipmap re-bind below
- // would otherwise stamp mLastBindFrame and keep the texture fetch-eligible.
+ // Don't let eviction re-arm the GC: the glGenerateMipmap re-bind below would
+ // otherwise stamp mLastBindFrame, so the next computeDesiredDiscard treats the
+ // just-evicted texture as freshly drawn, un-floors it, and re-fetches - the
+ // evict/refetch oscillation.
LLImageGLStampBypass no_stamp;
if (mTarget != GL_TEXTURE_2D