All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Update goffi v0.4.2 → v0.5.0 — Windows ARM64 (Snapdragon X) and FreeBSD amd64 support
- Update gputypes v0.2.0 → v0.3.0 —
TextureUsage.ContainsUnknownBits()method - Update golang.org/x/sys v0.41.0 → v0.42.0
- Update goffi v0.4.1 → v0.4.2 — purego compatibility fix (
nofakecgobuild tag for_cgo_initlinker collision) - Update golang.org/x/sys v0.40.0 → v0.41.0
- Update goffi v0.4.0 → v0.4.1 — ABI compliance hotfix (float32 encoding, stack spill for 7+ args, struct return, runtime.KeepAlive)
- Null handle guards on all public FFI methods — prevents SIGSEGV when passing nil/released objects
- 85 null guard tests (
TestNullGuard_*) — CI-safe, no GPU required WGPU_NATIVE_PATHenv var — override library path for custom wgpu-native locationsptrFromUintptrhelper — eliminates allgo vetunsafe.Pointer warnings in FFI code
loadLibrarynow returns(Library, error)— proper error propagation on init failure- Windows: eager DLL loading via
dll.Load()— errors atInit()instead of first FFI call Init()returns descriptive error messages with library path and override hint- CI: wgpu-native binary downloaded in all workflows — tests run against real library, no skips
- CI: removed
-unsafeptr=falsego vet workaround — all warnings properly fixed
- 15
go vetwarnings — allpossible misuse of unsafe.Pointereliminated viaptrFromUintptr - Silent library loading failures —
Init()now properly reports missing DLL/so/dylib
- goffi: v0.3.9 → v0.4.0 (crosscall2 integration for C-thread callbacks, fakecgo trampoline fixes)
- goffi: v0.3.8 → v0.3.9 (ARM64 callback trampoline fix, symbol rename to avoid linker collision)
- 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, may return error)
- Typed error system —
WGPUErrorwitherrors.Is()/errors.As()support - Sentinel errors —
ErrValidation,ErrOutOfMemory,ErrInternal,ErrDeviceLost - Resource leak detection —
SetDebugMode(true),ReportLeaks(), zero overhead when disabled - Thread safety documentation —
doc.gowith threading model, safe/unsafe operations - Fuzz testing — 14 fuzz targets for FFI boundary (enum conversions, struct sizes, math)
- API stability policy —
STABILITY.mdwith stable/experimental classification - Comprehensive godoc — all exported symbols documented for pkg.go.dev
- Release automation — GitHub Actions workflow for automated release on tag push
- Error-returning functions now use
checkInit()instead ofmustInit()panic PopErrorScopedeprecated in favor ofPopErrorScopeAsync- Package doc consolidated into single
doc.go(no more duplicate package comments) CONTRIBUTING.mdexpanded with architecture, error handling, fuzz testing, stability sections
- Struct size assertions for C ABI compatibility (DrawIndirectArgs, StringView, etc.)
- goffi: v0.3.7 → v0.3.8
- golang.org/x/sys: v0.39.0 → v0.40.0
- BREAKING: All WebGPU types now use
github.com/gogpu/gputypesdirectlyTextureFormat,BufferUsage,ShaderStage, etc. are now from gputypes- Enum values now match webgpu.h specification (fixes compatibility issues)
- Example:
wgpu.TextureFormatBGRA8Unorm→gputypes.TextureFormatBGRA8Unorm
- goffi: v0.3.7 (ARM64 Darwin improvements)
- Integration with gogpu ecosystem via gputypes
- Full webgpu.h spec compliance for enum values
- Comprehensive conversion layer (
wgpu/convert.go) for wgpu-native v27 compatibility- TextureFormat (~45 formats), VertexFormat (~30 formats)
- VertexStepMode, TextureSampleType, TextureViewDimension, StorageTextureAccess
- Wire structs with correct FFI padding (uint64 flags)
- TextureFormat enum values mismatch (BGRA8Unorm was 0x17, now correct 0x1B)
- Compatibility with gogpu Rust backend
- Struct padding in BindGroupLayout wire structs (sampler, texture, storage)
- PipelineLayout creation in examples (use CreatePipelineLayoutSimple)
- GetModuleHandleW: kernel32.dll instead of user32.dll (all Windows examples)
- Sampler MaxAnisotropy default (wgpu-native requires >= 1)
- Texture SampleCount/MipLevelCount defaults (wgpu-native requires >= 1)
- render_bundle shader: fallback without primitive_index (works on all GPUs)
Update imports in your code:
import (
"github.com/go-webgpu/webgpu/wgpu"
"github.com/gogpu/gputypes" // NEW
)
// Before:
config.Format = wgpu.TextureFormatBGRA8Unorm
// After:
config.Format = gputypes.TextureFormatBGRA8Unorm- goffi: v0.3.1 → v0.3.3 (PointerType argument passing hotfix)
- golang.org/x/sys: v0.38.0 → v0.39.0
- Critical bug in PointerType argument passing (goffi#4)
- Branch protection enabled for
main - All changes now require Pull Requests
- Updated CONTRIBUTING.md with PR workflow
- WebGPU Instance, Adapter, Device creation
- Buffer creation and management (MapAsync, GetMappedRange, Unmap)
- Texture creation and management (2D, depth, render targets)
- Sampler API with filtering and address modes
- Shader module compilation (WGSL)
- Compute Pipeline with workgroups
- Render Pipeline with vertex/fragment stages
- Pipeline Layout and Bind Group Layout
- Bind Groups for resource binding
- Command Encoder and Queue submission
- Render Pass with color and depth attachments
- Vertex buffers with custom layouts
- Index buffers (Uint16, Uint32)
- Depth buffer support (DepthStencilState)
- MRT (Multiple Render Targets) support
- RenderBundle API for pre-recording render commands
- Instanced rendering (VertexStepModeInstance)
- Indirect drawing (DrawIndirect, DrawIndexedIndirect)
- Indirect compute dispatch (DispatchWorkgroupsIndirect)
- QuerySet API for GPU timestamps
- Error Handling API (PushErrorScope, PopErrorScope)
- Windows support via syscall.LazyDLL
- Linux support via goffi (CGO_ENABLED=0)
- macOS support via goffi (CGO_ENABLED=0)
- Platform-specific Surface creation (HWND, X11, Wayland, Metal)
- Mat4 (4x4 matrix) with Identity, Translate, Scale, Rotate, Perspective, LookAt
- Vec3, Vec4 vector types with common operations
- Triangle (basic rendering)
- Colored triangle (vertex colors)
- Rotating triangle (uniform buffers)
- Textured quad (texture sampling)
- 3D cube (depth buffer, transforms)
- MRT (multiple render targets)
- Compute shader (parallel processing)
- Instanced rendering (25 objects in 1 draw call)
- RenderBundle (pre-recorded commands)
- Timestamp query (GPU timing)
- Error handling (error scopes)
- Zero-CGO architecture using goffi for FFI
- GitHub Actions CI/CD (Linux, macOS, Windows)
- golangci-lint configuration for FFI code
- Pre-release validation script
- Comprehensive test suite (76+ tests)
- github.com/go-webgpu/goffi v0.3.1
- wgpu-native v24.0.3.1