mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 17:01:15 +01:00
Convert Tests to Use Async Poll (#5053)
* Convert Tests to Use Async Poll * Update examples/src/repeated_compute/mod.rs Co-authored-by: Andreas Reich <r_andreas2@web.de> --------- Co-authored-by: Andreas Reich <r_andreas2@web.de>
This commit is contained in:
1 parent
5fd7d228ad
commit
ad625f433f
48 files changed
+479
-325
No files matched your search
@@ -172,7 +172,7 @@ async fn get_data<T: bytemuck::Pod>(
|
||||
let buffer_slice = staging_buffer.slice(..);
|
||||
let (sender, receiver) = flume::bounded(1);
|
||||
buffer_slice.map_async(wgpu::MapMode::Read, move |r| sender.send(r).unwrap());
|
||||
device.poll(wgpu::Maintain::Wait);
|
||||
device.poll(wgpu::Maintain::wait()).panic_on_timeout();
|
||||
receiver.recv_async().await.unwrap().unwrap();
|
||||
output.copy_from_slice(bytemuck::cast_slice(&buffer_slice.get_mapped_range()[..]));
|
||||
staging_buffer.unmap();
|
||||
|
||||
Reference in new issue
Block a user