mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
op cleanup
This commit is contained in:
parent
713f7fd7f2
commit
14092fff94
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user