op cleanup

This commit is contained in:
crowlkats 2021-10-08 07:34:15 +02:00
parent 713f7fd7f2
commit 14092fff94
No known key found for this signature in database
GPG Key ID: 2DD18BFB0BA4B8E7
2 changed files with 3 additions and 8 deletions

View File

@ -1,6 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use deno_core::error::null_opbuf;
use deno_core::error::type_error;
use deno_core::error::AnyError;
use deno_core::futures::channel::oneshot;
@ -170,9 +169,8 @@ pub struct BufferGetMappedRangeArgs {
pub fn op_webgpu_buffer_get_mapped_range(
state: &mut OpState,
args: BufferGetMappedRangeArgs,
zero_copy: Option<ZeroCopyBuf>,
mut zero_copy: ZeroCopyBuf,
) -> Result<WebGpuResult, AnyError> {
let mut zero_copy = zero_copy.ok_or_else(null_opbuf)?;
let instance = state.borrow::<super::Instance>();
let buffer_resource = state.resource_table.get::<WebGpuBuffer>(args.buffer_rid)?;
let buffer = buffer_resource.0;

View File

@ -2,7 +2,6 @@
use std::num::NonZeroU32;
use deno_core::error::null_opbuf;
use deno_core::error::AnyError;
use deno_core::OpState;
use deno_core::ResourceId;
@ -74,9 +73,8 @@ pub struct QueueWriteBufferArgs {
pub fn op_webgpu_write_buffer(
state: &mut OpState,
args: QueueWriteBufferArgs,
zero_copy: Option<ZeroCopyBuf>,
zero_copy: ZeroCopyBuf,
) -> Result<WebGpuResult, AnyError> {
let zero_copy = zero_copy.ok_or_else(null_opbuf)?;
let instance = state.borrow::<super::Instance>();
let buffer_resource = state
.resource_table
@ -112,9 +110,8 @@ pub struct QueueWriteTextureArgs {
pub fn op_webgpu_write_texture(
state: &mut OpState,
args: QueueWriteTextureArgs,
zero_copy: Option<ZeroCopyBuf>,
zero_copy: ZeroCopyBuf,
) -> Result<WebGpuResult, AnyError> {
let zero_copy = zero_copy.ok_or_else(null_opbuf)?;
let instance = state.borrow::<super::Instance>();
let texture_resource = state
.resource_table