Skip to content

v0.52.6

Choose a tag to compare

@kolkov kolkov released this 08 Nov 08:19
· 41 commits to main since this release

gg builds with the current GoGPU modules again. go get github.com/gogpu/gg@latest next to gogpu v0.54.x (wgpu v0.34.9, naga v0.21.4) compiles; with v0.52.5 it did not.

Fixes #531, #535.

Security

  • naga v0.21.4 — gg compiles its shaders with naga, and naga before v0.21.3 could overflow the stack on deeply
    nested WGSL (GHSA-887q-cf99-367r). gg only parses its own embedded shaders, so gg itself is not exposed, but
    govulncheck flags the reachable parser; this release requires the fixed naga.

Fixed

  • gg builds with gogpu v0.54.0 and the current GPU modules (#531, #535) — gg v0.52.5 required
    wgpu v0.31.6, gpucontext v0.28.0 and gputypes v0.5.2. gogpu v0.54.0 requires wgpu v0.34.2,
    gpucontext v0.31.3 and gputypes v0.8.0, and with those gg failed to compile: wgpu v0.34 takes
    struct arguments for Draw, DrawIndexed, SetViewport and SetScissorRect
    (gputypes.DrawArgs, DrawIndexedArgs, Viewport, ScissorRect), and gpucontext v0.31 changed
    UpdateRegion. Every call site is migrated.

  • ggcanvas partial upload uses the strided UpdateRegion (#529, @lkmavi) — damaged regions are
    uploaded with gpucontext.TextureRegionUpdater.UpdateRegion(region, data, layout) and
    ImageDataLayout{BytesPerRow: width*4} straight from the pixmap buffer, without the per-region copy.

  • No compute pipelines on adapters without compute shaders (ADR-071) — the GPU accelerator now
    checks DownlevelFlagsComputeShaders (from the shared DeviceProvider, or from the adapter in
    standalone mode) before creating the Vello compute pipelines. GLES 3.0 and WebGL2 skip them cleanly
    and use the CPU coverage filler, instead of failing at pipeline creation.

  • Soft-light blend shader used a float vector as the select() condition — blend_soft_light
    in blend.wgsl passed step(...) (a vec3<f32>) to select(), which WGSL requires to be
    bool or vecN<bool>. Rust naga, browsers and naga v0.21.0 reject the shader; older naga
    backends disagreed on its result (SPIR-V converted with != 0, the HLSL failed under DXC,
    the DXIL was invalid). The condition is now the equivalent comparison (dst <= 0.25,
    src <= 0.5), so the output is unchanged. A test parses and validates every gg shader with
    naga, whose validator now enforces the rule.

  • Standalone stencil and SDF readback padded to 256-byte rows — CopyTextureToBuffer needs BytesPerRow to be
    a multiple of 256, which wgpu checks since v0.34.7. The standalone StencilRenderer.RenderPath and SDF pipeline
    readback helpers used width*4 and failed for widths that are not a multiple of 64 pixels. The frame rendering
    path already padded its rows and was not affected. Both helpers now pad the rows and strip the padding after the
    copy, and tests cover both at an unaligned width.

  • Text pipelines leaked a sampler when the clip layout arrived after first use — the MSDF and glyph-mask
    pipelines are rebuilt once the clip bind layout is set, and the rebuild created a new sampler over the old one,
    which then outlived the device (Vulkan validation: VUID-vkDestroyDevice-device-05137 on close). The sampler does
    not depend on the clip layout and is now kept across the rebuild.

  • Translucent image.RGBA drew too dark (#532, @kivutar) — Go's image.RGBA is premultiplied, but
    FromStdImage stored it as straight RGBA, so the alpha was applied twice. It is kept as premultiplied now, and
    other image types go through NRGBAModel.

  • Damage-path docs state the buffer-age contract — FlushGPUWithViewDamage, RenderDirectWithDamage and
    RenderDirectWithDamageRects keep the target image's own last contents outside the damage rect. With a rotating
    swapchain that image can be several frames old, so the caller unions the damage over the image's age.

Added

  • render.NullDeviceHandle implements Features() and DownlevelCapabilities() (#529), as the
    gpucontext v0.31 DeviceProvider requires; both return zero values.

Changed

  • Dependencies: wgpu v0.34.9, naga v0.21.4, gpucontext v0.31.3, gputypes v0.8.2, golang.org/x/image v0.45.0,
    golang.org/x/text v0.41.0 (the newest releases that keep the Go 1.25 minimum; later ones require Go 1.26).

  • Readback no longer issues manual texture barriers — wgpu v0.34.6+ transitions textures for copies itself, so
    the explicit TransitionTextures calls around the MSAA resolve readback are gone.

Known issues

  • GPU depth clip for arbitrary paths draws nothing inside the clip (examples/clip_path, circle and star clips): the clipped content is missing on the GPU path. It is not new in this release (earlier releases behave the same); rectangle and rounded-rectangle clips work. Tracked as P1-GPU-042 for the next release.