mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-26 01:11:22 +01:00
Remove unreachable code from `Global::queue_submit` that checks whether the resources used by the command buffer have a reference count of one, and adds them to `Device::temp_suspected` if so. When `queue_submit` is called, all the `Arc`s processed by this code have a reference count of at least three, even when the user has dropped the resource: - `Device::trackers` holds strong references to all the device's resources. - `CommandBufferMutable::trackers` holds strong references to all resources used by the command buffer. - The `used_resources` methods of the various members of `CommandBufferMutable::trackers` all return iterators of owned `Arc`s. Fortunately, since the `Global::device_drop_foo` methods all add the `foo` being dropped to `Device::suspected_resources`, and `LifetimeTracker::triage_suspected` does an adequate job of accounting for the uninteresting `Arc`s and leaves the resources there until they're actually dead, things do get cleaned up without the checks in `Global::queue_submit`. This allows `Device::temp_suspected` to be private to `device::resource`, with a sole remaining use in `Device::untrack`. Fixes #5647.