From e708d69fb09963c4829dc6cd095b3e174e268b60 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 Feb 2025 22:57:53 +0200 Subject: #3332 Fix buffers not accounting for dynamic cache values And fix previous lapse of judgement with GLYPH_BATCH_SIZE --- indra/llrender/llfontbitmapcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender/llfontbitmapcache.cpp') diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index ee9cfd0719..83f5d31186 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -107,7 +107,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp mBitmapHeight = image_height; S32 num_components = getNumComponents(bitmap_type); - mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); + mImageRawVec[bitmap_idx].emplace_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); bitmap_num = static_cast(mImageRawVec[bitmap_idx].size()) - 1; LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num); @@ -117,7 +117,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp } // Make corresponding GL image. - mImageGLVec[bitmap_idx].push_back(new LLImageGL(image_raw, false, false)); + mImageGLVec[bitmap_idx].emplace_back(new LLImageGL(image_raw, false, false)); LLImageGL* image_gl = getImageGL(bitmap_type, bitmap_num); // Start at beginning of the new image. -- cgit v1.2.3 From 5b968b7209d5e104e4b6152b8fc0fbbb37d1674a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 24 Feb 2025 17:22:54 +0200 Subject: #3332 Remake glyph count into cache generation 1. Cover reset with 'generation' 2. Fix lapse of judgement with mLastFontGlyphCount, it should have been saved before render(), not after --- indra/llrender/llfontbitmapcache.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llrender/llfontbitmapcache.cpp') diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index 83f5d31186..6a3af1e608 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -141,6 +141,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp bitmap_num = getNumBitmaps(bitmap_type) - 1; mCurrentOffsetX[bitmap_idx] += width + 1; + mGeneration++; return true; } @@ -168,6 +169,7 @@ void LLFontBitmapCache::reset() mBitmapWidth = 0; mBitmapHeight = 0; + mGeneration++; } //static -- cgit v1.2.3