summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llgl.cpp6
-rw-r--r--indra/llrender/llgl.h1
-rw-r--r--indra/llrender/llimagegl.cpp14
3 files changed, 5 insertions, 16 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 0e59c449db..4584ed1d86 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -2370,12 +2370,6 @@ void clear_glerror()
glGetError();
}
-void drain_glerror()
-{
- // bounded: a lost/reset context can return errors indefinitely
- for (S32 i = 0; i < 16 && glGetError() != GL_NO_ERROR; ++i) {}
-}
-
///////////////////////////////////////////////////////////////
//
// LLGLState
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 3f9a9de70a..e1ab2a49e6 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -159,7 +159,6 @@ void log_glerror();
void assert_glerror();
void clear_glerror();
-void drain_glerror(); // pops ALL pending GL error flags (bounded so a lost/reset context that returns errors forever cannot hang the caller); use before an attributable glGetError check.
# define stop_glerror() assert_glerror()
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index b3cd8d2896..c8a23d873e 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.
- drain_glerror();
+ while (glGetError() != GL_NO_ERROR) {}
const bool use_sub_image = should_stagger_image_set(compress);
if (!use_sub_image)
@@ -1919,8 +1919,7 @@ bool LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
//-----------------------------------------------------------------------------------------------
GLenum error ;
- S32 error_count = 0 ;
- while((error = glGetError()) != GL_NO_ERROR && ++error_count <= 16)
+ while((error = glGetError()) != GL_NO_ERROR)
{
LL_WARNS() << "GL Error happens before reading back texture. Error code: " << error << LL_ENDL ;
}
@@ -1980,8 +1979,7 @@ 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() ;
- error_count = 0 ;
- while((error = glGetError()) != GL_NO_ERROR && ++error_count <= 16)
+ while((error = glGetError()) != GL_NO_ERROR)
{
LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ;
}
@@ -2550,10 +2548,8 @@ bool LLImageGL::scaleDown(S32 desired_discard)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- // 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.
+ // Don't let eviction re-arm visibility: the glGenerateMipmap re-bind below
+ // would otherwise stamp mLastBindFrame and keep the texture fetch-eligible.
LLImageGLStampBypass no_stamp;
if (mTarget != GL_TEXTURE_2D