diff options
author | crowlKats <13135287+crowlKats@users.noreply.github.com> | 2021-04-23 11:18:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 11:18:32 +0200 |
commit | 6824ffb999c6e5bf4e58db60361eaf63dd3c57ec (patch) | |
tree | 90fb4fef6f88d55636e2aa7a3e6d5290727f0d30 /op_crates/webgpu/bundle.rs | |
parent | 1f821dd5e581228febc9b4410bb402646d5f2b13 (diff) |
fix(op_crates/webgpu): move non-null op buffer arg check when needed (#10319)
Diffstat (limited to 'op_crates/webgpu/bundle.rs')
-rw-r--r-- | op_crates/webgpu/bundle.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/op_crates/webgpu/bundle.rs b/op_crates/webgpu/bundle.rs index 72abb18e6..d33563118 100644 --- a/op_crates/webgpu/bundle.rs +++ b/op_crates/webgpu/bundle.rs @@ -138,8 +138,6 @@ pub fn op_webgpu_render_bundle_encoder_set_bind_group( args: RenderBundleEncoderSetBindGroupArgs, zero_copy: Option<ZeroCopyBuf>, ) -> Result<WebGpuResult, AnyError> { - let zero_copy = zero_copy.ok_or_else(null_opbuf)?; - let bind_group_resource = state .resource_table .get::<super::binding::WebGpuBindGroup>(args.bind_group) @@ -165,6 +163,7 @@ pub fn op_webgpu_render_bundle_encoder_set_bind_group( ); }, None => { + let zero_copy = zero_copy.ok_or_else(null_opbuf)?; let (prefix, data, suffix) = unsafe { zero_copy.align_to::<u32>() }; assert!(prefix.is_empty()); assert!(suffix.is_empty()); |