diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-05-05 07:22:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-05 07:22:18 -0700 |
commit | cd12d416271e9e9fd0f00303525021f75688ff9f (patch) | |
tree | af1fd7a88590e37b09e61ae5a1aaeec4c325b907 /ext/webgpu/buffer.rs | |
parent | b2628e4a069ed9fc13f34f6e4fd75f29c657e5a9 (diff) |
chore: update wgpu (#23684)
Diffstat (limited to 'ext/webgpu/buffer.rs')
-rw-r--r-- | ext/webgpu/buffer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/webgpu/buffer.rs b/ext/webgpu/buffer.rs index 2866b29f7..2887f3812 100644 --- a/ext/webgpu/buffer.rs +++ b/ext/webgpu/buffer.rs @@ -26,8 +26,7 @@ impl Resource for WebGpuBuffer { } fn close(self: Rc<Self>) { - let instance = &self.0; - gfx_select!(self.1 => instance.buffer_drop(self.1, true)); + gfx_select!(self.1 => self.0.buffer_drop(self.1, true)); } } @@ -65,7 +64,7 @@ pub fn op_webgpu_create_buffer( gfx_put!(device => instance.device_create_buffer( device, &descriptor, - () + None ) => state, WebGpuBuffer) } @@ -100,14 +99,15 @@ pub async fn op_webgpu_buffer_get_map_async( // TODO(lucacasonato): error handling let maybe_err = gfx_select!(buffer => instance.buffer_map_async( buffer, - offset..(offset + size), + offset, + Some(size), wgpu_core::resource::BufferMapOperation { host: match mode { 1 => wgpu_core::device::HostMap::Read, 2 => wgpu_core::device::HostMap::Write, _ => unreachable!(), }, - callback: wgpu_core::resource::BufferMapCallback::from_rust(callback), + callback: Some(wgpu_core::resource::BufferMapCallback::from_rust(callback)), } )) .err(); @@ -124,7 +124,7 @@ pub async fn op_webgpu_buffer_get_map_async( { let state = state.borrow(); let instance = state.borrow::<super::Instance>(); - gfx_select!(device => instance.device_poll(device, wgpu_types::Maintain::Wait)) + gfx_select!(device => instance.device_poll(device, wgpu_types::Maintain::wait())) .unwrap(); } tokio::time::sleep(Duration::from_millis(10)).await; |