summaryrefslogtreecommitdiff
path: root/ext/webgpu/src/buffer.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-03-14 23:14:15 +0530
committerGitHub <noreply@github.com>2022-03-14 18:44:15 +0100
commitb4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch)
tree10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /ext/webgpu/src/buffer.rs
parent4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff)
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'ext/webgpu/src/buffer.rs')
-rw-r--r--ext/webgpu/src/buffer.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/webgpu/src/buffer.rs b/ext/webgpu/src/buffer.rs
index 3f2c07883..ce3a78d01 100644
--- a/ext/webgpu/src/buffer.rs
+++ b/ext/webgpu/src/buffer.rs
@@ -3,6 +3,8 @@
use deno_core::error::type_error;
use deno_core::error::AnyError;
use deno_core::futures::channel::oneshot;
+use deno_core::op;
+
use deno_core::OpState;
use deno_core::Resource;
use deno_core::ResourceId;
@@ -40,6 +42,7 @@ pub struct CreateBufferArgs {
mapped_at_creation: bool,
}
+#[op]
pub fn op_webgpu_create_buffer(
state: &mut OpState,
args: CreateBufferArgs,
@@ -76,6 +79,7 @@ pub struct BufferGetMapAsyncArgs {
size: u64,
}
+#[op]
pub async fn op_webgpu_buffer_get_map_async(
state: Rc<RefCell<OpState>>,
args: BufferGetMapAsyncArgs,
@@ -167,6 +171,7 @@ pub struct BufferGetMappedRangeArgs {
size: Option<u64>,
}
+#[op]
pub fn op_webgpu_buffer_get_mapped_range(
state: &mut OpState,
args: BufferGetMappedRangeArgs,
@@ -204,6 +209,7 @@ pub struct BufferUnmapArgs {
mapped_rid: ResourceId,
}
+#[op]
pub fn op_webgpu_buffer_unmap(
state: &mut OpState,
args: BufferUnmapArgs,