summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-10-06 01:44:40 +0000
committerOmar Rizwan <omar@omar.website>2023-10-06 01:44:40 +0000
commit5a662a3df4e4a64210065fe3601fe87e63053bce (patch)
tree969c68c0d1da114e83f3a4841c793fed0d4e4784 /virtual-programs
parentdisplay: Catch errors, so we don't hard crash if font doesn't exist (diff)
downloadfolk-5a662a3df4e4a64210065fe3601fe87e63053bce.tar.gz
folk-5a662a3df4e4a64210065fe3601fe87e63053bce.zip
display: Make image cache shrink when more fonts are loaded
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/display.folk2
1 files changed, 1 insertions, 1 deletions
diff --git a/virtual-programs/display.folk b/virtual-programs/display.folk
index d7c0f2b1..f92afb67 100644
--- a/virtual-programs/display.folk
+++ b/virtual-programs/display.folk
@@ -359,7 +359,7 @@ On process {
return vec4(0.0, 0.0, 0.0, 0.0);
}]
variable imCache [dict create]
- variable IMCACHE_MAX_IMAGES [- $Gpu::ImageManager::GPU_MAX_IMAGES 1]
+ variable IMCACHE_MAX_IMAGES [- $Gpu::ImageManager::GPU_MAX_IMAGES [dict size $::FontCache]]
proc checkImCacheAndCopyIfNeeded {imDrawSet} {
variable imCache
variable IMCACHE_MAX_IMAGES