summaryrefslogtreecommitdiff
path: root/ext/webgpu/shader.rs
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2022-01-24 23:47:05 +0100
committerGitHub <noreply@github.com>2022-01-24 23:47:05 +0100
commitbd5d445da98435d03e2f6a6f6d5478ff623bd714 (patch)
treea3b43fe0a33048b6eaa4d8adf736545f740bb423 /ext/webgpu/shader.rs
parentbc8de78da3c37bb5ce70547a7d3a3576d1a7734f (diff)
chore: re-enable wgpu_sync (#13453)
Diffstat (limited to 'ext/webgpu/shader.rs')
-rw-r--r--ext/webgpu/shader.rs51
1 files changed, 0 insertions, 51 deletions
diff --git a/ext/webgpu/shader.rs b/ext/webgpu/shader.rs
deleted file mode 100644
index 2477beceb..000000000
--- a/ext/webgpu/shader.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
-
-use deno_core::error::AnyError;
-use deno_core::ResourceId;
-use deno_core::{OpState, Resource};
-use serde::Deserialize;
-use std::borrow::Cow;
-
-use super::error::WebGpuResult;
-
-pub(crate) struct WebGpuShaderModule(pub(crate) wgpu_core::id::ShaderModuleId);
-impl Resource for WebGpuShaderModule {
- fn name(&self) -> Cow<str> {
- "webGPUShaderModule".into()
- }
-}
-
-#[derive(Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct CreateShaderModuleArgs {
- device_rid: ResourceId,
- label: Option<String>,
- code: String,
- _source_map: Option<()>, // not yet implemented
-}
-
-pub fn op_webgpu_create_shader_module(
- state: &mut OpState,
- args: CreateShaderModuleArgs,
- _: (),
-) -> Result<WebGpuResult, AnyError> {
- let instance = state.borrow::<super::Instance>();
- let device_resource = state
- .resource_table
- .get::<super::WebGpuDevice>(args.device_rid)?;
- let device = device_resource.0;
-
- let source =
- wgpu_core::pipeline::ShaderModuleSource::Wgsl(Cow::from(args.code));
-
- let descriptor = wgpu_core::pipeline::ShaderModuleDescriptor {
- label: args.label.map(Cow::from),
- };
-
- gfx_put!(device => instance.device_create_shader_module(
- device,
- &descriptor,
- source,
- std::marker::PhantomData
- ) => state, WebGpuShaderModule)
-}