Repository navigation
v0.34.14 — default backend registration, wgputest and Device.CheckHealth
A registration patch: the platform hardware backends register by default, the wgputest test seam and
Device.CheckHealth are new, and DX12 device-removal errors match wgpu.ErrDeviceLost.
Added
-
The platform hardware backends register by default (LEAD-007, ADR-083 Phase 0). Importing
github.com/gogpu/wgpuregisters Vulkan, DX12 and OpenGL ES on Windows (386, amd64, arm64), Vulkan and OpenGL ES on Linux (amd64, arm64), Metal on macOS (amd64, arm64; MoltenVK only with-tags wgpu_moltenvk), and Vulkan and OpenGL ES on Android (arm64). Other GOOS/GOARCH combinations are outside the default set and register no backends, as before; some of them cannot build the Pure Go backends at all because goffi has no syscall files there. The blank import ofhal/allbackendsis no longer required for the hardware backends; it stays valid untilhalmoves underinternal/in v0.35.0. Opt out per backend withwgpu_novulkan,wgpu_nodx12,wgpu_nometalandwgpu_nogles.The Pure Go software backend is not registered by default in this release. It stays an explicit import (
hal/softwareorhal/allbackends) until v0.35.0, where the software bit and the removal of the BackendEmpty mask bypass make it default-registered outside the default adapter mask. Keeping it explicit is what makes this release invariant for every existing program: a program that imported one backend, or one that is absent on the machine, keeps the same adapters and the same no-adapter result.wgpu_nosoftwarenow compiles the software backend out ofwgputest's software constructor; from v0.35.0 it also removes it from the default registration. -
wgputest, a public test seam.NewSoftwareDeviceandNewNoopDevicereturn a device, its queue and a cleanup. The noop device records encoder, buffer, texture, pass, bind (with the buffer's label and size), draw and submit calls (a globalSeq, the enclosing pass and the creating encoder) and injects faults onCreateCommandEncoderandWriteBuffer. It never skips: a backend missing from the build is reported aswgputest.ErrUnavailable. -
Device.CheckHealth()reports a lost or unhealthy device. A lost-device error satisfieserrors.Is(err, wgpu.ErrDeviceLost). DX12 implements the check today; other backends return nil.
Changed
- A program that imported a single backend (or none) now sees every platform hardware backend, so a plain
RequestAdapterpicks hardware first. That is the one intended behaviour change of this release. Withhal/softwareimported,RequestAdapterOptions.ForceFallbackAdapterstill forces the software backend untilBackendsSoftwarelands in v0.35.0. - On macOS, dropping the
hal/allbackendsimport loses Vulkan (MoltenVK). Default registration on darwin is Metal only; MoltenVK Vulkan is opt-in with-tags wgpu_moltenvk.GOOS=iossatisfies the darwin build tag, so iOS builds in the default set register Metal. - Consumer CI matrices change: tests that skipped for lack of a registered backend now run. Request the backend a test needs through the
Backendsmask — the software backend is not registered by default in this release, so in a program that does not import it a mask names exactly the hardware backends in it — and let its absence fail through the repository's require switch. A test binary that importswgputestis the exception: the package importshal/software, which registers software for the whole binary even when onlyNewNoopDeviceis called, and until v0.35.0 theBackendEmptyrule admits software whatever mask is requested. Mask-and-skip tests that adoptwgputestmust account for that. hal/noopno longer registers itself ininit. It shares theBackendEmptyvariant with the Pure Go software backend, which registers when imported (and by default from v0.35.0), so an automatic registration could replace software depending on package initialization order. Callnoop.Register()explicitly where the global HAL registry needs the noop backend;wgputest.NewNoopDeviceuses a private instance and needs no registration.
Fixed
- A DX12 device-removal error satisfies
errors.Is(err, wgpu.ErrDeviceLost): the removal reason and the device-lost sentinel are joined.
Full changelog: v0.34.13...v0.34.14