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:
teoxoy 2025-04-02 15:35:36 +02:00 committed by Teodor Tanasoaia
parent ece29b6e68
commit c13fc3d141

View File

@ -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