Files
craft-libs/docs
dotCooCoo 25cb33ed52 craft-gpu-wgpu: open the device through craft-gpu-device and read its loss from DeviceHealth
With `adapter-probe`, `WgpuContext::new` opens its device with
`craft_gpu_device::open` for `Preference::Auto`, so it takes the same adapter,
driver corrections and fallback order as other callers of that crate, and
`probe_caps()` reports the adapter `craft_gpu_device::pick` chooses. The
instance uses `craft_gpu_device::native_descriptor`'s backends (no OpenGL on
Windows) unless `WGPU_BACKEND` names others.

- `WgpuContext::from_opened` takes a `craft_gpu_device::Opened`, and
  `WgpuContext::with_device` takes a device, its queue and its `DeviceHealth`
  (for example egui's device). The caps are the device's own.
- The context no longer sets a device-lost callback. A loss is read from the
  device's `DeviceHealth`, including one another user of that health records,
  and `health()` returns it.
- `upload_buffer` and `request_read` also stop on any other fault the health
  records, as `GpuFault::Operation`, and allocation errors the context's error
  scopes catch are recorded in the health. `device_status()` still reports a
  loss only.
- When the device reports such an error while `read_buffer` waits, or the
  wait fails, the read is dropped and returns that error instead of polling
  until a map that may not complete.
- `adapter-probe` now depends on `craft-gpu-device`, which turns on wgpu's
  default native backends.
2026-11-20 10:47:00 -08:00
..