Repository navigation
v0.52.6
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.
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
govulncheckflags 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 forDraw,DrawIndexed,SetViewportandSetScissorRect
(gputypes.DrawArgs,DrawIndexedArgs,Viewport,ScissorRect), and gpucontext v0.31 changed
UpdateRegion. Every call site is migrated. -
ggcanvaspartial upload uses the stridedUpdateRegion(#529, @lkmavi) — damaged regions are
uploaded withgpucontext.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
checksDownlevelFlagsComputeShaders(from the sharedDeviceProvider, 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
inblend.wgslpassedstep(...)(avec3<f32>) toselect(), which WGSL requires to be
boolorvecN<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 —
CopyTextureToBufferneedsBytesPerRowto be
a multiple of 256, which wgpu checks since v0.34.7. The standaloneStencilRenderer.RenderPathand SDF pipeline
readback helpers usedwidth*4and 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-05137on close). The sampler does
not depend on the clip layout and is now kept across the rebuild. -
Translucent
image.RGBAdrew too dark (#532, @kivutar) — Go'simage.RGBAis premultiplied, but
FromStdImagestored it as straight RGBA, so the alpha was applied twice. It is kept as premultiplied now, and
other image types go throughNRGBAModel. -
Damage-path docs state the buffer-age contract —
FlushGPUWithViewDamage,RenderDirectWithDamageand
RenderDirectWithDamageRectskeep 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.NullDeviceHandleimplementsFeatures()andDownlevelCapabilities()(#529), as the
gpucontext v0.31DeviceProviderrequires; 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 explicitTransitionTexturescalls 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.