diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-10-04 10:04:13 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-10-04 10:04:13 -0400 |
commit | 14293b7b0a63fe5be904cbdc853f3b185e13f3fc (patch) | |
tree | 6a755ca689fc408de11e46b891fedb52002b6b9f /indra/llrender/llfontvertexbuffer.cpp | |
parent | 71e89d6a493e51789008f74f87439611f11c13ab (diff) | |
parent | e093a98f86ad46374f5067adb616a2aead73eff5 (diff) |
Merge remote branch 'develop' into marchcat/xcode-16
Diffstat (limited to 'indra/llrender/llfontvertexbuffer.cpp')
-rw-r--r-- | indra/llrender/llfontvertexbuffer.cpp | 18 |
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(); |