Skip to content

Releases: go-webgpu/webgpu

v0.5.2

27 May 10:15

Choose a tag to compare

go-webgpu v0.5.2

Setup tool enterprise hardening — security, correctness, and UX improvements.

Security

  • HTTP download timeout (120s) — prevents hanging on network issues
  • Decompression bomb protection (200MB io.LimitReader)
  • HTTP status code validation (404/500 errors properly reported)

Correctness

  • dst.Close() error checked on write path — prevents corrupted library on Windows
  • macOS prints DYLD_LIBRARY_PATH (was incorrectly LD_LIBRARY_PATH)
  • wgpu.Init() auto-discovers ./lib/ directory — zero-config after cmd/setup

UX

  • Download progress indicator with file size (MB)
  • README: WGPU_NATIVE_PATH instructions for all platforms after auto-setup

Tests

  • 10 new tests: Download (happy/404/network), FindLibrary (env/missing/lib-dir)

Full Changelog: v0.5.1...v0.5.2

v0.5.1

27 May 09:36
dfbca02

Choose a tag to compare

What's Changed

Features

  • auto-setup tool + docs update (v0.5.1)

Full Changelog: v0.5.0...v0.5.1

v0.5.0

26 May 21:42
36e2d05

Choose a tag to compare

go-webgpu v0.5.0

Major release: wgpu-native v29 + full gogpu/wgpu API compatibility

This is the largest release since v0.1.0 — a complete API overhaul for ecosystem compatibility.

Highlights

  • wgpu-native v29.0.0.0 — stable webgpu-headers (resolves #3)
  • Go-idiomatic APIstring labels, bool, typed *T pointers, (*T, error) returns
  • gogpu/wgpu compatible — descriptor structs, method signatures, type aliases match
  • Context-aware buffer mappingBuffer.Map(ctx), async MapPending, type-safe MappedRange
  • Queue submission trackingSubmit() returns (uint64, error) via wgpuQueueSubmitForIndex
  • 271 ABI verification tests — struct sizes, field offsets, enum values

Breaking Changes

See MIGRATION.md for a complete before/after migration guide.

API redesign:

  • All Create* methods return (*T, error) instead of *T
  • Descriptors: Go-idiomatic (no more NextInChain, StringView, uintptr)
  • Methods renamed: GetQueue()Queue(), GetSize()Size(), GetLimits()Limits()
  • Limits returned as cached value (no pointer, no error)
  • BindGroupLayoutEntry uses pointer sub-layouts (*BufferBindingLayout)
  • SamplerDescriptor.MaxAnisotropyAnisotropy

Surface API:

  • Surface.Configure(device, config) error — device as separate arg
  • Surface.GetCurrentTexture() returns (*SurfaceTexture, bool, error) with suboptimal flag
  • Surface.Present(texture) error

Buffer mapping:

  • Buffer.MapAsync returns (*MapPending, error) — truly async
  • Buffer.Unmap() returns error
  • Queue.Submit returns (uint64, error)

Enums/types (v29):

  • SurfaceGetCurrentTextureStatus simplified (OutOfMemory/DeviceLost → Error)
  • InstanceFlag_Default = 1 << 24 (was 0)
  • DX11 backend removed
  • PushConstants → Immediates rename

Added

  • Buffer.Map(ctx, mode, offset, size) — context-aware blocking
  • Buffer.MappedRange(offset, size)*MappedRange with Bytes()
  • MapPending with Status() and Wait(ctx)
  • ImageCopyTexture, ImageDataLayout, BufferTextureCopy, TextureCopy
  • Region-based CopyTextureToBuffer / CopyTextureToTexture
  • gputypes type aliases + 186 re-exported constants (single-import UX)
  • New v29 APIs: instance features/limits, buffer read/write mapped range, texture getters

Documentation

Dependencies

Dependency Version
wgpu-native v29.0.0.0 (was v27.0.4.0)
goffi v0.5.0
gputypes v0.3.0

v0.4.3

29 Mar 12:28
f095b30

Choose a tag to compare

Dependencies

  • goffi v0.4.2 → v0.5.0 — Windows ARM64 (Snapdragon X) and FreeBSD amd64 support (7 platforms total)
  • gputypes v0.2.0 → v0.3.0 — TextureUsage.ContainsUnknownBits() method
  • golang.org/x/sys v0.41.0 → v0.42.0

v0.4.2

04 Mar 14:45
22cd507

Choose a tag to compare

Dependencies

  • goffi v0.4.1 → v0.4.2 — purego compatibility fix (nofakecgo build tag for _cgo_init linker collision when goffi and purego coexist)
  • golang.org/x/sys v0.40.0 → v0.41.0

v0.4.1

02 Mar 06:13
e377f6b

Choose a tag to compare

What's Changed

Dependency Update

  • goffi v0.4.0 → v0.4.1 — ABI compliance hotfix

goffi v0.4.1 Highlights

  • Float32 argument encoding bugmath.Float32bits fix for correct XMM bit patterns
  • AMD64 Unix: stack spill for 7+ arguments — args beyond 6 GP registers now pushed to stack
  • ARM64 Unix: stack spill for 9+ arguments — args beyond 8 GP registers now pushed to stack
  • AMD64 struct return 9-16 bytes — RAX+RDX register pair correctly assembled
  • AMD64 sret hidden pointer — structs >16B use caller buffer as first arg (RDI)
  • ARM64 HFA stack spill — HFA overflow correctly spills per AAPCS64
  • runtime.KeepAlive — prevents GC of argument pointers during FFI calls
  • Overflow detectionErrTooManyArguments for >15 args

See goffi v0.4.1 release notes for details.


Full Changelog: v0.4.0...v0.4.1

v0.4.0

27 Feb 13:48
5c78684

Choose a tag to compare

What's Changed

FFI Hardening

  • Null handle guards on all public FFI methods (27 files) — prevents SIGSEGV when passing nil or released objects to wgpu-native
  • ptrFromUintptr helper — eliminates all 15 pre-existing go vet unsafe.Pointer warnings via double-indirection pattern
  • 85 new tests (TestNullGuard_*) — comprehensive coverage for every guard, CI-safe

Library Loading Improvements

  • WGPU_NATIVE_PATH env var — override library search path for custom wgpu-native locations
  • loadLibrary returns (Library, error) — proper error propagation instead of silent failures
  • Windows: eager DLL loading via dll.Load() — errors surface at Init(), not at first FFI call
  • Descriptive error messagesInit() reports library path tried and suggests WGPU_NATIVE_PATH override

CI Improvements

  • wgpu-native binary downloaded in all CI workflows — tests run against real library, no skips
  • Removed -unsafeptr=false go vet workaround — all warnings properly fixed
  • WGPU_NATIVE_PATH env propagated via GITHUB_ENV for cross-step visibility

Bug Fixes

  • 15 go vet "possible misuse of unsafe.Pointer" warnings eliminated
  • Silent library loading failures now properly reported

Full Changelog: v0.3.2...v0.4.0

v0.3.2

27 Feb 09:43
f8bbcbf

Choose a tag to compare

What's Changed

Dependencies

  • goffi: v0.3.9 → v0.4.0
    • crosscall2 integration — callbacks now work from C-library-created threads (Metal, wgpu-native)
    • fakecgo trampoline register fixes synced with purego v0.10.0

This is a significant upgrade for callback reliability, especially on macOS (Metal) and ARM64 platforms.


Full Changelog: v0.3.1...v0.3.2

v0.3.1

18 Feb 11:38
77b9e53

Choose a tag to compare

What's Changed

Dependencies

  • goffi: v0.3.8 → v0.3.9
    • ARM64 callback trampoline rewrite — fixes LR corruption for callbacks at index > 0
    • Symbol rename to avoid linker collision with purego

If you use goffi callbacks on ARM64 (macOS Apple Silicon / Linux ARM64), this update is strongly recommended.


Full Changelog: v0.3.0...v0.3.1

v0.3.0

09 Feb 10:14

Choose a tag to compare

What's Changed

Enterprise-level quality improvements for production readiness.

Features

  • Surface.GetCapabilities() — query supported formats, present modes, alpha modes
  • Device.GetFeatures() — enumerate all features enabled on the device
  • Device.HasFeature() — check if a specific feature is enabled
  • Device.GetLimits() — retrieve device limits (experimental)
  • Typed error systemWGPUError with errors.Is()/errors.As() support
  • Sentinel errorsErrValidation, ErrOutOfMemory, ErrInternal, ErrDeviceLost
  • Resource leak detectionSetDebugMode(true) + ReportLeaks(), zero overhead when disabled

Quality & Safety

  • Zero-panic pathscheckInit() for all error-returning functions
  • Thread safety documentationdoc.go with threading model, safe/unsafe operations
  • Fuzz testing — 14 fuzz targets for FFI boundary, 3M+ iterations zero failures
  • Comprehensive godoc — all 300+ exported symbols documented for pkg.go.dev

Infrastructure

  • API stability policySTABILITY.md with stable/experimental/internal classification
  • Release automation — GitHub Actions workflow triggered on v* tags
  • CONTRIBUTING.md — expanded with architecture, error handling, fuzz testing sections

Deprecations

  • Device.PopErrorScope → use PopErrorScopeAsync instead

Dependencies

  • goffi v0.3.8
  • wgpu-native v27.0.4.0

Full Changelog: v0.2.1...v0.3.0