summaryrefslogtreecommitdiff
path: root/ext/webgpu/shader.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-03-16 19:29:32 -0400
committerGitHub <noreply@github.com>2023-03-17 00:29:32 +0100
commit35196eab279340376929dd75ed717ef4830e2fa9 (patch)
tree5aefff339ef50d3e89ff36422c90e929dea3897f /ext/webgpu/shader.rs
parent3f031ad9af2d61671f8408632f31592ac4186926 (diff)
BREAKING(unstable): remove WebGPU (#18094)
This PR _**temporarily**_ removes WebGPU (which has behind the `--unstable` flag in Deno), due to performance complications due to its presence. It will be brought back in the future; as a point of reference, Chrome will ship WebGPU to stable on 26/04/2023. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/webgpu/shader.rs')
-rw-r--r--ext/webgpu/shader.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/ext/webgpu/shader.rs b/ext/webgpu/shader.rs
deleted file mode 100644
index 242cb85ba..000000000
--- a/ext/webgpu/shader.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-use deno_core::error::AnyError;
-use deno_core::op;
-use deno_core::OpState;
-use deno_core::Resource;
-use deno_core::ResourceId;
-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()
- }
-}
-
-#[op]
-pub fn op_webgpu_create_shader_module(
- state: &mut OpState,
- device_rid: ResourceId,
- label: Option<String>,
- code: String,
-) -> Result<WebGpuResult, AnyError> {
- let instance = state.borrow::<super::Instance>();
- let device_resource = state
- .resource_table
- .get::<super::WebGpuDevice>(device_rid)?;
- let device = device_resource.0;
-
- let source = wgpu_core::pipeline::ShaderModuleSource::Wgsl(Cow::from(code));
-
- let descriptor = wgpu_core::pipeline::ShaderModuleDescriptor {
- label: label.map(Cow::from),
- shader_bound_checks: wgpu_types::ShaderBoundChecks::default(),
- };
-
- gfx_put!(device => instance.device_create_shader_module(
- device,
- &descriptor,
- source,
- ()
- ) => state, WebGpuShaderModule)
-}