Increase initial size of text cache in iced_wgpu

This reduces the amount of cache updates in general when text changes.

The new cache should take 4MB of VRAM. I think this is reasonable for a
modern GUI toolkit. In any case, we should be able to reduce this value in the
future.
This commit is contained in:
Héctor Ramón Jiménez 2019-11-07 06:54:03 +01:00
parent 5fd0c724b2
commit 79f31b66c3

View file

@ -74,6 +74,7 @@ impl Renderer {
let glyph_brush =
GlyphBrushBuilder::using_fonts_bytes(vec![default_font, mono_font])
.initial_cache_size((2048, 2048))
.build(&mut device, TextureFormat::Bgra8UnormSrgb);
let quad_pipeline = quad::Pipeline::new(&mut device);