Skip to content

v0.52.8 — wgpu v0.35.6 migration, bounded curve subdivision, no silent draw loss

Choose a tag to compare

@kolkov kolkov released this 28 Nov 14:31
· 6 commits to main since this release

Changed

  • wgpu v0.35.0 (ADR-070 package move): the GPU path no longer depends on the removed wgpu/core package. The
    dead gpu.Backend facade, its stub command encoders and the GPUSceneRenderer chain are deleted (about 17.7K
    lines of legacy wrappers and their tests in internal/gpu, no production caller), and the GPU tests build their
    HAL devices through wgpu's wgputest seam. Dependencies: wgpu v0.35.6, naga v0.22.7, gputypes v0.9.2,
    gpucontext v0.32.1. An app that also uses gogpu needs gogpu v0.56.0 or newer with this release — older
    versions (e.g. v0.54.1) import the wgpu/hal/* packages ADR-070 removed, and go mod tidy cannot resolve
    them alongside gg v0.52.8.

Fixed

  • Native curve subdivision terminates on float32 fixed points (#541, by @timzifer): the analytic rasterizer
    subdivided cubics and quadratics against an absolute 0.1 px deviation test with no depth bound. At large
    coordinates a float32 midpoint can round back to an input point, leaving a child identical to its parent and the
    deviation never decreasing — a stack overflow that a clip rectangle did not prevent either, because the
    out-of-bounds guard ran after the recursive branch. Subdivision now carries a depth through the native helpers
    and emits the remaining chord as a line past depth 10, as the flattening routines already do.
  • Concurrent Close calls are idempotent: Context.Close and the surface Close methods checked a plain
    flag and then set it, so two callers could both run the cleanup and double-free GPU resources. The flag is
    atomic with a compare-and-swap now — exactly one caller runs the body, the rest return nil.
  • The per-context GPU render context is created once: concurrent first use of a Context could create two
    render contexts and leak one; creation and every read now go through a lock.
  • GPU path draws no longer vanish when no device can be had (#534, by @timzifer): the four queueing entry
    points (FillPath, StrokePath, FillShape, StrokeShape) now check device readiness before accepting a
    draw. On a machine without an adapter they report the CPU fallback instead of queueing into a Flush that would
    drop the work — previously every filled and stroked path disappeared while text still rendered, and no error
    surfaced.
  • Standalone GPU initialization on macOS: the device request is no longer Vulkan-only. Metal is now requested
    too — the platform set wgpu registers by default — so gg without a device provider uses the GPU on macOS instead
    of silently falling back to the CPU rasterizer. Windows and Linux keep Vulkan.
  • Stencil cover pipeline without a session clip layout: the cover shader always declares the @group(1) clip
    uniform, but the pipeline layout included the group only when the session had attached its shared clip layout.
    A built-in no-clip group keeps direct renderer use (the render/readback path) valid; naga v0.22+ rejects the
    mismatch at MSL compile on Metal.