Releases: go-webgpu/webgpu
v0.5.2
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
v0.5.0
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 API —
stringlabels,bool, typed*Tpointers,(*T, error)returns - gogpu/wgpu compatible — descriptor structs, method signatures, type aliases match
- Context-aware buffer mapping —
Buffer.Map(ctx), asyncMapPending, type-safeMappedRange - Queue submission tracking —
Submit()returns(uint64, error)viawgpuQueueSubmitForIndex - 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() Limitsreturned as cached value (no pointer, no error)BindGroupLayoutEntryuses pointer sub-layouts (*BufferBindingLayout)SamplerDescriptor.MaxAnisotropy→Anisotropy
Surface API:
Surface.Configure(device, config) error— device as separate argSurface.GetCurrentTexture()returns(*SurfaceTexture, bool, error)with suboptimal flagSurface.Present(texture) error
Buffer mapping:
Buffer.MapAsyncreturns(*MapPending, error)— truly asyncBuffer.Unmap()returnserrorQueue.Submitreturns(uint64, error)
Enums/types (v29):
SurfaceGetCurrentTextureStatussimplified (OutOfMemory/DeviceLost → Error)InstanceFlag_Default=1 << 24(was 0)- DX11 backend removed
- PushConstants → Immediates rename
Added
Buffer.Map(ctx, mode, offset, size)— context-aware blockingBuffer.MappedRange(offset, size)→*MappedRangewithBytes()MapPendingwithStatus()andWait(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
- MIGRATION.md — complete v0.4.x → v0.5.0 guide
- docs/ARCHITECTURE.md — FFI architecture, convert.go rationale
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
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
Dependencies
- goffi v0.4.1 → v0.4.2 — purego compatibility fix (
nofakecgobuild tag for_cgo_initlinker collision when goffi and purego coexist) - golang.org/x/sys v0.40.0 → v0.41.0
v0.4.1
What's Changed
Dependency Update
- goffi v0.4.0 → v0.4.1 — ABI compliance hotfix
goffi v0.4.1 Highlights
- Float32 argument encoding bug —
math.Float32bitsfix 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 detection —
ErrTooManyArgumentsfor >15 args
See goffi v0.4.1 release notes for details.
Full Changelog: v0.4.0...v0.4.1
v0.4.0
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
ptrFromUintptrhelper — eliminates all 15 pre-existinggo vetunsafe.Pointer warnings via double-indirection pattern- 85 new tests (
TestNullGuard_*) — comprehensive coverage for every guard, CI-safe
Library Loading Improvements
WGPU_NATIVE_PATHenv var — override library search path for custom wgpu-native locationsloadLibraryreturns(Library, error)— proper error propagation instead of silent failures- Windows: eager DLL loading via
dll.Load()— errors surface atInit(), not at first FFI call - Descriptive error messages —
Init()reports library path tried and suggestsWGPU_NATIVE_PATHoverride
CI Improvements
- wgpu-native binary downloaded in all CI workflows — tests run against real library, no skips
- Removed
-unsafeptr=falsego vet workaround — all warnings properly fixed WGPU_NATIVE_PATHenv propagated viaGITHUB_ENVfor 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
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
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
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 system —
WGPUErrorwitherrors.Is()/errors.As()support - Sentinel errors —
ErrValidation,ErrOutOfMemory,ErrInternal,ErrDeviceLost - Resource leak detection —
SetDebugMode(true)+ReportLeaks(), zero overhead when disabled
Quality & Safety
- Zero-panic paths —
checkInit()for all error-returning functions - Thread safety documentation —
doc.gowith 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 policy —
STABILITY.mdwith 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→ usePopErrorScopeAsyncinstead
Dependencies
- goffi v0.3.8
- wgpu-native v27.0.4.0
Full Changelog: v0.2.1...v0.3.0