mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
fix(op_crates/webgpu): move non-null op buffer arg check when needed (#10319)
This commit is contained in:
parent
1f821dd5e5
commit
6824ffb999
2 changed files with 2 additions and 3 deletions
|
@ -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());
|
||||
|
|
|
@ -327,7 +327,6 @@ pub fn op_webgpu_render_pass_set_bind_group(
|
|||
args: RenderPassSetBindGroupArgs,
|
||||
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)
|
||||
|
@ -353,6 +352,7 @@ pub fn op_webgpu_render_pass_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());
|
||||
|
|
Loading…
Reference in a new issue