Skip to content

Releases: go-webgpu/webgpu

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

v0.2.1

09 Feb 10:08
1c8418c

Choose a tag to compare

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

29 Jan 14:21
04064eb

Choose a tag to compare

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/gputypes directly
    • Example: wgpu.TextureFormatBGRA8Unormgputypes.TextureFormatBGRA8Unorm
    • Enum values now match webgpu.h specification

✨ 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.TextureFormatBGRA8Unorm

Full Changelog: v0.1.4...v0.2.0

v0.1.4

03 Jan 07:23

Choose a tag to compare

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

29 Dec 09:44

Choose a tag to compare

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

27 Dec 13:26

Choose a tag to compare

Update goffi dependency v0.3.3 → v0.3.5

v0.1.1 - Hotfix

24 Dec 14:48
47393d7

Choose a tag to compare

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

Full Changelog

v0.1.0...v0.1.1