mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
don't call release_gpu_resources when losing the device
This removes the possibility of deadlocks happening since `release_gpu_resources` tries to lock resources (trackers, snatchable_lock, pending_writes, life_tracker) while they might be already locked; `handle_hal_error` is called in lots of places. Removing the call only delays destruction since `release_gpu_resources` is still called in `maintain`.
This commit is contained in:
parent
ece29b6e68
commit
c13fc3d141
@ -3916,12 +3916,9 @@ impl Device {
|
||||
// since that will prevent any new work from being added to the queues.
|
||||
// Future calls to poll_devices will continue to check the work queues
|
||||
// until they are cleared, and then drop the device.
|
||||
|
||||
// Eagerly release GPU resources.
|
||||
self.release_gpu_resources();
|
||||
}
|
||||
|
||||
pub(crate) fn release_gpu_resources(&self) {
|
||||
fn release_gpu_resources(&self) {
|
||||
// This is called when the device is lost, which makes every associated
|
||||
// resource invalid and unusable. This is an opportunity to release all of
|
||||
// the underlying gpu resources, even though the objects remain visible to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user