summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-08-20 20:10:37 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-08-20 22:27:46 +0300
commit99dbc2dcdc61f39c6d13f778d7e65544aa3c5461 (patch)
tree43146750b2e9fd3fb782a2b5f58a51259cfb0862 /indra/llrender/llimagegl.cpp
parentecd928544474d0c69954317df3a4859023ec9c9d (diff)
#6163 Crash on LLImageGL::scaleDown(int)
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index fafc92b5d0..81743713a1 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -2583,6 +2583,12 @@ bool LLImageGL::scaleDown(S32 desired_discard)
{
glDrawArrays(GL_TRIANGLES, 0, 3);
+#if LL_DARWIN
+ // On mac OS, flush before freeing, otherwise the texture may be
+ // freed before Metal's 'lazy' evaluation/restoration behavior triggers.
+ glFlush();
+#endif
+
free_tex_image(mTexName);
glTexImage2D(mTarget, 0, mFormatInternal, desired_width, desired_height, 0, mFormatPrimary, mFormatType, nullptr);
glCopyTexSubImage2D(mTarget, 0, 0, 0, 0, 0, desired_width, desired_height);