Skip to content

Conversation

aneeshdurg
Copy link

No description provided.

@@ -118,16 +126,19 @@ async fn run_collatz_shader(input: &[u8]) -> Result<Vec<u32>, BufferAsyncError>

queue.submit(Some(encoder.finish()));
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant