From 440c7b20dab3aa09c04bf3e72b4997181e585cbb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 26 Sep 2024 18:09:32 +0300 Subject: #2411 Allow disabling and enabling LLFontVertexBuffer for testing purposes --- indra/llrender/llfontvertexbuffer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llrender/llfontvertexbuffer.cpp') diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp index 392f235aad..f5d6b03cd6 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(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, -- cgit v1.2.3 From 83a4d86ecf741b5d97c6fd6cbc10d57eb4619699 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 30 Sep 2024 18:28:00 +0300 Subject: viewer#2762 Restore LLFontVertexBuffer for HUD --- indra/llrender/llfontvertexbuffer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llrender/llfontvertexbuffer.cpp') diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp index f5d6b03cd6..963aab7121 100644 --- a/indra/llrender/llfontvertexbuffer.cpp +++ b/indra/llrender/llfontvertexbuffer.cpp @@ -209,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(); -- cgit v1.2.3