From 838e37e58daced084d979405efaa91a217d6cbbd Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 24 Jun 2024 23:16:24 -0400 Subject: [PATCH] Fixed crash with VEFontCache.can_batch_glyph --- code/font/VEFontCache/atlas.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/font/VEFontCache/atlas.odin b/code/font/VEFontCache/atlas.odin index e8341c8..e05c991 100644 --- a/code/font/VEFontCache/atlas.odin +++ b/code/font/VEFontCache/atlas.odin @@ -98,7 +98,7 @@ can_batch_glyph :: proc( ctx : ^Context, font : FontID, entry : ^Entry, glyph_in atlas_index := LRU_get( & region.state, lru_code ) if atlas_index == - 1 { - if region.next_idx >= u32( region.state.capacity) { + if region.next_idx > u32( region.state.capacity) { // We will evict LRU. We must predict which LRU will get evicted, and if it's something we've seen then we need to take slowpath and flush batch. next_evict_codepoint := LRU_get_next_evicted( & region.state ) seen := get( & ctx.temp_codepoint_seen, next_evict_codepoint )