webgpu: Use safe callbacks & try_recv_timeout (#32008)

* Use safe callback in SwapChainPresent and remove present_buffer_maps

* Use rust closure in BufferMapAsync

* Remove buffer_maps and dead code elimination

* scope id passthrough

* Inline callbacks

* try_recv timeout and halve DEVICE_POLL_INTERVAL
This commit is contained in:
Samson 2024-04-30 13:47:57 +02:00 committed by GitHub
parent 1e186e9251
commit b6748db69d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 95 additions and 174 deletions

View file

@ -382,15 +382,5 @@ impl AsyncWGPUListener for GPUBuffer {
None => unreachable!("Failed to get a response for BufferMapAsync"),
}
*self.map_promise.borrow_mut() = None;
if let Err(e) = self
.channel
.0
.send((None, WebGPURequest::BufferMapComplete(self.buffer.0)))
{
warn!(
"Failed to send BufferMapComplete({:?}) ({})",
self.buffer.0, e
);
}
}
}