Releases: alexheretic/glyph-brush
gfx-glyph-0.15
- New API for drawing queued glyphs. Depth buffer usage is now optional.
// v0.14 glyph_brush.draw_queued(encoder, color, depth)?; // v0.15 glyph_brush.use_queue().depth_target(depth).draw(encoder, color)?;
- Depth test now defaults to Only draw when the fragment's output depth is less than or equal to the current depth buffer value, and update the buffer. Instead of Always pass, never write. This is because depth buffer interaction is now optional.
- Custom transform usages are now expected to provide the orthographic projection, whereas before this projection was pre-baked. The shader also now inverts the y-axis to be more in-line with other APIs. Previous usages can be technically converted with:
The new style allows easier pre-projection transformations, like rotation, as before only post-projection transforms were possible. Draws without custom transforms are unchanged, they now internally use
// v0.14 glyph_brush.draw_queued_with_transform(custom_transform, ..); // v0.15 glyph_brush .use_queue() .transform(invert_y * custom_transform * gfx_glyph::default_transform(&gfx_color)) .draw(..);
gfx_glyph::default_transform
. - Deprecated
GlyphBrush::draw_queued
in favour ofuse_queue()
draw builder usage. - Removed
GlyphBrush::draw_queued_with_transform
in favour ofuse_queue()
draw builder usage. - Update glyph_brush ->
0.5
.
glyph-brush-0.4.3
- Fix cached vertices erroneously remaining valid after screen dimension change.
- Update hashbrown ->
0.3
.
gfx-glyph-0.14.1
- Enlarge textures within
GL_MAX_TEXTURE_SIZE
if possible.
glyph-brush-0.4.2
- Wasm32: Avoid using random state in the default hasher.
glyph-brush-0.4.1
- Change default section hasher to xxHash as seahash has been shown to collide easily in 32bit environments.
gfx-glyph-0.14
- Update gfx ->
0.18
.
glyph-brush-layout-0.1.5
- Add
GlyphPositioner::recalculate_glyphs
with a default unoptimised implementation. Custom layouts won't be broken by this change, but will need to implement the new function to provide optimised behaviour. - Optimise built-in layout's recalculate_glyphs for screen position changes with
GlyphChange::Geometry
. - Optimise built-in layout's recalculate_glyphs for single color changes with
GlyphChange::Color
. - Optimise built-in layout's recalculate_glyphs for alpha changes with
GlyphChange::Alpha
. - Optimise layout re-positioning with
PositionedGlyph::set_position
usage.
glyph-brush-0.4
-
Use queue call counting & fine grained hashing to match up previous calls with current calls figuring out what has changed allowing optimised use of
recalculate_glyphs
for fast layouts.- Compute if just geometry (ie section position) has changed ->
GlyphChange::Geometry
. - Compute if just color has changed ->
GlyphChange::Color
. - Compute if just alpha has changed ->
GlyphChange::Alpha
.
Provides much faster re-layout performance in these common change scenarios.
- Compute if just geometry (ie section position) has changed ->
-
GlyphBrush
now generates & caches vertices avoiding regeneration of individual unchanged sections, when another section change forces regeneration of the complete vertex array. The user vertex typeV
is now in the struct signature.pub struct DownstreamGlyphBrush<'font, H = DefaultSectionHasher> { // previously: glyph_brush::GlyphBrush<'font, H>, inner: glyph_brush::GlyphBrush<'font, DownstreamGlyphVertex, H>, ... }
These changes result in a big performance improvement for changes to sections amongst other unchanging sections, which is a fairly common thing to want to do. Fully cached (everything unchanging) & worst-case (everything changing/new) are not significantly affected.
name control ns/iter change ns/iter diff ns/iter diff % speedup
continually_modify_alpha_of_1_of_3 854,554 349,165 -505,389 -59.14% x 2.45
continually_modify_bounds_of_1_of_3 865,162 643,341 -221,821 -25.64% x 1.34
continually_modify_color_of_1_of_3 855,189 344,501 -510,688 -59.72% x 2.48
continually_modify_end_text_of_1_of_3 857,913 647,491 -210,422 -24.53% x 1.32
continually_modify_middle_text_of_1_of_3 856,383 642,055 -214,328 -25.03% x 1.33
continually_modify_position_of_1_of_3 866,298 355,794 -510,504 -58.93% x 2.43
continually_modify_start_text_of_1_of_3 872,081 654,887 -217,194 -24.91% x 1.33
no_cache_render_3_medium_sections_fully 1,480,556 1,500,286 19,730 1.33% x 0.99
render_3_medium_sections_fully 1,136 1,066 -70 -6.16% x 1.07
gfx-glyph-0.13.3
- Update glyph_brush ->
0.4
, big performance improvements for changing sections.
glyph-brush-layout-0.1.4
- Implement
PartialEq
forSectionGeometry
&SectionText
.