From 9f86705fa64db7c1569f9244673e97376ae75782 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 5 Jan 2024 19:55:01 +0530 Subject: chore(ext/webgpu): include GPUCanvasContext in snapshot (#21773) Part 1 of #21713 Changes: - Remove `.present()` and add a `presentGPUCanvasContext` (not exposed yet to users) - Move lazy load logic to `00_init.js`. This can be used to use webgpu on-demand from future code (OffScreenCanvas) --- ext/webgpu/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext/webgpu/lib.rs') diff --git a/ext/webgpu/lib.rs b/ext/webgpu/lib.rs index 834ac6bcc..abb36fb8d 100644 --- a/ext/webgpu/lib.rs +++ b/ext/webgpu/lib.rs @@ -75,7 +75,6 @@ pub mod queue; pub mod render_pass; pub mod sampler; pub mod shader; -#[cfg(feature = "surface")] pub mod surface; pub mod texture; @@ -212,7 +211,12 @@ deno_core::extension!( queue::op_webgpu_write_texture, // shader shader::op_webgpu_create_shader_module, + // surface + surface::op_webgpu_surface_configure, + surface::op_webgpu_surface_get_current_texture, + surface::op_webgpu_surface_present ], + esm = ["00_init.js", "02_surface.js"], lazy_loaded_esm = ["01_webgpu.js"], ); -- cgit v1.2.3