summaryrefslogtreecommitdiff
path: root/indra/llrender/lluiimage.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-07-21 20:56:54 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-07-21 22:42:36 +0300
commitb35e537b5140c2a1d38fe979c2c551f735a6d21e (patch)
tree1486dd1a35bceaf58eeeaff11f20bf377d8cdabf /indra/llrender/lluiimage.cpp
parent2a75b42f164501e44ea2f35361812f87935c225e (diff)
#5972 Track UI texture changes
Diffstat (limited to 'indra/llrender/lluiimage.cpp')
-rw-r--r--indra/llrender/lluiimage.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index 85754209a4..d0b6bcbf66 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -77,10 +77,17 @@ S32 LLUIImage::getHeight() const
buffer_data_list_t* LLUIImage::findDisplayList(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, bool solid_color) const
{
+ LLImageGL* gl_image = mImage->getGLTexture();
+ if (!gl_image)
+ {
+ return nullptr;
+ }
+
LLVector3 ui_translation = gGL.getUITranslation();
LLVector3 ui_scale = gGL.getUIScale();
+ LLGLuint tex_name = gl_image->getTexName();
- auto key = PackedKey::create(x, y, width, height, color, solid_color, ui_translation, ui_scale);
+ auto key = PackedKey::create(x, y, width, height, color, solid_color, ui_translation, ui_scale, tex_name);
auto it = mDisplayLists.find(key);
if (it != mDisplayLists.end())
@@ -94,9 +101,23 @@ buffer_data_list_t* LLUIImage::findDisplayList(S32 x, S32 y, S32 width, S32 heig
buffer_data_list_t* LLUIImage::genDisplayList(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, bool solid_color) const
{
LL_PROFILE_ZONE_SCOPED;
+
+ LLImageGL* gl_image = mImage->getGLTexture();
+ if (!gl_image)
+ {
+ // Don't cache when texture hasn't been created yet
+ // draw just aborts in this case, so don't draw either.
+ return nullptr;
+ }
+
LLVector3 ui_translation = gGL.getUITranslation();
LLVector3 ui_scale = gGL.getUIScale();
- auto key = PackedKey::create(x, y, width, height, color, solid_color, ui_translation, ui_scale);
+
+ // Get the GL texture name - this uniquely identifies the current texture state
+ // including discard level changes, texture recreation, etc.
+ LLGLuint tex_name = gl_image->getTexName();
+
+ auto key = PackedKey::create(x, y, width, height, color, solid_color, ui_translation, ui_scale, tex_name);
CachedDisplayList cached;
cached.last_used = std::chrono::steady_clock::now();