After an out-of-memory error, `poll`, `wait` and the bounded waits still
run, so staging memory is reclaimed. `clear_out_of_memory` takes the count
from `out_of_memory_count` and clears only the errors seen up to it, so an
error that arrives while memory is freed stays recorded. A loss or another
error still stops polls and waits, also when an out-of-memory error
follows it.
A fault's text now holds wgpu's heading and each cause on one line, for
example "Validation Error: In Queue::submit: Buffer 'pc' has been
destroyed", instead of only "Validation Error". The text is built up to
200 characters without joining the whole message first.
`wait_slices` takes the elapsed time from a closure. The wait uses the
system clock, and the tests use a clock that does not move or one that
advances by each slice, so their results do not depend on scheduling.
pick now returns OpenError instead of a String, so a caller can tell
UnsafeDriver from NoAdapter. With no usable adapter it logs the listed
adapters and returns NoAdapter. egui-wgpu's selector takes a String, so
that caller converts with map_err(|e| e.to_string()).
The crate docs and README now say what applies in a browser: WebGPU
lists only the adapter the browser offers, a web build requests it with
Preference::power(), and Capabilities, Recovery and DeviceHealth (apart
from its blocking waits) work there.
Preference::Software took the first usable software entry without the
correction Auto, LowPower and Adapter apply. When one driver listed a
software adapter twice, a stale version could be chosen, and the fallback
order then left the newer one out. Every preference now goes through the
same correction.
- wait_timeout and wait_timeout_cancelable take a submission index
instead of an Option. Every 100 ms slice waits for that index, so
work submitted during the wait no longer moves the target and can no
longer make a healthy device time out. Pass queue.submit([]) to wait
for everything submitted so far.
- An uncaptured error counts as a device loss only when an error in
its source chain is wgpu's "Parent device is lost". A resource label
that contains those words, on its own line or not, is recorded as an
error.
Adds the adapter preference (Auto, low power, a named adapter, software)
with a key that survives a reordered adapter list and a driver update,
wgpu's adapter rule with corrections for drivers that crash, a ranked
fallback order ending in a software adapter, a capability report, and
device health that records a loss or an uncaptured error without a lock.