summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontvertexbuffer.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-10-04 10:04:13 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-10-04 10:04:13 -0400
commit14293b7b0a63fe5be904cbdc853f3b185e13f3fc (patch)
tree6a755ca689fc408de11e46b891fedb52002b6b9f /indra/llrender/llfontvertexbuffer.cpp
parent71e89d6a493e51789008f74f87439611f11c13ab (diff)
parente093a98f86ad46374f5067adb616a2aead73eff5 (diff)
Merge remote branch 'develop' into marchcat/xcode-16
Diffstat (limited to 'indra/llrender/llfontvertexbuffer.cpp')
-rw-r--r--indra/llrender/llfontvertexbuffer.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp
index 392f235aad..963aab7121 100644
--- a/indra/llrender/llfontvertexbuffer.cpp
+++ b/indra/llrender/llfontvertexbuffer.cpp
@@ -31,6 +31,8 @@
#include "llvertexbuffer.h"
+bool LLFontVertexBuffer::sEnableBufferCollection = true;
+
LLFontVertexBuffer::LLFontVertexBuffer()
{
}
@@ -119,6 +121,11 @@ S32 LLFontVertexBuffer::render(
{
return static_cast<S32>(text.length());
}
+ if (!sEnableBufferCollection)
+ {
+ // For debug purposes and performance testing
+ return fontp->render(text, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, max_pixels, right_x, use_ellipses, use_color);
+ }
if (mBufferList.empty())
{
genBuffers(fontp, text, begin_offset, x, y, color, halign, valign,
@@ -202,6 +209,17 @@ void LLFontVertexBuffer::renderBuffers()
gGL.flush(); // deliberately empty pending verts
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
gGL.pushUIMatrix();
+
+ gGL.loadUIIdentity();
+
+ // Depth translation, so that floating text appears 'in-world'
+ // and is correctly occluded.
+ gGL.translatef(0.f, 0.f, LLFontGL::sCurDepth);
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+
+ // Note: ellipses should technically be covered by push/load/translate of their own
+ // but it's more complexity, values do not change, skipping doesn't appear to break
+ // anything, so we can skip that until it proves to cause issues.
for (LLVertexBufferData& buffer : mBufferList)
{
buffer.draw();