@@ -127,34 +127,38 @@ class LLUIImage : public LLRefCount
127127 // Packed key for identifying unique display list configurations
128128 struct PackedKey
129129 {
130- uint64_t position; // x and y coordinates
131- uint64_t color_flags; // RGBA color + solid_color flag
132- uint64_t dimensions; // width and height
133- uint64_t translate; // UI offset
134- uint64_t scale; // UI scale
130+ uint64_t position; // x and y coordinates (32 bits each)
131+ uint64_t color_flags; // RGBA color (8 bits each) + solid_color flag (1 bit)
132+ uint64_t dimensions; // width and height (32 bits each)
133+ uint64_t translate; // UI translation (32 bits each for X and Y)
134+ uint64_t scale; // UI scale (32 bits each for X and Y)
135+ uint64_t tex_name; // OpenGL texture name (32 bits) + padding
135136
136137 constexpr bool operator ==(const PackedKey& other) const
137138 {
138139 return position == other.position &&
139140 color_flags == other.color_flags &&
140141 dimensions == other.dimensions &&
141142 translate == other.translate &&
142- scale == other.scale ;
143+ scale == other.scale &&
144+ tex_name == other.tex_name ;
143145 }
144146
145147 struct Hash
146148 {
147149 std::size_t operator ()(const PackedKey& key) const
148150 {
149151 return static_cast <std::size_t >(key.position ^ key.color_flags ^
150- key.dimensions ^ key.translate ^ key.scale );
152+ key.dimensions ^ key.translate ^
153+ key.scale ^ key.tex_name );
151154 }
152155 };
153156
154157 // Static factory function to create PackedKey from parameters
155158 static constexpr PackedKey create (S32 x, S32 y, S32 width, S32 height,
156159 const LLColor4& color, bool solid_color,
157- const LLVector3& translate, const LLVector3& scale)
160+ const LLVector3& translate, const LLVector3& scale,
161+ LLGLuint texture_name)
158162 {
159163 auto float_to_u8 = [](F32 f) -> uint8_t {
160164 return static_cast <uint8_t >(llclamp (f * 255 .0f , 0 .0f , 255 .0f ));
@@ -187,7 +191,10 @@ class LLUIImage : public LLRefCount
187191 uint64_t scl = (static_cast <uint64_t >(float_to_bits (scale.mV [VX ])) << 32 ) |
188192 static_cast <uint64_t >(float_to_bits (scale.mV [VY ]));
189193
190- return PackedKey{ pos, col, dim, trns, scl };
194+ // Store full 32-bit texture name in lower 32 bits (upper 32 bits unused/zero)
195+ uint64_t tex = static_cast <uint64_t >(texture_name);
196+
197+ return PackedKey{ pos, col, dim, trns, scl, tex };
191198 }
192199 };
193200
0 commit comments