Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index b91eceac817..b05cabcd830 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -319,17 +319,17 @@ void blf_glyph_free(GlyphBLF *g)
static void blf_texture_draw(const unsigned char color[4], float uv[2][2], float x1, float y1, float x2, float y2)
{
- if (g_batch.glyph_ct == BLF_BATCHING_SIZE) {
- blf_batching_draw();
- blf_batching_start(g_batch.font);
- }
- g_batch.glyph_ct++;
/* Only one vertex per glyph, geometry shader expand it into a quad. */
/* TODO Get rid of Geom Shader because it's not optimal AT ALL for the GPU */
copy_v4_fl4(GWN_vertbuf_raw_step(&g_batch.pos_step), x1 + g_batch.ofs[0], y1 + g_batch.ofs[1],
x2 + g_batch.ofs[0], y2 + g_batch.ofs[1]);
copy_v4_v4(GWN_vertbuf_raw_step(&g_batch.tex_step), (float *)uv);
copy_v4_v4_uchar(GWN_vertbuf_raw_step(&g_batch.col_step), color);
+ g_batch.glyph_ct++;
+ /* Flush cache if it's full. */
+ if (g_batch.glyph_ct == BLF_BATCHING_SIZE) {
+ blf_batching_draw();
+ }
}
static void blf_texture5_draw(const unsigned char color_in[4], float uv[2][2], float x1, float y1, float x2, float y2)