Improve DrawQuads batching in the font render. (#1654)

Currently only identical glyphs are merged into one DrawQuads call.
This fixes the comparison so that all glyphs with the same texture can
be merged, which greatly improves the font rendering performance.
This commit is contained in:
ranma
2018-03-10 20:44:45 +01:00
committed by Colby Klein
parent dba5e3f1f1
commit 1ca5809da5
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ void BitmapText::DrawChars( bool bUseStrokeTexture )
for( int start = iStartGlyph; start < iEndGlyph; )
{
int end = start;
while( end < iEndGlyph && m_vpFontPageTextures[end] == m_vpFontPageTextures[start] )
while( end < iEndGlyph && *m_vpFontPageTextures[end] == *m_vpFontPageTextures[start] )
end++;
bool bHaveATexture = !bUseStrokeTexture || (bUseStrokeTexture && m_vpFontPageTextures[start]->m_pTextureStroke);