Releases: go-webgpu/webgpu
Releases · go-webgpu/webgpu
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
v0.2.1
What's Changed
Dependencies
- goffi: v0.3.7 → v0.3.8
- golang.org/x/sys: v0.39.0 → v0.40.0
Full Changelog: v0.2.0...v0.2.1
v0.2.0: gputypes integration
gputypes Integration Release
This release integrates go-webgpu with the gogpu ecosystem through github.com/gogpu/gputypes.
⚠️ Breaking Changes
- All WebGPU types now use
github.com/gogpu/gputypesdirectly- Example:
wgpu.TextureFormatBGRA8Unorm→gputypes.TextureFormatBGRA8Unorm - Enum values now match webgpu.h specification
- Example:
✨ Added
- Integration with gogpu ecosystem via gputypes
- Full webgpu.h spec compliance for enum values
- Comprehensive conversion layer for wgpu-native v27 compatibility
- TextureFormat (~45 formats), VertexFormat (~30 formats)
- Wire structs with correct FFI padding (uint64 flags)
🐛 Fixed
- TextureFormat enum values mismatch (BGRA8Unorm was 0x17, now correct 0x1B)
- Compatibility with gogpu Rust backend
- All 11 examples now work correctly
📦 Dependencies
- goffi v0.3.7 (ARM64 Darwin improvements)
- wgpu-native v27.0.4.0
Migration Guide
// Before (v0.1.x)
import "github.com/go-webgpu/webgpu/wgpu"
format := wgpu.TextureFormatBGRA8Unorm
// After (v0.2.0)
import (
"github.com/go-webgpu/webgpu/wgpu"
"github.com/gogpu/gputypes"
)
format := gputypes.TextureFormatBGRA8UnormFull Changelog: v0.1.4...v0.2.0
v0.1.4
ARM64 Darwin Improvements
Update goffi v0.3.6 → v0.3.7
Improved
- Comprehensive ARM64 Darwin support — tested on M3 Pro hardware
- Nested struct handling — proper layout for complex struct types
- Mixed integer/float struct support — automatic struct layout computation
- Struct returns 9-16 bytes — Call8Float now returns both X0 and X1 registers
Fixed
- Segmentation fault in string output benchmarks on Darwin
Contributors
- @ppoage — ARM64 Darwin implementation, Objective-C test suite, assembly verification
v0.1.3
ARM64 HFA Fix
Update goffi v0.3.5 → v0.3.6
Fixed
- ARM64 HFA returns — NSRect (4×float64) now correctly returns all values on Apple Silicon
- Large struct returns — Structs >16 bytes properly use X8 register for implicit pointer passing
- Blank window on macOS ARM64 — GPU dimensions no longer return 0×0
Fixes gogpu#24
v0.1.2
v0.1.1 - Hotfix
Summary
Hotfix release with critical dependency update and infrastructure improvements.
Changed
- goffi: v0.3.1 → v0.3.3 (PointerType argument passing hotfix)
- golang.org/x/sys: v0.38.0 → v0.39.0
Fixed
- Critical bug in PointerType argument passing (goffi#4)
Infrastructure
- Branch protection enabled for
main - All changes now require Pull Requests
- Updated CONTRIBUTING.md with PR workflow
Upgrade
go get github.com/go-webgpu/webgpu@v0.1.1