v0.21.0
GPU Handles: Interface → Struct Tokens (BREAKING)
Device, Queue, Adapter, Surface, Instance changed from interfaces to opaque struct tokens wrapping unsafe.Pointer.
Why
v0.20.0 used unexported sentinel methods on interfaces, but Go spec prohibits cross-package satisfaction of interfaces with unexported methods. *wgpu.Device could never implement gpucontext.Device — build broke in gogpu/gg/ui. v0.20.0 is yanked.
New Pattern
Same as existing TextureView and CommandEncoder (ADR-018):
- 8 bytes, value type, zero allocations
- GC-safe:
unsafe.Pointerin struct fields is traced by GC (reflect.Valueprecedent) - Compile-time type distinct:
Device≠Queue≠Adapter
Migration
// Before (v0.19.0):
dev := provider.Device() // interface
wgpuDev := dev.(*wgpu.Device) // type assertion
// After (v0.21.0):
dev := provider.Device() // struct
wgpuDev := (*wgpu.Device)(dev.Pointer()) // unsafe.Pointer extraction
// Nil check: dev != nil → !dev.IsNil()Full Changelog: v0.20.0...v0.21.0