wgpu
wgpu copied to clipboard
start-capture (and probably stop-capture) are unsound
Description Currently, wgpu-core (effectively) just calls start-capture on the raw underlying device without performing any checks.
From @kvark
we could document the safety requirements for start_capture as:
- device should be a valid device that's not lost
- no capture needs to be already in progress
Device loss is covered https://github.com/gfx-rs/wgpu/issues/1624. The start/stop capture thing is a separate issue that is probably more straightforward to fix.
57f8757fadf36b833714488fea8663ef8b0257eb (https://github.com/gfx-rs/wgpu/pull/4163) added device validity checks for start/stop capture.
But we still don't validate if a capture in progress.