1
0
Fork 0
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:
crowlKats 2021-04-23 11:18:32 +02:00 committed by GitHub
parent 1f821dd5e5
commit 6824ffb999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -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());

View file

@ -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());