diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-09-02 22:14:42 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-09-04 10:16:46 +0300 | 
| commit | 4cc0edb189c4deaa205f986d20a6959aa83fb25c (patch) | |
| tree | 29b94ccfddb625e664ddf072a4351745240cc597 /indra/llrender | |
| parent | 57ab1a410f9cb3534bb403e034743505758579d8 (diff) | |
viewer#2411 Cleanup
Diffstat (limited to 'indra/llrender')
| -rw-r--r-- | indra/llrender/llfontvertexbuffer.cpp | 9 | ||||
| -rw-r--r-- | indra/llrender/llfontvertexbuffer.h | 7 | ||||
| -rw-r--r-- | indra/llrender/llrender.cpp | 114 | ||||
| -rw-r--r-- | indra/llrender/llrender.h | 4 | 
4 files changed, 3 insertions, 131 deletions
| diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp index 417bacd69d..96ec94fe0f 100644 --- a/indra/llrender/llfontvertexbuffer.cpp +++ b/indra/llrender/llfontvertexbuffer.cpp @@ -31,8 +31,7 @@  #include "llvertexbuffer.h" -LLFontVertexBuffer::LLFontVertexBuffer(bool track_changes) -: mTrackStringChanges(track_changes) +LLFontVertexBuffer::LLFontVertexBuffer()  {  } @@ -141,11 +140,6 @@ S32 LLFontVertexBuffer::render(          genBuffers(fontp, text, begin_offset, x, y, color, halign, valign,              style, shadow, max_chars, max_pixels, right_x, use_ellipses, use_color);      } -    else if (mTrackStringChanges && mLastStringHash != sStringHasher._Do_hash(text)) -    { -        genBuffers(fontp, text, begin_offset, x, y, color, halign, valign, -            style, shadow, max_chars, max_pixels, right_x, use_ellipses, use_color); -    }      else      {          renderBuffers(); @@ -183,7 +177,6 @@ void LLFontVertexBuffer::genBuffers(      mLastOffset = begin_offset;      mLastMaxChars = max_chars;      mLastMaxPixels = max_pixels; -    mLastStringHash = sStringHasher._Do_hash(text);      mLastX = x;      mLastY = y;      mLastColor = color; diff --git a/indra/llrender/llfontvertexbuffer.h b/indra/llrender/llfontvertexbuffer.h index d41c6205ac..67cf2ca13c 100644 --- a/indra/llrender/llfontvertexbuffer.h +++ b/indra/llrender/llfontvertexbuffer.h @@ -35,7 +35,7 @@ class LLVertexBufferData;  class LLFontVertexBuffer  {  public: -    LLFontVertexBuffer(bool track_changes = true); +    LLFontVertexBuffer();      ~LLFontVertexBuffer();      void reset(); @@ -101,7 +101,6 @@ private:      S32 mLastOffset = 0;      S32 mLastMaxChars = 0;      S32 mLastMaxPixels = 0; -    size_t mLastStringHash = 0;      F32 mLastX = 0.f;      F32 mLastY = 0.f;      LLColor4 mLastColor; @@ -115,10 +114,6 @@ private:      F32 mLastScaleX = 1.f;      F32 mLastScaleY = 1.f;      LLCoordGL mLastOrigin; - -    bool mTrackStringChanges = true; - -    static std::hash<LLWString> sStringHasher;  };  #endif diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b906563b08..a40a668a70 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1592,50 +1592,6 @@ void LLRender::end()      }  } -LLVertexBuffer* LLRender::beginNoCache(const GLuint& mode, S32& count) -{ -    if (mode != mMode) -    { -        if (mode == LLRender::QUADS) -        { -            mQuadCycle = 1; -        } - -        if (mMode == LLRender::QUADS || -            mMode == LLRender::LINES || -            mMode == LLRender::TRIANGLES || -            mMode == LLRender::POINTS) -        { -            return getBuffer(count); -        } -        else if (mCount != 0) -        { -            LL_ERRS() << "gGL.begin() called redundantly." << LL_ENDL; -        } -        mMode = mode; -    } -    return nullptr; -} - -LLVertexBuffer* LLRender::endNoCache(S32& count) -{ -    if (mCount == 0) -    { -        return nullptr; -        //IMM_ERRS << "GL begin and end called with no vertices specified." << LL_ENDL; -    } - -    if ((mMode != LLRender::QUADS && -        mMode != LLRender::LINES && -        mMode != LLRender::TRIANGLES && -        mMode != LLRender::POINTS) || -        mCount > 2048) -    { -        return getBuffer(count); -    } -    return nullptr; -} -  void LLRender::flush()  {      STOP_GLERROR; @@ -1844,76 +1800,6 @@ void LLRender::resetStriders(S32 count)      mCount = 0;  } -LLVertexBuffer* LLRender::getBuffer(S32 & count) -{ -    STOP_GLERROR; -    LLVertexBuffer *vb; -    if (mCount > 0) -    { -        LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; -        llassert(LLGLSLShader::sCurBoundShaderPtr != nullptr); -        if (!mUIOffset.empty()) -        { -            sUICalls++; -            sUIVerts += mCount; -        } - -        //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) -        count = mCount; - -        if (mMode == LLRender::QUADS && !sGLCoreProfile) -        { -            if (mCount % 4 != 0) -            { -                count -= (mCount % 4); -                LL_WARNS() << "Incomplete quad requested." << LL_ENDL; -            } -        } - -        if (mMode == LLRender::TRIANGLES) -        { -            if (mCount % 3 != 0) -            { -                count -= (mCount % 3); -                LL_WARNS() << "Incomplete triangle requested." << LL_ENDL; -            } -        } - -        if (mMode == LLRender::LINES) -        { -            if (mCount % 2 != 0) -            { -                count -= (mCount % 2); -                LL_WARNS() << "Incomplete line requested." << LL_ENDL; -            } -        } - -        mCount = 0; - -        if (mBuffer) -        { -            LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb cache miss"); - -            U32 attribute_mask = LLGLSLShader::sCurBoundShaderPtr->mAttributeMask; -            vb = genBuffer(attribute_mask, count); -            drawBuffer(vb, mMode, count); -        } -        else -        { -            // mBuffer is present in main thread and not present in an image thread -            LL_ERRS() << "A flush call from outside main rendering thread" << LL_ENDL; -        } - -        resetStriders(count); -    } -    else -    { -        count = 0; -    } - -    return vb; -} -  void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)  {      //the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095] diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index aeee8685ab..39c13e328a 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -45,6 +45,7 @@  #include "glh/glh_linear.h"  #include <array> +#include <list>  class LLVertexBuffer;  class LLCubeMap; @@ -423,9 +424,6 @@ public:      void begin(const GLuint& mode);      void end(); -    LLVertexBuffer* beginNoCache(const GLuint& mode, S32& count); -    LLVertexBuffer* endNoCache(S32& count); -    LLVertexBuffer* getBuffer(S32& count);      U8 getMode() const { return mMode; }      void vertex2i(const GLint& x, const GLint& y); | 
