Skip to content

Releases: alexheretic/glyph-brush

gfx-glyph-0.15

03 May 08:49
c142c26
Compare
Choose a tag to compare
  • 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:
    // 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(..);
    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 gfx_glyph::default_transform.
  • Deprecated GlyphBrush::draw_queued in favour of use_queue() draw builder usage.
  • Removed GlyphBrush::draw_queued_with_transform in favour of use_queue() draw builder usage.
  • Update glyph_brush -> 0.5.

glyph-brush-0.4.3

27 Apr 18:48
678142e
Compare
Choose a tag to compare
  • Fix cached vertices erroneously remaining valid after screen dimension change.
  • Update hashbrown -> 0.3.

gfx-glyph-0.14.1

19 Apr 11:50
677e798
Compare
Choose a tag to compare
  • Enlarge textures within GL_MAX_TEXTURE_SIZE if possible.

glyph-brush-0.4.2

14 Apr 14:19
5a5aa0d
Compare
Choose a tag to compare
  • Wasm32: Avoid using random state in the default hasher.

glyph-brush-0.4.1

15 Feb 17:34
9b26f1d
Compare
Choose a tag to compare
  • Change default section hasher to xxHash as seahash has been shown to collide easily in 32bit environments.

gfx-glyph-0.14

12 Feb 22:24
7086cbd
Compare
Choose a tag to compare
  • Update gfx -> 0.18.

glyph-brush-layout-0.1.5

08 Feb 09:43
8e6329c
Compare
Choose a tag to compare
  • 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

08 Feb 09:49
889cfa1
Compare
Choose a tag to compare
  • 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.

  • 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 type V 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

08 Feb 09:54
8f1e7a0
Compare
Choose a tag to compare
  • Update glyph_brush -> 0.4, big performance improvements for changing sections.

glyph-brush-layout-0.1.4

01 Feb 09:37
0a4aa71
Compare
Choose a tag to compare
  • Implement PartialEq for SectionGeometry & SectionText.