Skip to content

v0.52.7 — font fallback on the GPU path, reused ggcanvas, MSAA cap

Choose a tag to compare

@kolkov kolkov released this 08 Nov 14:11
· 21 commits to main since this release

Added

  • Font fallback stays on the GPU text path (#513, #521, thanks @besmpl) — text drawn with a MultiFace or
    FilteredFace that mixes fonts used to fall back to CPU rendering, because the GPU paths need glyph IDs from one
    font. Text is now split into runs by source font before shaping (MultiFace.FontRuns, FilteredFace.FontRuns,
    text.ShapeRuns), each glyph keeps the face it came from (ShapedGlyph.Face), and single-font runs go to the
    glyph-mask and MSDF pipelines.
  • SetAcceleratorMaxSampleCount (#547, thanks @sogonov): caps the MSAA sample count of the GPU
    accelerator. 1 turns multi-sampling off (strategyNoMSAA, the path
    software adapters already take), and 0 restores the default. The optional
    SampleCountAware interface carries it, and SDFAccelerator implements it
    by forwarding to GPUShared. An application that draws only glyph-mask text
    and pixel-aligned rectangles, such as a terminal UI, looks the same without
    MSAA. Turning it off frees the 4x color and depth/stencil targets: about
    120 MB of GPU memory for a 2060x1638 window, with screenshots identical
    byte for byte.

Fixed

  • Translucent fills and strokes on the GPU stencil path render at full strength again (#540, thanks @timzifer) —
    the renderer stores premultiplied colour for the stencil-then-cover pass and the cover uniform multiplied by alpha
    a second time, so translucent geometry came out as alpha²·colour over the background: darker and grayer than
    the CPU output. Opaque colours were unaffected, which is why it depended on what was drawn.
  • FontSource keeps one copy of its data (#546, thanks @sogonov) — NewFontSource documented that the caller's
    slice may be reused, but it parsed the caller's slice and stored a copy that nothing read: reusing the buffer broke
    the font, and every source held its file twice. It now parses the copy, and NewFontSourceFromFile hands over the
    buffer it just read instead of copying it.
  • Arbitrary-path clips draw their content in gogpu windows — with a circle, star or any other non-rectangular
    clip, nothing inside the clip was drawn when gg rendered into a window (examples/clip_path). On that path the
    frame is recorded into gogpu's command encoder, and gg dropped the pass that marks the clip region in the depth
    buffer while the clipped content still tested against it. Offscreen rendering with readback was not affected. A
    GPU readback test now renders through a shared encoder as well.
  • ggcanvas.New reuses the canvas instead of allocating one per frame (#484, #496, thanks @besmpl) —
    applications that take a fresh GPUContextProvider wrapper every frame and call ggcanvas.New with it got a new
    canvas, context and texture pipeline each time. New and NewWithScale now return the existing canvas for the
    same GPU device, size and scale, keyed by the provider's stable device/queue/adapter handles. A different size or
    scale keeps its own canvas, and Draw follows the window's size from WindowProvider. Render now reads the
    window provider under the canvas's lifecycle lock, since a concurrent New replaces it.

Changed

  • Dependencies: wgpu v0.34.10, naga v0.21.5, gpucontext v0.31.3, gputypes v0.8.2, go-webgpu/goffi v0.6.8,
    go-webgpu/webgpu v0.5.5. wgpu v0.34.10 releases resources before they are submitted, refcounts samplers and holds
    them from bind groups, keeps a texture alive from its view, and holds the Vulkan dynamic buffer types in the
    descriptor pool; naga v0.21.5 carries the security fixes of the v0.21 line. The go line stays 1.25.0.

Install:

go get github.com/gogpu/gg@v0.52.7

Full Changelog: v0.52.6...v0.52.7