Skip to content

Conversation

@aneeshdurg
Copy link

No description provided.

let buffer_slice = readback_buffer.slice(..);
let buffer_future = buffer_slice.map_async(wgpu::MapMode::Read);
let (resolver, waiter) = oneshot::channel();
buffer_slice.map_async(wgpu::MapMode::Read, move |res| {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still learning about rust's async apis, so I'm not sure if this was the best way to express this. wgpu::Buffer::map_async has changed and no longer returns a future, but takes a callback to run instead. I'm using oneshot::channel to get a Future that will resolve only after the callback is invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant