From 45ef1757cb1b43f76f6c87e346948635c51a7c1f Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Tue, 13 Feb 2024 15:47:56 -0500 Subject: [PATCH 1/6] fix(dx12): discard cmd. enc. buf. on drop --- tests/tests/bind_group_layout_dedup.rs | 23 +++-------------------- tests/tests/encoder.rs | 22 ++++++++++++++-------- wgpu-hal/src/dx12/command.rs | 7 +++++++ wgpu-hal/src/dx12/device.rs | 6 +----- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/tests/tests/bind_group_layout_dedup.rs b/tests/tests/bind_group_layout_dedup.rs index 8da284b41b..a0f6dad25d 100644 --- a/tests/tests/bind_group_layout_dedup.rs +++ b/tests/tests/bind_group_layout_dedup.rs @@ -1,9 +1,6 @@ use std::num::NonZeroU64; -use wgpu_test::{ - fail, gpu_test, FailureCase, GpuTestConfiguration, TestParameters, TestingContext, -}; -use wgt::Backends; +use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters, TestingContext}; const SHADER_SRC: &str = " @group(0) @binding(0) @@ -307,18 +304,10 @@ fn bgl_dedupe_derived(ctx: TestingContext) { ctx.queue.submit(Some(encoder.finish())); } -const DX12_VALIDATION_ERROR: &str = "The command allocator cannot be reset because a command list is currently being recorded with the allocator."; - #[gpu_test] static SEPARATE_PROGRAMS_HAVE_INCOMPATIBLE_DERIVED_BGLS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters( - TestParameters::default() - .test_features_limits() - .expect_fail( - FailureCase::backend(Backends::DX12).validation_error(DX12_VALIDATION_ERROR), - ), - ) + .parameters(TestParameters::default().test_features_limits()) .run_sync(separate_programs_have_incompatible_derived_bgls); fn separate_programs_have_incompatible_derived_bgls(ctx: TestingContext) { @@ -376,13 +365,7 @@ fn separate_programs_have_incompatible_derived_bgls(ctx: TestingContext) { #[gpu_test] static DERIVED_BGLS_INCOMPATIBLE_WITH_REGULAR_BGLS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters( - TestParameters::default() - .test_features_limits() - .expect_fail( - FailureCase::backend(Backends::DX12).validation_error(DX12_VALIDATION_ERROR), - ), - ) + .parameters(TestParameters::default().test_features_limits()) .run_sync(derived_bgls_incompatible_with_regular_bgls); fn derived_bgls_incompatible_with_regular_bgls(ctx: TestingContext) { diff --git a/tests/tests/encoder.rs b/tests/tests/encoder.rs index 3487eb05d1..3858e3d070 100644 --- a/tests/tests/encoder.rs +++ b/tests/tests/encoder.rs @@ -8,16 +8,22 @@ static DROP_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new().run_sync drop(encoder); }); -// This test crashes on DX12 with the exception: -// -// ID3D12CommandAllocator::Reset: The command allocator cannot be reset because a -// command list is currently being recorded with the allocator. [ EXECUTION ERROR -// #543: COMMAND_ALLOCATOR_CANNOT_RESET] -// -// For now, we mark the test as failing on DX12. +#[gpu_test] +static DROP_QUEUE_BEFORE_CREATING_COMMAND_ENCODER: GpuTestConfiguration = + GpuTestConfiguration::new() + .parameters(TestParameters::default().expect_fail(FailureCase::always())) + .run_sync(|ctx| { + // Use the device after the queue is dropped. Currently this panics + // but it probably shouldn't + let device = ctx.device.clone(); + drop(ctx); + let _encoder = + device.create_command_encoder(&wgpu::CommandEncoderDescriptor::default()); + }); + #[gpu_test] static DROP_ENCODER_AFTER_ERROR: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters(TestParameters::default().expect_fail(FailureCase::backend(wgpu::Backends::DX12))) + .parameters(TestParameters::default()) .run_sync(|ctx| { let mut encoder = ctx .device diff --git a/wgpu-hal/src/dx12/command.rs b/wgpu-hal/src/dx12/command.rs index 3d05813ed7..f8f4484097 100644 --- a/wgpu-hal/src/dx12/command.rs +++ b/wgpu-hal/src/dx12/command.rs @@ -56,6 +56,13 @@ impl super::Temp { } } +impl Drop for super::CommandEncoder { + fn drop(&mut self) { + use crate::CommandEncoder; + unsafe { self.discard_encoding() } + } +} + impl super::CommandEncoder { unsafe fn begin_pass(&mut self, kind: super::PassKind, label: crate::Label) { let list = self.list.as_ref().unwrap(); diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index bb128b2a6d..f6281d2b8a 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -663,11 +663,7 @@ impl crate::Device for super::Device { end_of_pass_timer_query: None, }) } - unsafe fn destroy_command_encoder(&self, encoder: super::CommandEncoder) { - if let Some(list) = encoder.list { - list.close(); - } - } + unsafe fn destroy_command_encoder(&self, _encoder: super::CommandEncoder) {} unsafe fn create_bind_group_layout( &self, From be8c7e6ced06d3d7868a91ccfa51de9ec8d8dc39 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Tue, 13 Feb 2024 15:47:56 -0500 Subject: [PATCH 2/6] fix(gles): discard cmd. enc. buf. on drop --- wgpu-hal/src/gles/command.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wgpu-hal/src/gles/command.rs b/wgpu-hal/src/gles/command.rs index 08083894c3..42c1f0ce51 100644 --- a/wgpu-hal/src/gles/command.rs +++ b/wgpu-hal/src/gles/command.rs @@ -93,6 +93,13 @@ impl super::CommandBuffer { } } +impl Drop for super::CommandEncoder { + fn drop(&mut self) { + use crate::CommandEncoder; + unsafe { self.discard_encoding() } + } +} + impl super::CommandEncoder { fn rebind_stencil_func(&mut self) { fn make(s: &super::StencilSide, face: u32) -> C { From d189cf27e86dc934f6d22622b6fde8f4a8593583 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 14 Feb 2024 14:14:35 -0500 Subject: [PATCH 3/6] fix: discard cmd. enc. buf. on `wgpu_core::Global::command_encoder_drop` --- CHANGELOG.md | 8 ++++++++ wgpu-core/src/command/mod.rs | 4 ++-- wgpu-core/src/device/global.rs | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b50b45a9..48cba06066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,14 @@ Bottom level categories: - `tan` - `tanh` +## v0.19.3 (2024-03-01) + +### Bug Fixes + +#### General + +- Fix an issue where command encoders weren't properly freed if an error occurred during command encoding. By @ErichDonGubler in [#5251](https://github.com/gfx-rs/wgpu/pull/5251). + ## v0.19.2 (2024-02-29) ### Added/New Features diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 784d158bce..e517f572e1 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -78,7 +78,7 @@ impl CommandEncoder { Ok(()) } - fn discard(&mut self) { + pub(crate) fn discard(&mut self) { if self.is_open { self.is_open = false; unsafe { self.raw.discard_encoding() }; @@ -115,7 +115,7 @@ pub(crate) struct DestroyedBufferError(pub id::BufferId); pub(crate) struct DestroyedTextureError(pub id::TextureId); pub struct CommandBufferMutable { - encoder: CommandEncoder, + pub(crate) encoder: CommandEncoder, status: CommandEncoderStatus, pub(crate) trackers: Tracker, buffer_memory_init_actions: Vec>, diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 9d9fdf3c27..334c370544 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -1354,6 +1354,8 @@ impl Global { let hub = A::hub(self); if let Some(cmd_buf) = hub.command_buffers.unregister(command_encoder_id) { + cmd_buf.data.lock().as_mut().unwrap().encoder.discard(); + cmd_buf .device .untrack(&cmd_buf.data.lock().as_ref().unwrap().trackers); From bb09828a9e2472cb81a0eed1c5c2f36b5d471cfa Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 1 Mar 2024 16:13:14 -0500 Subject: [PATCH 4/6] Vendor WebGPU Bindings from web_sys (#5325) --- .cargo/config.toml | 10 +- .gitattributes | 1 + .github/workflows/ci.yml | 4 +- .github/workflows/publish.yml | 2 +- .gitignore | 3 + CHANGELOG.md | 12 + wgpu/Cargo.toml | 123 +--- wgpu/src/backend/mod.rs | 17 +- wgpu/src/backend/webgpu.rs | 441 +++++------ wgpu/src/backend/webgpu/ext_bindings.rs | 45 ++ wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs | 73 ++ .../webgpu/webgpu_sys/gen_GpuAdapter.rs | 109 +++ .../webgpu/webgpu_sys/gen_GpuAddressMode.rs | 24 + .../webgpu_sys/gen_GpuAutoLayoutMode.rs | 22 + .../webgpu/webgpu_sys/gen_GpuBindGroup.rs | 48 ++ .../webgpu_sys/gen_GpuBindGroupDescriptor.rs | 96 +++ .../webgpu_sys/gen_GpuBindGroupEntry.rs | 82 +++ .../webgpu_sys/gen_GpuBindGroupLayout.rs | 48 ++ .../gen_GpuBindGroupLayoutDescriptor.rs | 77 ++ .../webgpu_sys/gen_GpuBindGroupLayoutEntry.rs | 184 +++++ .../webgpu_sys/gen_GpuBlendComponent.rs | 107 +++ .../webgpu/webgpu_sys/gen_GpuBlendFactor.rs | 34 + .../webgpu_sys/gen_GpuBlendOperation.rs | 26 + .../webgpu/webgpu_sys/gen_GpuBlendState.rs | 74 ++ .../webgpu/webgpu_sys/gen_GpuBuffer.rs | 293 ++++++++ .../webgpu/webgpu_sys/gen_GpuBufferBinding.rs | 92 +++ .../webgpu_sys/gen_GpuBufferBindingLayout.rs | 103 +++ .../webgpu_sys/gen_GpuBufferBindingType.rs | 24 + .../webgpu_sys/gen_GpuBufferDescriptor.rs | 112 +++ .../webgpu_sys/gen_GpuBufferMapState.rs | 24 + .../webgpu_sys/gen_GpuCanvasAlphaMode.rs | 23 + .../webgpu_sys/gen_GpuCanvasConfiguration.rs | 135 ++++ .../webgpu/webgpu_sys/gen_GpuCanvasContext.rs | 70 ++ .../webgpu/webgpu_sys/gen_GpuColorDict.rs | 110 +++ .../webgpu_sys/gen_GpuColorTargetState.rs | 95 +++ .../webgpu/webgpu_sys/gen_GpuCommandBuffer.rs | 48 ++ .../gen_GpuCommandBufferDescriptor.rs | 61 ++ .../webgpu_sys/gen_GpuCommandEncoder.rs | 529 +++++++++++++ .../gen_GpuCommandEncoderDescriptor.rs | 61 ++ .../webgpu_sys/gen_GpuCompareFunction.rs | 29 + .../webgpu_sys/gen_GpuCompilationInfo.rs | 37 + .../webgpu_sys/gen_GpuCompilationMessage.rs | 92 +++ .../gen_GpuCompilationMessageType.rs | 24 + .../gen_GpuComputePassDescriptor.rs | 82 +++ .../webgpu_sys/gen_GpuComputePassEncoder.rs | 242 ++++++ .../gen_GpuComputePassTimestampWrites.rs | 102 +++ .../webgpu_sys/gen_GpuComputePipeline.rs | 59 ++ .../gen_GpuComputePipelineDescriptor.rs | 96 +++ .../webgpu/webgpu_sys/gen_GpuCullMode.rs | 24 + .../webgpu_sys/gen_GpuDepthStencilState.rs | 252 +++++++ .../webgpu/webgpu_sys/gen_GpuDevice.rs | 368 ++++++++++ .../webgpu_sys/gen_GpuDeviceDescriptor.rs | 103 +++ .../webgpu_sys/gen_GpuDeviceLostInfo.rs | 48 ++ .../webgpu_sys/gen_GpuDeviceLostReason.rs | 23 + .../backend/webgpu/webgpu_sys/gen_GpuError.rs | 37 + .../webgpu/webgpu_sys/gen_GpuErrorFilter.rs | 24 + .../webgpu/webgpu_sys/gen_GpuExtent3dDict.rs | 95 +++ .../webgpu_sys/gen_GpuExternalTexture.rs | 48 ++ .../gen_GpuExternalTextureBindingLayout.rs | 44 ++ .../gen_GpuExternalTextureDescriptor.rs | 74 ++ .../webgpu/webgpu_sys/gen_GpuFeatureName.rs | 32 + .../webgpu/webgpu_sys/gen_GpuFilterMode.rs | 23 + .../webgpu/webgpu_sys/gen_GpuFragmentState.rs | 105 +++ .../webgpu/webgpu_sys/gen_GpuFrontFace.rs | 23 + .../webgpu_sys/gen_GpuImageCopyBuffer.rs | 117 +++ .../gen_GpuImageCopyExternalImage.rs | 92 +++ .../webgpu_sys/gen_GpuImageCopyTexture.rs | 117 +++ .../gen_GpuImageCopyTextureTagged.rs | 138 ++++ .../webgpu_sys/gen_GpuImageDataLayout.rs | 104 +++ .../webgpu/webgpu_sys/gen_GpuIndexFormat.rs | 23 + .../webgpu/webgpu_sys/gen_GpuLoadOp.rs | 23 + .../webgpu_sys/gen_GpuMipmapFilterMode.rs | 23 + .../webgpu_sys/gen_GpuMultisampleState.rs | 99 +++ .../webgpu_sys/gen_GpuObjectDescriptorBase.rs | 61 ++ .../webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs | 78 ++ .../webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs | 95 +++ .../webgpu_sys/gen_GpuOutOfMemoryError.rs | 37 + .../gen_GpuPipelineDescriptorBase.rs | 74 ++ .../webgpu_sys/gen_GpuPipelineLayout.rs | 48 ++ .../gen_GpuPipelineLayoutDescriptor.rs | 77 ++ .../webgpu_sys/gen_GpuPowerPreference.rs | 23 + .../webgpu_sys/gen_GpuPrimitiveState.rs | 149 ++++ .../webgpu_sys/gen_GpuPrimitiveTopology.rs | 26 + .../webgpu_sys/gen_GpuProgrammableStage.rs | 79 ++ .../webgpu/webgpu_sys/gen_GpuQuerySet.rs | 81 ++ .../webgpu_sys/gen_GpuQuerySetDescriptor.rs | 91 +++ .../webgpu/webgpu_sys/gen_GpuQueryType.rs | 23 + .../backend/webgpu/webgpu_sys/gen_GpuQueue.rs | 658 +++++++++++++++++ .../webgpu_sys/gen_GpuQueueDescriptor.rs | 61 ++ .../webgpu/webgpu_sys/gen_GpuRenderBundle.rs | 48 ++ .../gen_GpuRenderBundleDescriptor.rs | 61 ++ .../webgpu_sys/gen_GpuRenderBundleEncoder.rs | 606 +++++++++++++++ .../gen_GpuRenderBundleEncoderDescriptor.rs | 161 ++++ .../gen_GpuRenderPassColorAttachment.rs | 139 ++++ ...gen_GpuRenderPassDepthStencilAttachment.rs | 224 ++++++ .../webgpu_sys/gen_GpuRenderPassDescriptor.rs | 164 +++++ .../webgpu_sys/gen_GpuRenderPassEncoder.rs | 694 ++++++++++++++++++ .../gen_GpuRenderPassTimestampWrites.rs | 102 +++ .../webgpu_sys/gen_GpuRenderPipeline.rs | 59 ++ .../gen_GpuRenderPipelineDescriptor.rs | 177 +++++ .../gen_GpuRequestAdapterOptions.rs | 86 +++ .../webgpu/webgpu_sys/gen_GpuSampler.rs | 48 ++ .../webgpu_sys/gen_GpuSamplerBindingLayout.rs | 61 ++ .../webgpu_sys/gen_GpuSamplerBindingType.rs | 24 + .../webgpu_sys/gen_GpuSamplerDescriptor.rs | 271 +++++++ .../webgpu/webgpu_sys/gen_GpuShaderModule.rs | 59 ++ .../gen_GpuShaderModuleDescriptor.rs | 94 +++ .../webgpu_sys/gen_GpuStencilFaceState.rs | 122 +++ .../webgpu_sys/gen_GpuStencilOperation.rs | 29 + .../webgpu_sys/gen_GpuStorageTextureAccess.rs | 22 + .../gen_GpuStorageTextureBindingLayout.rs | 96 +++ .../webgpu/webgpu_sys/gen_GpuStoreOp.rs | 23 + .../webgpu_sys/gen_GpuSupportedFeatures.rs | 95 +++ .../webgpu_sys/gen_GpuSupportedLimits.rs | 378 ++++++++++ .../webgpu/webgpu_sys/gen_GpuTexture.rs | 172 +++++ .../webgpu/webgpu_sys/gen_GpuTextureAspect.rs | 24 + .../webgpu_sys/gen_GpuTextureBindingLayout.rs | 107 +++ .../webgpu_sys/gen_GpuTextureDescriptor.rs | 194 +++++ .../webgpu_sys/gen_GpuTextureDimension.rs | 24 + .../webgpu/webgpu_sys/gen_GpuTextureFormat.rs | 115 +++ .../webgpu_sys/gen_GpuTextureSampleType.rs | 26 + .../webgpu/webgpu_sys/gen_GpuTextureView.rs | 48 ++ .../gen_GpuTextureViewDescriptor.rs | 202 +++++ .../webgpu_sys/gen_GpuTextureViewDimension.rs | 27 + .../webgpu_sys/gen_GpuUncapturedErrorEvent.rs | 51 ++ .../gen_GpuUncapturedErrorEventInit.rs | 119 +++ .../webgpu_sys/gen_GpuValidationError.rs | 37 + .../webgpu_sys/gen_GpuVertexAttribute.rs | 98 +++ .../webgpu_sys/gen_GpuVertexBufferLayout.rs | 103 +++ .../webgpu/webgpu_sys/gen_GpuVertexFormat.rs | 51 ++ .../webgpu/webgpu_sys/gen_GpuVertexState.rs | 100 +++ .../webgpu_sys/gen_GpuVertexStepMode.rs | 23 + .../webgpu_sys/gen_WgslLanguageFeatures.rs | 95 +++ .../webgpu/webgpu_sys/gen_gpu_map_mode.rs | 33 + wgpu/src/backend/webgpu/webgpu_sys/mod.rs | 261 +++++++ wgpu/src/lib.rs | 4 +- xtask/Cargo.lock | 7 + xtask/Cargo.toml | 1 + xtask/src/cli.rs | 67 -- xtask/src/main.rs | 73 +- xtask/src/run_wasm.rs | 6 +- xtask/src/test.rs | 7 +- xtask/src/vendor_web_sys.rs | 302 ++++++++ 143 files changed, 13692 insertions(+), 453 deletions(-) create mode 100644 wgpu/src/backend/webgpu/ext_bindings.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs create mode 100644 wgpu/src/backend/webgpu/webgpu_sys/mod.rs delete mode 100644 xtask/src/cli.rs create mode 100644 xtask/src/vendor_web_sys.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 8434ec2cc6..4b01400617 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,10 +1,2 @@ [alias] -xtask = "run --manifest-path xtask/Cargo.toml" - -[build] -rustflags = [ -"--cfg=web_sys_unstable_apis" -] -rustdocflags = [ -"--cfg=web_sys_unstable_apis" -] +xtask = "run --manifest-path xtask/Cargo.toml --" diff --git a/.gitattributes b/.gitattributes index 149b5351f2..c239578a2c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.mtl binary *.obj binary +wgpu/src/backend/webgpu/webgpu_sys/** linguist-generated=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bb8d38245..9140634196 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,8 @@ env: RUST_LOG: info RUST_BACKTRACE: full PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work - RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings - RUSTDOCFLAGS: --cfg=web_sys_unstable_apis -D warnings + RUSTFLAGS: -D warnings + RUSTDOCFLAGS: -D warnings WASM_BINDGEN_TEST_TIMEOUT: 300 # 5 minutes CACHE_SUFFIX: c # cache busting diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f45224779c..6dfed56f6a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ env: CARGO_INCREMENTAL: false CARGO_TERM_COLOR: always RUST_BACKTRACE: full - RUSTFLAGS: --cfg=web_sys_unstable_apis + RUSTFLAGS: jobs: publish: diff --git a/.gitignore b/.gitignore index 089a7f2e19..93c463b70a 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ cts/ # Cached GPU config .gpuconfig + +# Temporary clone location for wasm-bindgen mirroring +wgpu/src/backend/webgpu/webgpu_sys/wasm_bindgen_clone_tmp \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 48cba06066..dd5e01c529 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,18 @@ Bottom level categories: ## v0.19.3 (2024-03-01) +### Major Changes + +#### Vendored WebGPU Bindings from `web_sys` + +**`--cfg=web_sys_unstable_apis` is no longer needed in your `RUSTFLAGS` to compile for WebGPU!!!** + +While WebGPU's javascript api is stable in the browsers, the `web_sys` bindings for WebGPU are still improving. As such they are hidden behind the special cfg `--cfg=web_sys_unstable_apis` and are not available by default. Everyone who wanted to use our WebGPU backend needed to enable this cfg in their `RUSTFLAGS`. This was very inconvenient and made it hard to use WebGPU, especially when WebGPU is enabled by default. Additionally, the unstable APIs don't adhere to semver, so there were repeated breakages. + +To combat this problem we have decided to vendor the `web_sys` bindings for WebGPU within the crate. Notably we are not forking the bindings, merely vendoring, so any improvements we make to the bindings will be contributed directly to upstream `web_sys`. + +By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325). + ### Bug Fixes #### General diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 8127f0ac58..3f260a9573 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -13,7 +13,7 @@ exclude = ["Cargo.lock"] [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs", "--cfg", "web_sys_unstable_apis"] +rustdoc-args = ["--cfg", "docsrs"] targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", @@ -187,124 +187,6 @@ web-sys = { workspace = true, features = [ "Navigator", "Node", "NodeList", - "Gpu", - "GpuAdapter", - "GpuAddressMode", - "GpuAutoLayoutMode", - "GpuBindGroup", - "GpuBindGroupDescriptor", - "GpuBindGroupEntry", - "GpuBindGroupLayout", - "GpuBindGroupLayoutDescriptor", - "GpuBindGroupLayoutEntry", - "GpuBlendComponent", - "GpuBlendFactor", - "GpuBlendOperation", - "GpuBlendState", - "GpuBuffer", - "GpuBufferBinding", - "GpuBufferBindingLayout", - "GpuBufferBindingType", - "GpuBufferDescriptor", - "GpuCanvasAlphaMode", - "GpuCanvasContext", - "GpuCanvasConfiguration", - "GpuColorDict", - "GpuColorTargetState", - "GpuCommandBuffer", - "GpuCommandBufferDescriptor", - "GpuCommandEncoder", - "GpuCommandEncoderDescriptor", - "GpuCompareFunction", - "GpuCompilationInfo", - "GpuCompilationMessage", - "GpuCompilationMessageType", - "GpuComputePassDescriptor", - "GpuComputePassEncoder", - "GpuComputePassTimestampWrites", - "GpuComputePipeline", - "GpuComputePipelineDescriptor", - "GpuCullMode", - "GpuDepthStencilState", - "GpuDevice", - "GpuDeviceDescriptor", - "GpuDeviceLostInfo", - "GpuDeviceLostReason", - "GpuError", - "GpuErrorFilter", - # "GpuExtent2dDict", Not yet implemented in web_sys - "GpuExtent3dDict", - "GpuFeatureName", - "GpuFilterMode", - "GpuFragmentState", - "GpuFrontFace", - "GpuImageCopyBuffer", - "GpuImageCopyExternalImage", - "GpuImageCopyTexture", - "GpuImageCopyTextureTagged", - "GpuImageDataLayout", - "GpuIndexFormat", - "GpuLoadOp", - "gpu_map_mode", - "GpuMipmapFilterMode", - "GpuMultisampleState", - "GpuObjectDescriptorBase", - "GpuOrigin2dDict", - "GpuOrigin3dDict", - "GpuOutOfMemoryError", - "GpuPipelineDescriptorBase", - "GpuPipelineLayout", - "GpuPipelineLayoutDescriptor", - "GpuPowerPreference", - "GpuPrimitiveState", - "GpuPrimitiveTopology", - "GpuProgrammableStage", - "GpuQuerySet", - "GpuQuerySetDescriptor", - "GpuQueryType", - "GpuQueue", - "GpuRenderBundle", - "GpuRenderBundleDescriptor", - "GpuRenderBundleEncoder", - "GpuRenderBundleEncoderDescriptor", - "GpuRenderPassColorAttachment", - "GpuRenderPassDepthStencilAttachment", - "GpuRenderPassDescriptor", - "GpuRenderPassEncoder", - "GpuRenderPipeline", - "GpuRenderPipelineDescriptor", - "GpuRequestAdapterOptions", - "GpuSampler", - "GpuSamplerBindingLayout", - "GpuSamplerBindingType", - "GpuSamplerDescriptor", - "GpuShaderModule", - "GpuShaderModuleDescriptor", - "GpuStencilFaceState", - "GpuStencilOperation", - "GpuStorageTextureAccess", - "GpuStorageTextureBindingLayout", - "GpuStoreOp", - "GpuSupportedFeatures", - "GpuSupportedLimits", - "GpuTexture", - "GpuTextureAspect", - "GpuTextureBindingLayout", - "GpuTextureDescriptor", - "GpuTextureDimension", - "GpuTextureFormat", - "GpuTextureSampleType", - "GpuTextureView", - "GpuTextureViewDescriptor", - "GpuTextureViewDimension", - "GpuUncapturedErrorEvent", - "GpuUncapturedErrorEventInit", - "GpuValidationError", - "GpuVertexAttribute", - "GpuVertexBufferLayout", - "GpuVertexFormat", - "GpuVertexState", - "GpuVertexStepMode", "HtmlCanvasElement", "OffscreenCanvas", "ImageBitmap", @@ -312,6 +194,9 @@ web-sys = { workspace = true, features = [ "Window", "WorkerGlobalScope", "WorkerNavigator", + # Needed by webgpu_sys + "Event", + "EventTarget", ] } wasm-bindgen.workspace = true js-sys.workspace = true diff --git a/wgpu/src/backend/mod.rs b/wgpu/src/backend/mod.rs index 9a0b7ef28a..7364eb3fd6 100644 --- a/wgpu/src/backend/mod.rs +++ b/wgpu/src/backend/mod.rs @@ -1,21 +1,8 @@ -#[cfg(all(webgpu, web_sys_unstable_apis))] +#[cfg(webgpu)] mod webgpu; -#[cfg(all(webgpu, web_sys_unstable_apis))] +#[cfg(webgpu)] pub(crate) use webgpu::{get_browser_gpu_property, ContextWebGpu}; -#[cfg(all(webgpu, not(web_sys_unstable_apis)))] -compile_error!( - "webgpu feature used without web_sys_unstable_apis config: -Here are some ways to resolve this: -* If you wish to use webgpu backend, create a .cargo/config.toml in the root of the repo containing: - [build] - rustflags = [ \"--cfg=web_sys_unstable_apis\" ] - rustdocflags = [ \"--cfg=web_sys_unstable_apis\" ] -* If you wish to disable webgpu backend and instead use webgl backend, change your wgpu Cargo.toml entry to: - wgpu = { version = \"\", default-features = false, features = [\"webgl\"] } -" -); - #[cfg(wgpu_core)] mod wgpu_core; diff --git a/wgpu/src/backend/webgpu.rs b/wgpu/src/backend/webgpu.rs index 91115c3e07..b76d1b8c1d 100644 --- a/wgpu/src/backend/webgpu.rs +++ b/wgpu/src/backend/webgpu.rs @@ -1,5 +1,8 @@ #![allow(clippy::type_complexity)] +mod ext_bindings; +mod webgpu_sys; + use js_sys::Promise; use std::{ any::Any, @@ -69,7 +72,7 @@ unsafe impl Send for Identified {} #[cfg(send_sync)] unsafe impl Sync for Identified {} -pub(crate) struct ContextWebGpu(web_sys::Gpu); +pub(crate) struct ContextWebGpu(webgpu_sys::Gpu); #[cfg(send_sync)] unsafe impl Send for ContextWebGpu {} #[cfg(send_sync)] @@ -90,12 +93,12 @@ impl fmt::Debug for ContextWebGpu { impl crate::Error { fn from_js(js_error: js_sys::Object) -> Self { let source = Box::::from(""); - if let Some(js_error) = js_error.dyn_ref::() { + if let Some(js_error) = js_error.dyn_ref::() { crate::Error::Validation { source, description: js_error.message(), } - } else if js_error.has_type::() { + } else if js_error.has_type::() { crate::Error::OutOfMemory { source } } else { panic!("Unexpected error"); @@ -138,8 +141,8 @@ impl MakeSendFuture { #[cfg(send_sync)] unsafe impl Send for MakeSendFuture {} -fn map_texture_format(texture_format: wgt::TextureFormat) -> web_sys::GpuTextureFormat { - use web_sys::GpuTextureFormat as tf; +fn map_texture_format(texture_format: wgt::TextureFormat) -> webgpu_sys::GpuTextureFormat { + use webgpu_sys::GpuTextureFormat as tf; use wgt::TextureFormat; match texture_format { // 8-bit formats @@ -263,8 +266,8 @@ fn map_texture_format(texture_format: wgt::TextureFormat) -> web_sys::GpuTexture fn map_texture_component_type( sample_type: wgt::TextureSampleType, -) -> web_sys::GpuTextureSampleType { - use web_sys::GpuTextureSampleType as ts; +) -> webgpu_sys::GpuTextureSampleType { + use webgpu_sys::GpuTextureSampleType as ts; use wgt::TextureSampleType; match sample_type { TextureSampleType::Float { filterable: true } => ts::Float, @@ -275,8 +278,8 @@ fn map_texture_component_type( } } -fn map_cull_mode(cull_mode: Option) -> web_sys::GpuCullMode { - use web_sys::GpuCullMode as cm; +fn map_cull_mode(cull_mode: Option) -> webgpu_sys::GpuCullMode { + use webgpu_sys::GpuCullMode as cm; use wgt::Face; match cull_mode { None => cm::None, @@ -285,8 +288,8 @@ fn map_cull_mode(cull_mode: Option) -> web_sys::GpuCullMode { } } -fn map_front_face(front_face: wgt::FrontFace) -> web_sys::GpuFrontFace { - use web_sys::GpuFrontFace as ff; +fn map_front_face(front_face: wgt::FrontFace) -> webgpu_sys::GpuFrontFace { + use webgpu_sys::GpuFrontFace as ff; use wgt::FrontFace; match front_face { FrontFace::Ccw => ff::Ccw, @@ -294,11 +297,11 @@ fn map_front_face(front_face: wgt::FrontFace) -> web_sys::GpuFrontFace { } } -fn map_primitive_state(primitive: &wgt::PrimitiveState) -> web_sys::GpuPrimitiveState { - use web_sys::GpuPrimitiveTopology as pt; +fn map_primitive_state(primitive: &wgt::PrimitiveState) -> webgpu_sys::GpuPrimitiveState { + use webgpu_sys::GpuPrimitiveTopology as pt; use wgt::PrimitiveTopology; - let mut mapped = web_sys::GpuPrimitiveState::new(); + let mut mapped = webgpu_sys::GpuPrimitiveState::new(); mapped.cull_mode(map_cull_mode(primitive.cull_mode)); mapped.front_face(map_front_face(primitive.front_face)); @@ -332,8 +335,8 @@ fn map_primitive_state(primitive: &wgt::PrimitiveState) -> web_sys::GpuPrimitive mapped } -fn map_compare_function(compare_fn: wgt::CompareFunction) -> web_sys::GpuCompareFunction { - use web_sys::GpuCompareFunction as cf; +fn map_compare_function(compare_fn: wgt::CompareFunction) -> webgpu_sys::GpuCompareFunction { + use webgpu_sys::GpuCompareFunction as cf; use wgt::CompareFunction; match compare_fn { CompareFunction::Never => cf::Never, @@ -347,8 +350,8 @@ fn map_compare_function(compare_fn: wgt::CompareFunction) -> web_sys::GpuCompare } } -fn map_stencil_operation(op: wgt::StencilOperation) -> web_sys::GpuStencilOperation { - use web_sys::GpuStencilOperation as so; +fn map_stencil_operation(op: wgt::StencilOperation) -> webgpu_sys::GpuStencilOperation { + use webgpu_sys::GpuStencilOperation as so; use wgt::StencilOperation; match op { StencilOperation::Keep => so::Keep, @@ -362,8 +365,8 @@ fn map_stencil_operation(op: wgt::StencilOperation) -> web_sys::GpuStencilOperat } } -fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> web_sys::GpuStencilFaceState { - let mut mapped = web_sys::GpuStencilFaceState::new(); +fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> webgpu_sys::GpuStencilFaceState { + let mut mapped = webgpu_sys::GpuStencilFaceState::new(); mapped.compare(map_compare_function(desc.compare)); mapped.depth_fail_op(map_stencil_operation(desc.depth_fail_op)); mapped.fail_op(map_stencil_operation(desc.fail_op)); @@ -371,8 +374,8 @@ fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> web_sys::GpuStencilFa mapped } -fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> web_sys::GpuDepthStencilState { - let mut mapped = web_sys::GpuDepthStencilState::new( +fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> webgpu_sys::GpuDepthStencilState { + let mut mapped = webgpu_sys::GpuDepthStencilState::new( map_compare_function(desc.depth_compare), desc.depth_write_enabled, map_texture_format(desc.format), @@ -387,16 +390,16 @@ fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> web_sys::GpuDepthSt mapped } -fn map_blend_component(desc: &wgt::BlendComponent) -> web_sys::GpuBlendComponent { - let mut mapped = web_sys::GpuBlendComponent::new(); +fn map_blend_component(desc: &wgt::BlendComponent) -> webgpu_sys::GpuBlendComponent { + let mut mapped = webgpu_sys::GpuBlendComponent::new(); mapped.dst_factor(map_blend_factor(desc.dst_factor)); mapped.operation(map_blend_operation(desc.operation)); mapped.src_factor(map_blend_factor(desc.src_factor)); mapped } -fn map_blend_factor(factor: wgt::BlendFactor) -> web_sys::GpuBlendFactor { - use web_sys::GpuBlendFactor as bf; +fn map_blend_factor(factor: wgt::BlendFactor) -> webgpu_sys::GpuBlendFactor { + use webgpu_sys::GpuBlendFactor as bf; use wgt::BlendFactor; match factor { BlendFactor::Zero => bf::Zero, @@ -424,8 +427,8 @@ fn map_blend_factor(factor: wgt::BlendFactor) -> web_sys::GpuBlendFactor { } } -fn map_blend_operation(op: wgt::BlendOperation) -> web_sys::GpuBlendOperation { - use web_sys::GpuBlendOperation as bo; +fn map_blend_operation(op: wgt::BlendOperation) -> webgpu_sys::GpuBlendOperation { + use webgpu_sys::GpuBlendOperation as bo; use wgt::BlendOperation; match op { BlendOperation::Add => bo::Add, @@ -436,8 +439,8 @@ fn map_blend_operation(op: wgt::BlendOperation) -> web_sys::GpuBlendOperation { } } -fn map_index_format(format: wgt::IndexFormat) -> web_sys::GpuIndexFormat { - use web_sys::GpuIndexFormat as f; +fn map_index_format(format: wgt::IndexFormat) -> webgpu_sys::GpuIndexFormat { + use webgpu_sys::GpuIndexFormat as f; use wgt::IndexFormat; match format { IndexFormat::Uint16 => f::Uint16, @@ -445,8 +448,8 @@ fn map_index_format(format: wgt::IndexFormat) -> web_sys::GpuIndexFormat { } } -fn map_vertex_format(format: wgt::VertexFormat) -> web_sys::GpuVertexFormat { - use web_sys::GpuVertexFormat as vf; +fn map_vertex_format(format: wgt::VertexFormat) -> webgpu_sys::GpuVertexFormat { + use webgpu_sys::GpuVertexFormat as vf; use wgt::VertexFormat; match format { VertexFormat::Uint8x2 => vf::Uint8x2, @@ -488,8 +491,8 @@ fn map_vertex_format(format: wgt::VertexFormat) -> web_sys::GpuVertexFormat { } } -fn map_vertex_step_mode(mode: wgt::VertexStepMode) -> web_sys::GpuVertexStepMode { - use web_sys::GpuVertexStepMode as sm; +fn map_vertex_step_mode(mode: wgt::VertexStepMode) -> webgpu_sys::GpuVertexStepMode { + use webgpu_sys::GpuVertexStepMode as sm; use wgt::VertexStepMode; match mode { VertexStepMode::Vertex => sm::Vertex, @@ -497,40 +500,42 @@ fn map_vertex_step_mode(mode: wgt::VertexStepMode) -> web_sys::GpuVertexStepMode } } -fn map_extent_3d(extent: wgt::Extent3d) -> web_sys::GpuExtent3dDict { - let mut mapped = web_sys::GpuExtent3dDict::new(extent.width); +fn map_extent_3d(extent: wgt::Extent3d) -> webgpu_sys::GpuExtent3dDict { + let mut mapped = webgpu_sys::GpuExtent3dDict::new(extent.width); mapped.height(extent.height); mapped.depth_or_array_layers(extent.depth_or_array_layers); mapped } -fn map_origin_2d(extent: wgt::Origin2d) -> web_sys::GpuOrigin2dDict { - let mut mapped = web_sys::GpuOrigin2dDict::new(); +fn map_origin_2d(extent: wgt::Origin2d) -> webgpu_sys::GpuOrigin2dDict { + let mut mapped = webgpu_sys::GpuOrigin2dDict::new(); mapped.x(extent.x); mapped.y(extent.y); mapped } -fn map_origin_3d(origin: wgt::Origin3d) -> web_sys::GpuOrigin3dDict { - let mut mapped = web_sys::GpuOrigin3dDict::new(); +fn map_origin_3d(origin: wgt::Origin3d) -> webgpu_sys::GpuOrigin3dDict { + let mut mapped = webgpu_sys::GpuOrigin3dDict::new(); mapped.x(origin.x); mapped.y(origin.y); mapped.z(origin.z); mapped } -fn map_texture_dimension(texture_dimension: wgt::TextureDimension) -> web_sys::GpuTextureDimension { +fn map_texture_dimension( + texture_dimension: wgt::TextureDimension, +) -> webgpu_sys::GpuTextureDimension { match texture_dimension { - wgt::TextureDimension::D1 => web_sys::GpuTextureDimension::N1d, - wgt::TextureDimension::D2 => web_sys::GpuTextureDimension::N2d, - wgt::TextureDimension::D3 => web_sys::GpuTextureDimension::N3d, + wgt::TextureDimension::D1 => webgpu_sys::GpuTextureDimension::N1d, + wgt::TextureDimension::D2 => webgpu_sys::GpuTextureDimension::N2d, + wgt::TextureDimension::D3 => webgpu_sys::GpuTextureDimension::N3d, } } fn map_texture_view_dimension( texture_view_dimension: wgt::TextureViewDimension, -) -> web_sys::GpuTextureViewDimension { - use web_sys::GpuTextureViewDimension as tvd; +) -> webgpu_sys::GpuTextureViewDimension { + use webgpu_sys::GpuTextureViewDimension as tvd; match texture_view_dimension { wgt::TextureViewDimension::D1 => tvd::N1d, wgt::TextureViewDimension::D2 => tvd::N2d, @@ -541,10 +546,10 @@ fn map_texture_view_dimension( } } -fn map_buffer_copy_view(view: crate::ImageCopyBuffer<'_>) -> web_sys::GpuImageCopyBuffer { +fn map_buffer_copy_view(view: crate::ImageCopyBuffer<'_>) -> webgpu_sys::GpuImageCopyBuffer { let buffer: &::BufferData = downcast_ref(view.buffer.data.as_ref()); - let mut mapped = web_sys::GpuImageCopyBuffer::new(&buffer.0.buffer); + let mut mapped = webgpu_sys::GpuImageCopyBuffer::new(&buffer.0.buffer); if let Some(bytes_per_row) = view.layout.bytes_per_row { mapped.bytes_per_row(bytes_per_row); } @@ -555,10 +560,10 @@ fn map_buffer_copy_view(view: crate::ImageCopyBuffer<'_>) -> web_sys::GpuImageCo mapped } -fn map_texture_copy_view(view: crate::ImageCopyTexture<'_>) -> web_sys::GpuImageCopyTexture { +fn map_texture_copy_view(view: crate::ImageCopyTexture<'_>) -> webgpu_sys::GpuImageCopyTexture { let texture: &::TextureData = downcast_ref(view.texture.data.as_ref()); - let mut mapped = web_sys::GpuImageCopyTexture::new(&texture.0); + let mut mapped = webgpu_sys::GpuImageCopyTexture::new(&texture.0); mapped.mip_level(view.mip_level); mapped.origin(&map_origin_3d(view.origin)); mapped @@ -566,10 +571,10 @@ fn map_texture_copy_view(view: crate::ImageCopyTexture<'_>) -> web_sys::GpuImage fn map_tagged_texture_copy_view( view: crate::ImageCopyTextureTagged<'_>, -) -> web_sys::GpuImageCopyTextureTagged { +) -> webgpu_sys::GpuImageCopyTextureTagged { let texture: &::TextureData = downcast_ref(view.texture.data.as_ref()); - let mut mapped = web_sys::GpuImageCopyTextureTagged::new(&texture.0); + let mut mapped = webgpu_sys::GpuImageCopyTextureTagged::new(&texture.0); mapped.mip_level(view.mip_level); mapped.origin(&map_origin_3d(view.origin)); mapped.aspect(map_texture_aspect(view.aspect)); @@ -580,114 +585,114 @@ fn map_tagged_texture_copy_view( fn map_external_texture_copy_view( view: &crate::ImageCopyExternalImage, -) -> web_sys::GpuImageCopyExternalImage { - let mut mapped = web_sys::GpuImageCopyExternalImage::new(&view.source); +) -> webgpu_sys::GpuImageCopyExternalImage { + let mut mapped = webgpu_sys::GpuImageCopyExternalImage::new(&view.source); mapped.origin(&map_origin_2d(view.origin)); mapped.flip_y(view.flip_y); mapped } -fn map_texture_aspect(aspect: wgt::TextureAspect) -> web_sys::GpuTextureAspect { +fn map_texture_aspect(aspect: wgt::TextureAspect) -> webgpu_sys::GpuTextureAspect { match aspect { - wgt::TextureAspect::All => web_sys::GpuTextureAspect::All, - wgt::TextureAspect::StencilOnly => web_sys::GpuTextureAspect::StencilOnly, - wgt::TextureAspect::DepthOnly => web_sys::GpuTextureAspect::DepthOnly, + wgt::TextureAspect::All => webgpu_sys::GpuTextureAspect::All, + wgt::TextureAspect::StencilOnly => webgpu_sys::GpuTextureAspect::StencilOnly, + wgt::TextureAspect::DepthOnly => webgpu_sys::GpuTextureAspect::DepthOnly, wgt::TextureAspect::Plane0 | wgt::TextureAspect::Plane1 | wgt::TextureAspect::Plane2 => { panic!("multi-plane textures are not supported") } } } -fn map_filter_mode(mode: wgt::FilterMode) -> web_sys::GpuFilterMode { +fn map_filter_mode(mode: wgt::FilterMode) -> webgpu_sys::GpuFilterMode { match mode { - wgt::FilterMode::Nearest => web_sys::GpuFilterMode::Nearest, - wgt::FilterMode::Linear => web_sys::GpuFilterMode::Linear, + wgt::FilterMode::Nearest => webgpu_sys::GpuFilterMode::Nearest, + wgt::FilterMode::Linear => webgpu_sys::GpuFilterMode::Linear, } } -fn map_mipmap_filter_mode(mode: wgt::FilterMode) -> web_sys::GpuMipmapFilterMode { +fn map_mipmap_filter_mode(mode: wgt::FilterMode) -> webgpu_sys::GpuMipmapFilterMode { match mode { - wgt::FilterMode::Nearest => web_sys::GpuMipmapFilterMode::Nearest, - wgt::FilterMode::Linear => web_sys::GpuMipmapFilterMode::Linear, + wgt::FilterMode::Nearest => webgpu_sys::GpuMipmapFilterMode::Nearest, + wgt::FilterMode::Linear => webgpu_sys::GpuMipmapFilterMode::Linear, } } -fn map_address_mode(mode: wgt::AddressMode) -> web_sys::GpuAddressMode { +fn map_address_mode(mode: wgt::AddressMode) -> webgpu_sys::GpuAddressMode { match mode { - wgt::AddressMode::ClampToEdge => web_sys::GpuAddressMode::ClampToEdge, - wgt::AddressMode::Repeat => web_sys::GpuAddressMode::Repeat, - wgt::AddressMode::MirrorRepeat => web_sys::GpuAddressMode::MirrorRepeat, + wgt::AddressMode::ClampToEdge => webgpu_sys::GpuAddressMode::ClampToEdge, + wgt::AddressMode::Repeat => webgpu_sys::GpuAddressMode::Repeat, + wgt::AddressMode::MirrorRepeat => webgpu_sys::GpuAddressMode::MirrorRepeat, wgt::AddressMode::ClampToBorder => panic!("Clamp to border is not supported"), } } -fn map_color(color: wgt::Color) -> web_sys::GpuColorDict { - web_sys::GpuColorDict::new(color.a, color.b, color.g, color.r) +fn map_color(color: wgt::Color) -> webgpu_sys::GpuColorDict { + webgpu_sys::GpuColorDict::new(color.a, color.b, color.g, color.r) } -fn map_store_op(store: crate::StoreOp) -> web_sys::GpuStoreOp { +fn map_store_op(store: crate::StoreOp) -> webgpu_sys::GpuStoreOp { match store { - crate::StoreOp::Store => web_sys::GpuStoreOp::Store, - crate::StoreOp::Discard => web_sys::GpuStoreOp::Discard, + crate::StoreOp::Store => webgpu_sys::GpuStoreOp::Store, + crate::StoreOp::Discard => webgpu_sys::GpuStoreOp::Discard, } } fn map_map_mode(mode: crate::MapMode) -> u32 { match mode { - crate::MapMode::Read => web_sys::gpu_map_mode::READ, - crate::MapMode::Write => web_sys::gpu_map_mode::WRITE, + crate::MapMode::Read => webgpu_sys::gpu_map_mode::READ, + crate::MapMode::Write => webgpu_sys::gpu_map_mode::WRITE, } } -const FEATURES_MAPPING: [(wgt::Features, web_sys::GpuFeatureName); 11] = [ +const FEATURES_MAPPING: [(wgt::Features, webgpu_sys::GpuFeatureName); 11] = [ //TODO: update the name ( wgt::Features::DEPTH_CLIP_CONTROL, - web_sys::GpuFeatureName::DepthClipControl, + webgpu_sys::GpuFeatureName::DepthClipControl, ), ( wgt::Features::DEPTH32FLOAT_STENCIL8, - web_sys::GpuFeatureName::Depth32floatStencil8, + webgpu_sys::GpuFeatureName::Depth32floatStencil8, ), ( wgt::Features::TEXTURE_COMPRESSION_BC, - web_sys::GpuFeatureName::TextureCompressionBc, + webgpu_sys::GpuFeatureName::TextureCompressionBc, ), ( wgt::Features::TEXTURE_COMPRESSION_ETC2, - web_sys::GpuFeatureName::TextureCompressionEtc2, + webgpu_sys::GpuFeatureName::TextureCompressionEtc2, ), ( wgt::Features::TEXTURE_COMPRESSION_ASTC, - web_sys::GpuFeatureName::TextureCompressionAstc, + webgpu_sys::GpuFeatureName::TextureCompressionAstc, ), ( wgt::Features::TIMESTAMP_QUERY, - web_sys::GpuFeatureName::TimestampQuery, + webgpu_sys::GpuFeatureName::TimestampQuery, ), ( wgt::Features::INDIRECT_FIRST_INSTANCE, - web_sys::GpuFeatureName::IndirectFirstInstance, + webgpu_sys::GpuFeatureName::IndirectFirstInstance, ), ( wgt::Features::SHADER_F16, - web_sys::GpuFeatureName::ShaderF16, + webgpu_sys::GpuFeatureName::ShaderF16, ), ( wgt::Features::RG11B10UFLOAT_RENDERABLE, - web_sys::GpuFeatureName::Rg11b10ufloatRenderable, + webgpu_sys::GpuFeatureName::Rg11b10ufloatRenderable, ), ( wgt::Features::BGRA8UNORM_STORAGE, - web_sys::GpuFeatureName::Bgra8unormStorage, + webgpu_sys::GpuFeatureName::Bgra8unormStorage, ), ( wgt::Features::FLOAT32_FILTERABLE, - web_sys::GpuFeatureName::Float32Filterable, + webgpu_sys::GpuFeatureName::Float32Filterable, ), ]; -fn map_wgt_features(supported_features: web_sys::GpuSupportedFeatures) -> wgt::Features { +fn map_wgt_features(supported_features: webgpu_sys::GpuSupportedFeatures) -> wgt::Features { let mut features = wgt::Features::empty(); for (wgpu_feat, web_feat) in FEATURES_MAPPING { match wasm_bindgen::JsValue::from(web_feat).as_string() { @@ -698,7 +703,7 @@ fn map_wgt_features(supported_features: web_sys::GpuSupportedFeatures) -> wgt::F features } -fn map_wgt_limits(limits: web_sys::GpuSupportedLimits) -> wgt::Limits { +fn map_wgt_limits(limits: webgpu_sys::GpuSupportedLimits) -> wgt::Limits { wgt::Limits { max_texture_dimension_1d: limits.max_texture_dimension_1d(), max_texture_dimension_2d: limits.max_texture_dimension_2d(), @@ -796,8 +801,8 @@ type JsFutureResult = Result; fn future_request_adapter( result: JsFutureResult, ) -> Option<( - Identified, - Sendable, + Identified, + Sendable, )> { match result.and_then(wasm_bindgen::JsCast::dyn_into) { Ok(adapter) => Some(create_identified(adapter)), @@ -809,16 +814,16 @@ fn future_request_device( result: JsFutureResult, ) -> Result< ( - Identified, - Sendable, - Identified, - Sendable, + Identified, + Sendable, + Identified, + Sendable, ), crate::RequestDeviceError, > { result .map(|js_value| { - let (device_id, device_data) = create_identified(web_sys::GpuDevice::from(js_value)); + let (device_id, device_data) = create_identified(webgpu_sys::GpuDevice::from(js_value)); let (queue_id, queue_data) = create_identified(device_data.0.queue()); (device_id, device_data, queue_id, queue_data) @@ -926,7 +931,7 @@ impl ContextWebGpu { // Not returning this error because it is a type error that shouldn't happen unless // the browser, JS builtin objects, or wasm bindings are misbehaving somehow. - let context: web_sys::GpuCanvasContext = context + let context: webgpu_sys::GpuCanvasContext = context .dyn_into() .expect("canvas context is not a GPUCanvasContext"); @@ -944,7 +949,7 @@ impl ContextWebGpu { } // Represents the global object in the JavaScript context. -// It can be cast to from `web_sys::global` and exposes two getters `window` and `worker` of which only one is defined depending on the caller's context. +// It can be cast to from `webgpu_sys::global` and exposes two getters `window` and `worker` of which only one is defined depending on the caller's context. // When called from the UI thread only `window` is defined whereas `worker` is only defined within a web worker context. // See: https://github.com/rustwasm/gloo/blob/2c9e776701ecb90c53e62dec1abd19c2b70e47c7/crates/timers/src/callback.rs#L8-L40 #[wasm_bindgen] @@ -971,66 +976,65 @@ pub enum Canvas { /// See: /// * /// * -pub fn get_browser_gpu_property() -> Option { +pub fn get_browser_gpu_property() -> Option { let global: Global = js_sys::global().unchecked_into(); if !global.window().is_undefined() { - Some(global.unchecked_into::().navigator().gpu()) + let navigator = global.unchecked_into::().navigator(); + Some(ext_bindings::NavigatorGpu::gpu(&navigator)) } else if !global.worker().is_undefined() { - Some( - global - .unchecked_into::() - .navigator() - .gpu(), - ) + let navigator = global + .unchecked_into::() + .navigator(); + Some(ext_bindings::NavigatorGpu::gpu(&navigator)) } else { None } } impl crate::context::Context for ContextWebGpu { - type AdapterId = Identified; - type AdapterData = Sendable; - type DeviceId = Identified; - type DeviceData = Sendable; - type QueueId = Identified; - type QueueData = Sendable; - type ShaderModuleId = Identified; - type ShaderModuleData = Sendable; - type BindGroupLayoutId = Identified; - type BindGroupLayoutData = Sendable; - type BindGroupId = Identified; - type BindGroupData = Sendable; - type TextureViewId = Identified; - type TextureViewData = Sendable; - type SamplerId = Identified; - type SamplerData = Sendable; + type AdapterId = Identified; + type AdapterData = Sendable; + type DeviceId = Identified; + type DeviceData = Sendable; + type QueueId = Identified; + type QueueData = Sendable; + type ShaderModuleId = Identified; + type ShaderModuleData = Sendable; + type BindGroupLayoutId = Identified; + type BindGroupLayoutData = Sendable; + type BindGroupId = Identified; + type BindGroupData = Sendable; + type TextureViewId = Identified; + type TextureViewData = Sendable; + type SamplerId = Identified; + type SamplerData = Sendable; type BufferId = Identified; type BufferData = Sendable; - type TextureId = Identified; - type TextureData = Sendable; - type QuerySetId = Identified; - type QuerySetData = Sendable; - type PipelineLayoutId = Identified; - type PipelineLayoutData = Sendable; - type RenderPipelineId = Identified; - type RenderPipelineData = Sendable; - type ComputePipelineId = Identified; - type ComputePipelineData = Sendable; - type CommandEncoderId = Identified; - type CommandEncoderData = Sendable; - type ComputePassId = Identified; - type ComputePassData = Sendable; - type RenderPassId = Identified; - type RenderPassData = Sendable; - type CommandBufferId = Identified; - type CommandBufferData = Sendable; - type RenderBundleEncoderId = Identified; - type RenderBundleEncoderData = Sendable; - type RenderBundleId = Identified; - type RenderBundleData = Sendable; - type SurfaceId = Identified<(Canvas, web_sys::GpuCanvasContext)>; - type SurfaceData = Sendable<(Canvas, web_sys::GpuCanvasContext)>; + type TextureId = Identified; + type TextureData = Sendable; + type QuerySetId = Identified; + type QuerySetData = Sendable; + type PipelineLayoutId = Identified; + type PipelineLayoutData = Sendable; + type RenderPipelineId = Identified; + type RenderPipelineData = Sendable; + type ComputePipelineId = Identified; + type ComputePipelineData = Sendable; + type CommandEncoderId = Identified; + type CommandEncoderData = Sendable; + type ComputePassId = Identified; + type ComputePassData = Sendable; + type RenderPassId = Identified; + type RenderPassData = Sendable; + type CommandBufferId = Identified; + type CommandBufferData = Sendable; + type RenderBundleEncoderId = Identified; + type RenderBundleEncoderData = Sendable; + type RenderBundleId = Identified; + type RenderBundleData = Sendable; + type SurfaceId = Identified<(Canvas, webgpu_sys::GpuCanvasContext)>; + type SurfaceData = Sendable<(Canvas, webgpu_sys::GpuCanvasContext)>; type SurfaceOutputDetail = SurfaceOutputDetail; type SubmissionIndex = Unused; @@ -1122,12 +1126,12 @@ impl crate::context::Context for ContextWebGpu { // It's not trivial, since we need the Future logic to have this check, // and currently the Future here has no room for extra parameter `backends`. //assert!(backends.contains(wgt::Backends::BROWSER_WEBGPU)); - let mut mapped_options = web_sys::GpuRequestAdapterOptions::new(); + let mut mapped_options = webgpu_sys::GpuRequestAdapterOptions::new(); let mapped_power_preference = match options.power_preference { wgt::PowerPreference::None => None, - wgt::PowerPreference::LowPower => Some(web_sys::GpuPowerPreference::LowPower), + wgt::PowerPreference::LowPower => Some(webgpu_sys::GpuPowerPreference::LowPower), wgt::PowerPreference::HighPerformance => { - Some(web_sys::GpuPowerPreference::HighPerformance) + Some(webgpu_sys::GpuPowerPreference::HighPerformance) } }; if let Some(mapped_pref) = mapped_power_preference { @@ -1152,7 +1156,7 @@ impl crate::context::Context for ContextWebGpu { //Error: Tracing isn't supported on the Web target } - let mut mapped_desc = web_sys::GpuDeviceDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuDeviceDescriptor::new(); // TODO: Migrate to a web_sys api. // See https://github.com/rustwasm/wasm-bindgen/issues/3587 @@ -1323,11 +1327,13 @@ impl crate::context::Context for ContextWebGpu { panic!("Only Opaque/Auto or PreMultiplied alpha mode are supported on web"); } let alpha_mode = match config.alpha_mode { - wgt::CompositeAlphaMode::PreMultiplied => web_sys::GpuCanvasAlphaMode::Premultiplied, - _ => web_sys::GpuCanvasAlphaMode::Opaque, + wgt::CompositeAlphaMode::PreMultiplied => webgpu_sys::GpuCanvasAlphaMode::Premultiplied, + _ => webgpu_sys::GpuCanvasAlphaMode::Opaque, }; - let mut mapped = - web_sys::GpuCanvasConfiguration::new(&device_data.0, map_texture_format(config.format)); + let mut mapped = webgpu_sys::GpuCanvasConfiguration::new( + &device_data.0, + map_texture_format(config.format), + ); mapped.usage(config.usage.bits()); mapped.alpha_mode(alpha_mode); let mapped_view_formats = config @@ -1411,7 +1417,7 @@ impl crate::context::Context for ContextWebGpu { desc: crate::ShaderModuleDescriptor<'_>, _shader_bound_checks: wgt::ShaderBoundChecks, ) -> (Self::ShaderModuleId, Self::ShaderModuleData) { - let mut descriptor: web_sys::GpuShaderModuleDescriptor = match desc.source { + let mut descriptor: webgpu_sys::GpuShaderModuleDescriptor = match desc.source { #[cfg(feature = "spirv")] crate::ShaderSource::SpirV(ref spv) => { use naga::{back, front, valid}; @@ -1433,7 +1439,7 @@ impl crate::context::Context for ContextWebGpu { let writer_flags = naga::back::wgsl::WriterFlags::empty(); let wgsl_text = back::wgsl::write_string(&spv_module, &spv_module_info, writer_flags).unwrap(); - web_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) + webgpu_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) } #[cfg(feature = "glsl")] crate::ShaderSource::Glsl { @@ -1461,10 +1467,10 @@ impl crate::context::Context for ContextWebGpu { let wgsl_text = back::wgsl::write_string(&glsl_module, &glsl_module_info, writer_flags) .unwrap(); - web_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) + webgpu_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) } #[cfg(feature = "wgsl")] - crate::ShaderSource::Wgsl(ref code) => web_sys::GpuShaderModuleDescriptor::new(code), + crate::ShaderSource::Wgsl(ref code) => webgpu_sys::GpuShaderModuleDescriptor::new(code), #[cfg(feature = "naga-ir")] crate::ShaderSource::Naga(module) => { use naga::{back, valid}; @@ -1478,7 +1484,7 @@ impl crate::context::Context for ContextWebGpu { let writer_flags = naga::back::wgsl::WriterFlags::empty(); let wgsl_text = back::wgsl::write_string(&module, &module_info, writer_flags).unwrap(); - web_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) + webgpu_sys::GpuShaderModuleDescriptor::new(wgsl_text.as_str()) } crate::ShaderSource::Dummy(_) => { panic!("found `ShaderSource::Dummy`") @@ -1510,7 +1516,7 @@ impl crate::context::Context for ContextWebGpu { .iter() .map(|bind| { let mut mapped_entry = - web_sys::GpuBindGroupLayoutEntry::new(bind.binding, bind.visibility.bits()); + webgpu_sys::GpuBindGroupLayoutEntry::new(bind.binding, bind.visibility.bits()); match bind.ty { wgt::BindingType::Buffer { @@ -1518,35 +1524,35 @@ impl crate::context::Context for ContextWebGpu { has_dynamic_offset, min_binding_size, } => { - let mut buffer = web_sys::GpuBufferBindingLayout::new(); + let mut buffer = webgpu_sys::GpuBufferBindingLayout::new(); buffer.has_dynamic_offset(has_dynamic_offset); if let Some(size) = min_binding_size { buffer.min_binding_size(size.get() as f64); } buffer.type_(match ty { wgt::BufferBindingType::Uniform => { - web_sys::GpuBufferBindingType::Uniform + webgpu_sys::GpuBufferBindingType::Uniform } wgt::BufferBindingType::Storage { read_only: false } => { - web_sys::GpuBufferBindingType::Storage + webgpu_sys::GpuBufferBindingType::Storage } wgt::BufferBindingType::Storage { read_only: true } => { - web_sys::GpuBufferBindingType::ReadOnlyStorage + webgpu_sys::GpuBufferBindingType::ReadOnlyStorage } }); mapped_entry.buffer(&buffer); } wgt::BindingType::Sampler(ty) => { - let mut sampler = web_sys::GpuSamplerBindingLayout::new(); + let mut sampler = webgpu_sys::GpuSamplerBindingLayout::new(); sampler.type_(match ty { wgt::SamplerBindingType::NonFiltering => { - web_sys::GpuSamplerBindingType::NonFiltering + webgpu_sys::GpuSamplerBindingType::NonFiltering } wgt::SamplerBindingType::Filtering => { - web_sys::GpuSamplerBindingType::Filtering + webgpu_sys::GpuSamplerBindingType::Filtering } wgt::SamplerBindingType::Comparison => { - web_sys::GpuSamplerBindingType::Comparison + webgpu_sys::GpuSamplerBindingType::Comparison } }); mapped_entry.sampler(&sampler); @@ -1556,7 +1562,7 @@ impl crate::context::Context for ContextWebGpu { sample_type, view_dimension, } => { - let mut texture = web_sys::GpuTextureBindingLayout::new(); + let mut texture = webgpu_sys::GpuTextureBindingLayout::new(); texture.multisampled(multisampled); texture.sample_type(map_texture_component_type(sample_type)); texture.view_dimension(map_texture_view_dimension(view_dimension)); @@ -1569,7 +1575,7 @@ impl crate::context::Context for ContextWebGpu { } => { let mapped_access = match access { wgt::StorageTextureAccess::WriteOnly => { - web_sys::GpuStorageTextureAccess::WriteOnly + webgpu_sys::GpuStorageTextureAccess::WriteOnly } wgt::StorageTextureAccess::ReadOnly => { panic!("ReadOnly is not available") @@ -1578,7 +1584,7 @@ impl crate::context::Context for ContextWebGpu { panic!("ReadWrite is not available") } }; - let mut storage_texture = web_sys::GpuStorageTextureBindingLayout::new( + let mut storage_texture = webgpu_sys::GpuStorageTextureBindingLayout::new( map_texture_format(format), ); storage_texture.access(mapped_access); @@ -1592,7 +1598,7 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_desc = web_sys::GpuBindGroupLayoutDescriptor::new(&mapped_bindings); + let mut mapped_desc = webgpu_sys::GpuBindGroupLayoutDescriptor::new(&mapped_bindings); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1618,7 +1624,7 @@ impl crate::context::Context for ContextWebGpu { let buffer: &::BufferData = downcast_ref(buffer.data.as_ref()); let mut mapped_buffer_binding = - web_sys::GpuBufferBinding::new(&buffer.0.buffer); + webgpu_sys::GpuBufferBinding::new(&buffer.0.buffer); mapped_buffer_binding.offset(offset as f64); if let Some(s) = size { mapped_buffer_binding.size(s.get() as f64); @@ -1646,13 +1652,13 @@ impl crate::context::Context for ContextWebGpu { } }; - web_sys::GpuBindGroupEntry::new(binding.binding, &mapped_resource) + webgpu_sys::GpuBindGroupEntry::new(binding.binding, &mapped_resource) }) .collect::(); let bgl: &::BindGroupLayoutData = downcast_ref(desc.layout.data.as_ref()); - let mut mapped_desc = web_sys::GpuBindGroupDescriptor::new(&mapped_entries, &bgl.0); + let mut mapped_desc = webgpu_sys::GpuBindGroupDescriptor::new(&mapped_entries, &bgl.0); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1674,7 +1680,7 @@ impl crate::context::Context for ContextWebGpu { &bgl.0 }) .collect::(); - let mut mapped_desc = web_sys::GpuPipelineLayoutDescriptor::new(&temp_layouts); + let mut mapped_desc = webgpu_sys::GpuPipelineLayoutDescriptor::new(&temp_layouts); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1690,7 +1696,7 @@ impl crate::context::Context for ContextWebGpu { let module: &::ShaderModuleData = downcast_ref(desc.vertex.module.data.as_ref()); let mut mapped_vertex_state = - web_sys::GpuVertexState::new(desc.vertex.entry_point, &module.0); + webgpu_sys::GpuVertexState::new(desc.vertex.entry_point, &module.0); let buffers = desc .vertex @@ -1701,7 +1707,7 @@ impl crate::context::Context for ContextWebGpu { .attributes .iter() .map(|attr| { - web_sys::GpuVertexAttribute::new( + webgpu_sys::GpuVertexAttribute::new( map_vertex_format(attr.format), attr.offset as f64, attr.shader_location, @@ -1709,7 +1715,7 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_vbuf = web_sys::GpuVertexBufferLayout::new( + let mut mapped_vbuf = webgpu_sys::GpuVertexBufferLayout::new( vbuf.array_stride as f64, &mapped_attributes, ); @@ -1720,8 +1726,8 @@ impl crate::context::Context for ContextWebGpu { mapped_vertex_state.buffers(&buffers); - let auto_layout = wasm_bindgen::JsValue::from(web_sys::GpuAutoLayoutMode::Auto); - let mut mapped_desc = web_sys::GpuRenderPipelineDescriptor::new( + let auto_layout = wasm_bindgen::JsValue::from(webgpu_sys::GpuAutoLayoutMode::Auto); + let mut mapped_desc = webgpu_sys::GpuRenderPipelineDescriptor::new( &match desc.layout { Some(layout) => { let layout: &::PipelineLayoutData = @@ -1749,11 +1755,11 @@ impl crate::context::Context for ContextWebGpu { Some(target) => { let mapped_format = map_texture_format(target.format); let mut mapped_color_state = - web_sys::GpuColorTargetState::new(mapped_format); + webgpu_sys::GpuColorTargetState::new(mapped_format); if let Some(ref bs) = target.blend { let alpha = map_blend_component(&bs.alpha); let color = map_blend_component(&bs.color); - let mapped_blend_state = web_sys::GpuBlendState::new(&alpha, &color); + let mapped_blend_state = webgpu_sys::GpuBlendState::new(&alpha, &color); mapped_color_state.blend(&mapped_blend_state); } mapped_color_state.write_mask(target.write_mask.bits()); @@ -1765,11 +1771,11 @@ impl crate::context::Context for ContextWebGpu { let module: &::ShaderModuleData = downcast_ref(frag.module.data.as_ref()); let mapped_fragment_desc = - web_sys::GpuFragmentState::new(frag.entry_point, &module.0, &targets); + webgpu_sys::GpuFragmentState::new(frag.entry_point, &module.0, &targets); mapped_desc.fragment(&mapped_fragment_desc); } - let mut mapped_multisample = web_sys::GpuMultisampleState::new(); + let mut mapped_multisample = webgpu_sys::GpuMultisampleState::new(); mapped_multisample.count(desc.multisample.count); mapped_multisample.mask(desc.multisample.mask as u32); mapped_multisample.alpha_to_coverage_enabled(desc.multisample.alpha_to_coverage_enabled); @@ -1790,9 +1796,9 @@ impl crate::context::Context for ContextWebGpu { let shader_module: &::ShaderModuleData = downcast_ref(desc.module.data.as_ref()); let mapped_compute_stage = - web_sys::GpuProgrammableStage::new(desc.entry_point, &shader_module.0); - let auto_layout = wasm_bindgen::JsValue::from(web_sys::GpuAutoLayoutMode::Auto); - let mut mapped_desc = web_sys::GpuComputePipelineDescriptor::new( + webgpu_sys::GpuProgrammableStage::new(desc.entry_point, &shader_module.0); + let auto_layout = wasm_bindgen::JsValue::from(webgpu_sys::GpuAutoLayoutMode::Auto); + let mut mapped_desc = webgpu_sys::GpuComputePipelineDescriptor::new( &match desc.layout { Some(layout) => { let layout: &::PipelineLayoutData = @@ -1816,7 +1822,7 @@ impl crate::context::Context for ContextWebGpu { desc: &crate::BufferDescriptor<'_>, ) -> (Self::BufferId, Self::BufferData) { let mut mapped_desc = - web_sys::GpuBufferDescriptor::new(desc.size as f64, desc.usage.bits()); + webgpu_sys::GpuBufferDescriptor::new(desc.size as f64, desc.usage.bits()); mapped_desc.mapped_at_creation(desc.mapped_at_creation); if let Some(label) = desc.label { mapped_desc.label(label); @@ -1833,7 +1839,7 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::TextureDescriptor<'_>, ) -> (Self::TextureId, Self::TextureData) { - let mut mapped_desc = web_sys::GpuTextureDescriptor::new( + let mut mapped_desc = webgpu_sys::GpuTextureDescriptor::new( map_texture_format(desc.format), &map_extent_3d(desc.size), desc.usage.bits(), @@ -1859,7 +1865,7 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::SamplerDescriptor<'_>, ) -> (Self::SamplerId, Self::SamplerData) { - let mut mapped_desc = web_sys::GpuSamplerDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuSamplerDescriptor::new(); mapped_desc.address_mode_u(map_address_mode(desc.address_mode_u)); mapped_desc.address_mode_v(map_address_mode(desc.address_mode_v)); mapped_desc.address_mode_w(map_address_mode(desc.address_mode_w)); @@ -1886,11 +1892,11 @@ impl crate::context::Context for ContextWebGpu { desc: &wgt::QuerySetDescriptor>, ) -> (Self::QuerySetId, Self::QuerySetData) { let ty = match desc.ty { - wgt::QueryType::Occlusion => web_sys::GpuQueryType::Occlusion, - wgt::QueryType::Timestamp => web_sys::GpuQueryType::Timestamp, + wgt::QueryType::Occlusion => webgpu_sys::GpuQueryType::Occlusion, + wgt::QueryType::Timestamp => webgpu_sys::GpuQueryType::Timestamp, wgt::QueryType::PipelineStatistics(_) => unreachable!(), }; - let mut mapped_desc = web_sys::GpuQuerySetDescriptor::new(desc.count, ty); + let mut mapped_desc = webgpu_sys::GpuQuerySetDescriptor::new(desc.count, ty); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1903,7 +1909,7 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, desc: &crate::CommandEncoderDescriptor<'_>, ) -> (Self::CommandEncoderId, Self::CommandEncoderData) { - let mut mapped_desc = web_sys::GpuCommandEncoderDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuCommandEncoderDescriptor::new(); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1928,7 +1934,8 @@ impl crate::context::Context for ContextWebGpu { None => wasm_bindgen::JsValue::null(), }) .collect::(); - let mut mapped_desc = web_sys::GpuRenderBundleEncoderDescriptor::new(&mapped_color_formats); + let mut mapped_desc = + webgpu_sys::GpuRenderBundleEncoderDescriptor::new(&mapped_color_formats); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -1989,7 +1996,7 @@ impl crate::context::Context for ContextWebGpu { device_data: &Self::DeviceData, handler: Box, ) { - let f = Closure::wrap(Box::new(move |event: web_sys::GpuUncapturedErrorEvent| { + let f = Closure::wrap(Box::new(move |event: webgpu_sys::GpuUncapturedErrorEvent| { let error = crate::Error::from_js(event.error().value_of()); handler(error); }) as Box); @@ -2007,9 +2014,9 @@ impl crate::context::Context for ContextWebGpu { filter: crate::ErrorFilter, ) { device_data.0.push_error_scope(match filter { - crate::ErrorFilter::OutOfMemory => web_sys::GpuErrorFilter::OutOfMemory, - crate::ErrorFilter::Validation => web_sys::GpuErrorFilter::Validation, - }); + crate::ErrorFilter::OutOfMemory => webgpu_sys::GpuErrorFilter::OutOfMemory, + crate::ErrorFilter::Validation => webgpu_sys::GpuErrorFilter::Validation, + }) } fn device_pop_error_scope( @@ -2068,7 +2075,7 @@ impl crate::context::Context for ContextWebGpu { texture_data: &Self::TextureData, desc: &crate::TextureViewDescriptor<'_>, ) -> (Self::TextureViewId, Self::TextureViewData) { - let mut mapped = web_sys::GpuTextureViewDescriptor::new(); + let mut mapped = webgpu_sys::GpuTextureViewDescriptor::new(); if let Some(dim) = desc.dimension { mapped.dimension(map_texture_view_dimension(dim)); } @@ -2300,7 +2307,7 @@ impl crate::context::Context for ContextWebGpu { encoder_data: &Self::CommandEncoderData, desc: &crate::ComputePassDescriptor<'_>, ) -> (Self::ComputePassId, Self::ComputePassData) { - let mut mapped_desc = web_sys::GpuComputePassDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuComputePassDescriptor::new(); if let Some(label) = desc.label { mapped_desc.label(label); } @@ -2336,15 +2343,15 @@ impl crate::context::Context for ContextWebGpu { let load_value = match ca.ops.load { crate::LoadOp::Clear(color) => { clear_value = Some(wasm_bindgen::JsValue::from(map_color(color))); - web_sys::GpuLoadOp::Clear + webgpu_sys::GpuLoadOp::Clear } - crate::LoadOp::Load => web_sys::GpuLoadOp::Load, + crate::LoadOp::Load => webgpu_sys::GpuLoadOp::Load, }; let view: &::TextureViewData = downcast_ref(ca.view.data.as_ref()); - let mut mapped_color_attachment = web_sys::GpuRenderPassColorAttachment::new( + let mut mapped_color_attachment = webgpu_sys::GpuRenderPassColorAttachment::new( load_value, map_store_op(ca.ops.store), &view.0, @@ -2365,7 +2372,7 @@ impl crate::context::Context for ContextWebGpu { }) .collect::(); - let mut mapped_desc = web_sys::GpuRenderPassDescriptor::new(&mapped_color_attachments); + let mut mapped_desc = webgpu_sys::GpuRenderPassDescriptor::new(&mapped_color_attachments); if let Some(label) = desc.label { mapped_desc.label(label); @@ -2375,14 +2382,14 @@ impl crate::context::Context for ContextWebGpu { let depth_stencil_attachment: &::TextureViewData = downcast_ref(dsa.view.data.as_ref()); let mut mapped_depth_stencil_attachment = - web_sys::GpuRenderPassDepthStencilAttachment::new(&depth_stencil_attachment.0); + webgpu_sys::GpuRenderPassDepthStencilAttachment::new(&depth_stencil_attachment.0); if let Some(ref ops) = dsa.depth_ops { let load_op = match ops.load { crate::LoadOp::Clear(v) => { mapped_depth_stencil_attachment.depth_clear_value(v); - web_sys::GpuLoadOp::Clear + webgpu_sys::GpuLoadOp::Clear } - crate::LoadOp::Load => web_sys::GpuLoadOp::Load, + crate::LoadOp::Load => webgpu_sys::GpuLoadOp::Load, }; mapped_depth_stencil_attachment.depth_load_op(load_op); mapped_depth_stencil_attachment.depth_store_op(map_store_op(ops.store)); @@ -2392,9 +2399,9 @@ impl crate::context::Context for ContextWebGpu { let load_op = match ops.load { crate::LoadOp::Clear(v) => { mapped_depth_stencil_attachment.stencil_clear_value(v); - web_sys::GpuLoadOp::Clear + webgpu_sys::GpuLoadOp::Clear } - crate::LoadOp::Load => web_sys::GpuLoadOp::Load, + crate::LoadOp::Load => webgpu_sys::GpuLoadOp::Load, }; mapped_depth_stencil_attachment.stencil_load_op(load_op); mapped_depth_stencil_attachment.stencil_store_op(map_store_op(ops.store)); @@ -2425,7 +2432,7 @@ impl crate::context::Context for ContextWebGpu { create_identified(if label.is_empty() { encoder_data.0.finish() } else { - let mut mapped_desc = web_sys::GpuCommandBufferDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuCommandBufferDescriptor::new(); mapped_desc.label(&label); encoder_data.0.finish_with_descriptor(&mapped_desc) }) @@ -2534,7 +2541,7 @@ impl crate::context::Context for ContextWebGpu { ) -> (Self::RenderBundleId, Self::RenderBundleData) { create_identified(match desc.label { Some(label) => { - let mut mapped_desc = web_sys::GpuRenderBundleDescriptor::new(); + let mut mapped_desc = webgpu_sys::GpuRenderBundleDescriptor::new(); mapped_desc.label(label); encoder_data.0.finish_with_descriptor(&mapped_desc) } @@ -2652,7 +2659,7 @@ impl crate::context::Context for ContextWebGpu { data_layout: wgt::ImageDataLayout, size: wgt::Extent3d, ) { - let mut mapped_data_layout = web_sys::GpuImageDataLayout::new(); + let mut mapped_data_layout = webgpu_sys::GpuImageDataLayout::new(); if let Some(bytes_per_row) = data_layout.bytes_per_row { mapped_data_layout.bytes_per_row(bytes_per_row); } @@ -3464,20 +3471,20 @@ impl QueueWriteBuffer for WebQueueWriteBuffer { } /// Stores the state of a GPU buffer and a reference to its mapped `ArrayBuffer` (if any). -/// The WebGPU specification forbids calling `getMappedRange` on a `web_sys::GpuBuffer` more than +/// The WebGPU specification forbids calling `getMappedRange` on a `webgpu_sys::GpuBuffer` more than /// once, so this struct stores the initial mapped range and re-uses it, allowing for multiple `get_mapped_range` /// calls on the Rust-side. #[derive(Debug)] pub struct WebBuffer { /// The associated GPU buffer. - buffer: web_sys::GpuBuffer, + buffer: webgpu_sys::GpuBuffer, /// The mapped array buffer and mapped range. mapping: RefCell, } impl WebBuffer { /// Creates a new web buffer for the given Javascript object and description. - fn new(buffer: web_sys::GpuBuffer, desc: &crate::BufferDescriptor<'_>) -> Self { + fn new(buffer: webgpu_sys::GpuBuffer, desc: &crate::BufferDescriptor<'_>) -> Self { Self { buffer, mapping: RefCell::new(WebBufferMapState { diff --git a/wgpu/src/backend/webgpu/ext_bindings.rs b/wgpu/src/backend/webgpu/ext_bindings.rs new file mode 100644 index 0000000000..218caf75cd --- /dev/null +++ b/wgpu/src/backend/webgpu/ext_bindings.rs @@ -0,0 +1,45 @@ +//! Extension bindings for WebGPU. +//! +//! These contain ideomatic Rust extension traits for various parts of the WebGPU +//! bindings that are missing, need to be improved, or otherwise need to be different +//! from the generated web_sys bindings. + +use crate::backend::webgpu::webgpu_sys; +use wasm_bindgen::prelude::*; + +/// Extension trait for [`web_sys::Navigator`] and [`web_sys::WorkerNavigator`] to +/// access the `gpu` property. +pub trait NavigatorGpu { + /// Get the `gpu` property. + /// + /// This is intentionally a free function, to prevent overload conflicts with + /// the method if it is enabled in web-sys itself. + fn gpu(navigator: &Self) -> webgpu_sys::Gpu; +} + +// --- Bindings for `Navigator` --- +#[wasm_bindgen] +extern "C" { + /// Create a fake class which we tell wasm-bindgen has access to the `gpu` property. + #[wasm_bindgen] + type NavigatorWithGpu; + + #[wasm_bindgen(method, getter)] + fn gpu(ext: &NavigatorWithGpu) -> webgpu_sys::Gpu; +} + +impl NavigatorGpu for web_sys::Navigator { + fn gpu(navigator: &Self) -> webgpu_sys::Gpu { + // Must be an unchecked ref as this class does not exist at runtime. + let extension: &NavigatorWithGpu = navigator.unchecked_ref(); + extension.gpu() + } +} + +impl NavigatorGpu for web_sys::WorkerNavigator { + fn gpu(navigator: &Self) -> webgpu_sys::Gpu { + // Must be an unchecked ref as this class does not exist at runtime. + let extension: &NavigatorWithGpu = navigator.unchecked_ref(); + extension.gpu() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs new file mode 100644 index 0000000000..b7f5116dc5 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_Gpu.rs @@ -0,0 +1,73 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPU , typescript_type = "GPU")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Gpu` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type Gpu; + + # [wasm_bindgen (structural , method , getter , js_class = "GPU" , js_name = wgslLanguageFeatures)] + #[doc = "Getter for the `wgslLanguageFeatures` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/wgslLanguageFeatures)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`, `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn wgsl_language_features(this: &Gpu) -> WgslLanguageFeatures; + + # [wasm_bindgen (method , structural , js_class = "GPU" , js_name = getPreferredCanvasFormat)] + #[doc = "The `getPreferredCanvasFormat()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/getPreferredCanvasFormat)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_preferred_canvas_format(this: &Gpu) -> GpuTextureFormat; + + # [wasm_bindgen (method , structural , js_class = "GPU" , js_name = requestAdapter)] + #[doc = "The `requestAdapter()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_adapter(this: &Gpu) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPU" , js_name = requestAdapter)] + #[doc = "The `requestAdapter()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`, `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_adapter_with_options( + this: &Gpu, + options: &GpuRequestAdapterOptions, + ) -> ::js_sys::Promise; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs new file mode 100644 index 0000000000..86b6ea7e20 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAdapter.rs @@ -0,0 +1,109 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUAdapter , typescript_type = "GPUAdapter")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuAdapter` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuAdapter; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = features)] + #[doc = "Getter for the `features` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/features)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn features(this: &GpuAdapter) -> GpuSupportedFeatures; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = limits)] + #[doc = "Getter for the `limits` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/limits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn limits(this: &GpuAdapter) -> GpuSupportedLimits; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isFallbackAdapter)] + #[doc = "Getter for the `isFallbackAdapter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/isFallbackAdapter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_fallback_adapter(this: &GpuAdapter) -> bool; + + # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestAdapterInfo)] + #[doc = "The `requestAdapterInfo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestAdapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_adapter_info(this: &GpuAdapter) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestAdapterInfo)] + #[doc = "The `requestAdapterInfo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestAdapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_adapter_info_with_unmask_hints( + this: &GpuAdapter, + unmask_hints: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)] + #[doc = "The `requestDevice()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_device(this: &GpuAdapter) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)] + #[doc = "The `requestDevice()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_device_with_descriptor( + this: &GpuAdapter, + descriptor: &GpuDeviceDescriptor, + ) -> ::js_sys::Promise; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs new file mode 100644 index 0000000000..3898328368 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAddressMode.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuAddressMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuAddressMode { + ClampToEdge = "clamp-to-edge", + Repeat = "repeat", + MirrorRepeat = "mirror-repeat", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs new file mode 100644 index 0000000000..a9739f13c6 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuAutoLayoutMode.rs @@ -0,0 +1,22 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuAutoLayoutMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuAutoLayoutMode { + Auto = "auto", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs new file mode 100644 index 0000000000..b33fe7a311 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroup.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroup , typescript_type = "GPUBindGroup")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroup` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroup; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBindGroup" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBindGroup) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroup" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuBindGroup, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs new file mode 100644 index 0000000000..ba24b60e56 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupDescriptor.rs @@ -0,0 +1,96 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroupDescriptor; +} + +impl GpuBindGroupDescriptor { + #[doc = "Construct a new `GpuBindGroupDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entries(entries); + ret.layout(layout); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entries"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs new file mode 100644 index 0000000000..625f1f3c67 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupEntry.rs @@ -0,0 +1,82 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupEntry)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupEntry` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroupEntry; +} + +impl GpuBindGroupEntry { + #[doc = "Construct a new `GpuBindGroupEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, resource: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.binding(binding); + ret.resource(resource); + ret + } + + #[doc = "Change the `binding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn binding(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("binding"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `resource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn resource(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("resource"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs new file mode 100644 index 0000000000..ee2d928f23 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayout.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupLayout , typescript_type = "GPUBindGroupLayout")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupLayout` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroupLayout; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBindGroupLayout" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBindGroupLayout) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroupLayout" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuBindGroupLayout, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs new file mode 100644 index 0000000000..6c6a59422f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutDescriptor.rs @@ -0,0 +1,77 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupLayoutDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroupLayoutDescriptor; +} + +impl GpuBindGroupLayoutDescriptor { + #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entries(entries); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entries"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs new file mode 100644 index 0000000000..451fd6f808 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBindGroupLayoutEntry.rs @@ -0,0 +1,184 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutEntry)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupLayoutEntry` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBindGroupLayoutEntry; +} + +impl GpuBindGroupLayoutEntry { + #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, visibility: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.binding(binding); + ret.visibility(visibility); + ret + } + + #[doc = "Change the `binding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn binding(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("binding"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `externalTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuExternalTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("externalTexture"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `sampler` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuSamplerBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampler"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `storageTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("storageTexture"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("texture"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `visibility` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn visibility(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("visibility"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs new file mode 100644 index 0000000000..0b816598b1 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendComponent.rs @@ -0,0 +1,107 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBlendComponent)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBlendComponent` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBlendComponent; +} + +impl GpuBlendComponent { + #[doc = "Construct a new `GpuBlendComponent`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `dstFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("dstFactor"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `operation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn operation(&mut self, val: GpuBlendOperation) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("operation"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `srcFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn src_factor(&mut self, val: GpuBlendFactor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("srcFactor"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuBlendComponent { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs new file mode 100644 index 0000000000..20f5988f32 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendFactor.rs @@ -0,0 +1,34 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuBlendFactor` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBlendFactor`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBlendFactor { + Zero = "zero", + One = "one", + Src = "src", + OneMinusSrc = "one-minus-src", + SrcAlpha = "src-alpha", + OneMinusSrcAlpha = "one-minus-src-alpha", + Dst = "dst", + OneMinusDst = "one-minus-dst", + DstAlpha = "dst-alpha", + OneMinusDstAlpha = "one-minus-dst-alpha", + SrcAlphaSaturated = "src-alpha-saturated", + Constant = "constant", + OneMinusConstant = "one-minus-constant", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs new file mode 100644 index 0000000000..ab3be1e4a1 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendOperation.rs @@ -0,0 +1,26 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuBlendOperation` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBlendOperation`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBlendOperation { + Add = "add", + Subtract = "subtract", + ReverseSubtract = "reverse-subtract", + Min = "min", + Max = "max", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs new file mode 100644 index 0000000000..3be6f4c365 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBlendState.rs @@ -0,0 +1,74 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBlendState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBlendState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBlendState; +} + +impl GpuBlendState { + #[doc = "Construct a new `GpuBlendState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.alpha(alpha); + ret.color(color); + ret + } + + #[doc = "Change the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `color` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs new file mode 100644 index 0000000000..0958f12f86 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBuffer.rs @@ -0,0 +1,293 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBuffer , typescript_type = "GPUBuffer")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBuffer` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBuffer; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &GpuBuffer) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = usage)] + #[doc = "Getter for the `usage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/usage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(this: &GpuBuffer) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = mapState)] + #[doc = "Getter for the `mapState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferMapState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_state(this: &GpuBuffer) -> GpuBufferMapState; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBuffer) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUBuffer" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuBuffer, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = destroy)] + #[doc = "The `destroy()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/destroy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn destroy(this: &GpuBuffer); + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range(this: &GpuBuffer) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_u32(this: &GpuBuffer, offset: u32) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_f64(this: &GpuBuffer, offset: f64) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_u32_and_u32( + this: &GpuBuffer, + offset: u32, + size: u32, + ) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_f64_and_u32( + this: &GpuBuffer, + offset: f64, + size: u32, + ) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_u32_and_f64( + this: &GpuBuffer, + offset: u32, + size: f64, + ) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + #[doc = "The `getMappedRange()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_mapped_range_with_f64_and_f64( + this: &GpuBuffer, + offset: f64, + size: f64, + ) -> ::js_sys::ArrayBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async(this: &GpuBuffer, mode: u32) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_u32(this: &GpuBuffer, mode: u32, offset: u32) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_f64(this: &GpuBuffer, mode: u32, offset: f64) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_u32_and_u32( + this: &GpuBuffer, + mode: u32, + offset: u32, + size: u32, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_f64_and_u32( + this: &GpuBuffer, + mode: u32, + offset: f64, + size: u32, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_u32_and_f64( + this: &GpuBuffer, + mode: u32, + offset: u32, + size: f64, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] + #[doc = "The `mapAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_async_with_f64_and_f64( + this: &GpuBuffer, + mode: u32, + offset: f64, + size: f64, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = unmap)] + #[doc = "The `unmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/unmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn unmap(this: &GpuBuffer); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs new file mode 100644 index 0000000000..dd90600e95 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBinding.rs @@ -0,0 +1,92 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferBinding)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBufferBinding` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBufferBinding; +} + +impl GpuBufferBinding { + #[doc = "Construct a new `GpuBufferBinding`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.buffer(buffer); + ret + } + + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn offset(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs new file mode 100644 index 0000000000..cbfb47e9a2 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingLayout.rs @@ -0,0 +1,103 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBufferBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBufferBindingLayout; +} + +impl GpuBufferBindingLayout { + #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `hasDynamicOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("hasDynamicOffset"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `minBindingSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn min_binding_size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("minBindingSize"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`, `GpuBufferBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(&mut self, val: GpuBufferBindingType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuBufferBindingLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs new file mode 100644 index 0000000000..a0cefa845b --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferBindingType.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuBufferBindingType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBufferBindingType { + Uniform = "uniform", + Storage = "storage", + ReadOnlyStorage = "read-only-storage", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs new file mode 100644 index 0000000000..4ecefeb0f4 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferDescriptor.rs @@ -0,0 +1,112 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBufferDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBufferDescriptor; +} + +impl GpuBufferDescriptor { + #[doc = "Construct a new `GpuBufferDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(size: f64, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.size(size); + ret.usage(usage); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mappedAtCreation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mappedAtCreation"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs new file mode 100644 index 0000000000..defe3edbad --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuBufferMapState.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuBufferMapState` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBufferMapState`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBufferMapState { + Unmapped = "unmapped", + Pending = "pending", + Mapped = "mapped", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs new file mode 100644 index 0000000000..9410ccb7c7 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasAlphaMode.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuCanvasAlphaMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCanvasAlphaMode { + Opaque = "opaque", + Premultiplied = "premultiplied", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs new file mode 100644 index 0000000000..1ff15d5831 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasConfiguration.rs @@ -0,0 +1,135 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCanvasConfiguration)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCanvasConfiguration` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCanvasConfiguration; +} + +impl GpuCanvasConfiguration { + #[doc = "Construct a new `GpuCanvasConfiguration`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &GpuDevice, format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.device(device); + ret.format(format); + ret + } + + #[doc = "Change the `alphaMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`, `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn alpha_mode(&mut self, val: GpuCanvasAlphaMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("alphaMode"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(&mut self, val: &GpuDevice) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewFormats"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs new file mode 100644 index 0000000000..33a8dd1d46 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCanvasContext.rs @@ -0,0 +1,70 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCanvasContext , typescript_type = "GPUCanvasContext")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCanvasContext` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCanvasContext; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCanvasContext" , js_name = canvas)] + #[doc = "Getter for the `canvas` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/canvas)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn canvas(this: &GpuCanvasContext) -> ::js_sys::Object; + + # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = configure)] + #[doc = "The `configure()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn configure(this: &GpuCanvasContext, configuration: &GpuCanvasConfiguration); + + # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)] + #[doc = "The `getCurrentTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_current_texture(this: &GpuCanvasContext) -> GpuTexture; + + # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = unconfigure)] + #[doc = "The `unconfigure()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/unconfigure)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn unconfigure(this: &GpuCanvasContext); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs new file mode 100644 index 0000000000..eb59187bfa --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorDict.rs @@ -0,0 +1,110 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorDict)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuColorDict` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuColorDict; +} + +impl GpuColorDict { + #[doc = "Construct a new `GpuColorDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(a: f64, b: f64, g: f64, r: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.a(a); + ret.b(b); + ret.g(g); + ret.r(r); + ret + } + + #[doc = "Change the `a` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn a(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn b(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `g` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn g(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("g"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `r` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn r(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs new file mode 100644 index 0000000000..9ac9762321 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuColorTargetState.rs @@ -0,0 +1,95 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorTargetState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuColorTargetState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuColorTargetState; +} + +impl GpuColorTargetState { + #[doc = "Construct a new `GpuColorTargetState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); + ret + } + + #[doc = "Change the `blend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `writeMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("writeMask"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs new file mode 100644 index 0000000000..ec7f60b6d5 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBuffer.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCommandBuffer , typescript_type = "GPUCommandBuffer")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandBuffer` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCommandBuffer; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCommandBuffer" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuCommandBuffer) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandBuffer" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuCommandBuffer, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs new file mode 100644 index 0000000000..ad91cbcc01 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandBufferDescriptor.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCommandBufferDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandBufferDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCommandBufferDescriptor; +} + +impl GpuCommandBufferDescriptor { + #[doc = "Construct a new `GpuCommandBufferDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuCommandBufferDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs new file mode 100644 index 0000000000..ef4d7a24c9 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoder.rs @@ -0,0 +1,529 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCommandEncoder , typescript_type = "GPUCommandEncoder")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandEncoder` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCommandEncoder; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCommandEncoder" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuCommandEncoder) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandEncoder" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuCommandEncoder, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginComputePass)] + #[doc = "The `beginComputePass()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginComputePass)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn begin_compute_pass(this: &GpuCommandEncoder) -> GpuComputePassEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginComputePass)] + #[doc = "The `beginComputePass()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginComputePass)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuComputePassDescriptor`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn begin_compute_pass_with_descriptor( + this: &GpuCommandEncoder, + descriptor: &GpuComputePassDescriptor, + ) -> GpuComputePassEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginRenderPass)] + #[doc = "The `beginRenderPass()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginRenderPass)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuRenderPassDescriptor`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn begin_render_pass( + this: &GpuCommandEncoder, + descriptor: &GpuRenderPassDescriptor, + ) -> GpuRenderPassEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer(this: &GpuCommandEncoder, buffer: &GpuBuffer); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32(this: &GpuCommandEncoder, buffer: &GpuBuffer, offset: u32); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64(this: &GpuCommandEncoder, buffer: &GpuBuffer, offset: f64); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32_and_u32( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64_and_u32( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32_and_f64( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64_and_f64( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_u32_and_u32_and_u32( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: u32, + destination: &GpuBuffer, + destination_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_f64_and_u32_and_u32( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: f64, + destination: &GpuBuffer, + destination_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_u32_and_f64_and_u32( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: u32, + destination: &GpuBuffer, + destination_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_f64_and_f64_and_u32( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: f64, + destination: &GpuBuffer, + destination_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_u32_and_u32_and_f64( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: u32, + destination: &GpuBuffer, + destination_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_f64_and_u32_and_f64( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: f64, + destination: &GpuBuffer, + destination_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_u32_and_f64_and_f64( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: u32, + destination: &GpuBuffer, + destination_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + #[doc = "The `copyBufferToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_buffer_with_f64_and_f64_and_f64( + this: &GpuCommandEncoder, + source: &GpuBuffer, + source_offset: f64, + destination: &GpuBuffer, + destination_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + #[doc = "The `copyBufferToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_texture_with_u32_sequence( + this: &GpuCommandEncoder, + source: &GpuImageCopyBuffer, + destination: &GpuImageCopyTexture, + copy_size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + #[doc = "The `copyBufferToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_buffer_to_texture_with_gpu_extent_3d_dict( + this: &GpuCommandEncoder, + source: &GpuImageCopyBuffer, + destination: &GpuImageCopyTexture, + copy_size: &GpuExtent3dDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + #[doc = "The `copyTextureToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_texture_to_buffer_with_u32_sequence( + this: &GpuCommandEncoder, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyBuffer, + copy_size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + #[doc = "The `copyTextureToBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_texture_to_buffer_with_gpu_extent_3d_dict( + this: &GpuCommandEncoder, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyBuffer, + copy_size: &GpuExtent3dDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + #[doc = "The `copyTextureToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_texture_to_texture_with_u32_sequence( + this: &GpuCommandEncoder, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyTexture, + copy_size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + #[doc = "The `copyTextureToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_texture_to_texture_with_gpu_extent_3d_dict( + this: &GpuCommandEncoder, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyTexture, + copy_size: &GpuExtent3dDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = finish)] + #[doc = "The `finish()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/finish)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish(this: &GpuCommandEncoder) -> GpuCommandBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = finish)] + #[doc = "The `finish()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/finish)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`, `GpuCommandBufferDescriptor`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish_with_descriptor( + this: &GpuCommandEncoder, + descriptor: &GpuCommandBufferDescriptor, + ) -> GpuCommandBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = resolveQuerySet)] + #[doc = "The `resolveQuerySet()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/resolveQuerySet)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn resolve_query_set_with_u32( + this: &GpuCommandEncoder, + query_set: &GpuQuerySet, + first_query: u32, + query_count: u32, + destination: &GpuBuffer, + destination_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = resolveQuerySet)] + #[doc = "The `resolveQuerySet()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/resolveQuerySet)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn resolve_query_set_with_f64( + this: &GpuCommandEncoder, + query_set: &GpuQuerySet, + first_query: u32, + query_count: u32, + destination: &GpuBuffer, + destination_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = writeTimestamp)] + #[doc = "The `writeTimestamp()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/writeTimestamp)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_timestamp(this: &GpuCommandEncoder, query_set: &GpuQuerySet, query_index: u32); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuCommandEncoder, marker_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuCommandEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuCommandEncoder, group_label: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs new file mode 100644 index 0000000000..8d07fa85a0 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCommandEncoderDescriptor.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCommandEncoderDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandEncoderDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCommandEncoderDescriptor; +} + +impl GpuCommandEncoderDescriptor { + #[doc = "Construct a new `GpuCommandEncoderDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuCommandEncoderDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs new file mode 100644 index 0000000000..6af814301f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompareFunction.rs @@ -0,0 +1,29 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuCompareFunction` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCompareFunction { + Never = "never", + Less = "less", + Equal = "equal", + LessEqual = "less-equal", + Greater = "greater", + NotEqual = "not-equal", + GreaterEqual = "greater-equal", + Always = "always", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs new file mode 100644 index 0000000000..1834d41062 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationInfo.rs @@ -0,0 +1,37 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCompilationInfo , typescript_type = "GPUCompilationInfo")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCompilationInfo` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCompilationInfo; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationInfo" , js_name = messages)] + #[doc = "Getter for the `messages` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationInfo/messages)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn messages(this: &GpuCompilationInfo) -> ::js_sys::Array; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs new file mode 100644 index 0000000000..33d010ee3b --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessage.rs @@ -0,0 +1,92 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCompilationMessage , typescript_type = "GPUCompilationMessage")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCompilationMessage` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCompilationMessage; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = message)] + #[doc = "Getter for the `message` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/message)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn message(this: &GpuCompilationMessage) -> String; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = type)] + #[doc = "Getter for the `type` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/type)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`, `GpuCompilationMessageType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(this: &GpuCompilationMessage) -> GpuCompilationMessageType; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = lineNum)] + #[doc = "Getter for the `lineNum` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/lineNum)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn line_num(this: &GpuCompilationMessage) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = linePos)] + #[doc = "Getter for the `linePos` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/linePos)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn line_pos(this: &GpuCompilationMessage) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = offset)] + #[doc = "Getter for the `offset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/offset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn offset(this: &GpuCompilationMessage) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = length)] + #[doc = "Getter for the `length` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage/length)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn length(this: &GpuCompilationMessage) -> f64; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs new file mode 100644 index 0000000000..bed12455d3 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCompilationMessageType.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuCompilationMessageType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCompilationMessageType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCompilationMessageType { + Error = "error", + Warning = "warning", + Info = "info", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs new file mode 100644 index 0000000000..4d444078de --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassDescriptor.rs @@ -0,0 +1,82 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePassDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePassDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePassDescriptor; +} + +impl GpuComputePassDescriptor { + #[doc = "Construct a new `GpuComputePassDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn timestamp_writes(&mut self, val: &GpuComputePassTimestampWrites) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("timestampWrites"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuComputePassDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs new file mode 100644 index 0000000000..af50a1fb03 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassEncoder.rs @@ -0,0 +1,242 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePassEncoder , typescript_type = "GPUComputePassEncoder")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePassEncoder` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePassEncoder; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUComputePassEncoder" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuComputePassEncoder) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePassEncoder" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuComputePassEncoder, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_workgroups(this: &GpuComputePassEncoder, workgroup_count_x: u32); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_workgroups_with_workgroup_count_y( + this: &GpuComputePassEncoder, + workgroup_count_x: u32, + workgroup_count_y: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_workgroups_with_workgroup_count_y_and_workgroup_count_z( + this: &GpuComputePassEncoder, + workgroup_count_x: u32, + workgroup_count_y: u32, + workgroup_count_z: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroupsIndirect)] + #[doc = "The `dispatchWorkgroupsIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroupsIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_workgroups_indirect_with_u32( + this: &GpuComputePassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroupsIndirect)] + #[doc = "The `dispatchWorkgroupsIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroupsIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_workgroups_indirect_with_f64( + this: &GpuComputePassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = end)] + #[doc = "The `end()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/end)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end(this: &GpuComputePassEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setPipeline)] + #[doc = "The `setPipeline()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setPipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`, `GpuComputePipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_pipeline(this: &GpuComputePassEncoder, pipeline: &GpuComputePipeline); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_sequence( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuComputePassEncoder, marker_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuComputePassEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuComputePassEncoder, group_label: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs new file mode 100644 index 0000000000..d0c7845c75 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePassTimestampWrites.rs @@ -0,0 +1,102 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePassTimestampWrites)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePassTimestampWrites` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePassTimestampWrites; +} + +impl GpuComputePassTimestampWrites { + #[doc = "Construct a new `GpuComputePassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.query_set(query_set); + ret + } + + #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("beginningOfPassWriteIndex"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("endOfPassWriteIndex"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("querySet"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs new file mode 100644 index 0000000000..b97b6f8eaf --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipeline.rs @@ -0,0 +1,59 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePipeline , typescript_type = "GPUComputePipeline")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePipeline` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePipeline; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUComputePipeline" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuComputePipeline) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePipeline" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuComputePipeline, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUComputePipeline" , js_name = getBindGroupLayout)] + #[doc = "The `getBindGroupLayout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline/getBindGroupLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`, `GpuComputePipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_bind_group_layout(this: &GpuComputePipeline, index: u32) -> GpuBindGroupLayout; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs new file mode 100644 index 0000000000..67ed9fe723 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuComputePipelineDescriptor.rs @@ -0,0 +1,96 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePipelineDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePipelineDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePipelineDescriptor; +} + +impl GpuComputePipelineDescriptor { + #[doc = "Construct a new `GpuComputePipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, compute: &GpuProgrammableStage) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.layout(layout); + ret.compute(compute); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `compute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("compute"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs new file mode 100644 index 0000000000..a8b5e335d1 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuCullMode.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuCullMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCullMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCullMode { + None = "none", + Front = "front", + Back = "back", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs new file mode 100644 index 0000000000..87f6846c15 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDepthStencilState.rs @@ -0,0 +1,252 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUDepthStencilState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDepthStencilState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuDepthStencilState; +} + +impl GpuDepthStencilState { + #[doc = "Construct a new `GpuDepthStencilState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + depth_compare: GpuCompareFunction, + depth_write_enabled: bool, + format: GpuTextureFormat, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.depth_compare(depth_compare); + ret.depth_write_enabled(depth_write_enabled); + ret.format(format); + ret + } + + #[doc = "Change the `depthBias` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_bias(&mut self, val: i32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthBias"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthBiasClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthBiasClamp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthBiasSlopeScale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthBiasSlopeScale"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthCompare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthCompare"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthWriteEnabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthWriteEnabled"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilBack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilBack"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilFront` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilFront"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilReadMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilReadMask"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilWriteMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilWriteMask"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs new file mode 100644 index 0000000000..18761f2e0b --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDevice.rs @@ -0,0 +1,368 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = GPUDevice , typescript_type = "GPUDevice")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDevice` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuDevice; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = features)] + #[doc = "Getter for the `features` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/features)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn features(this: &GpuDevice) -> GpuSupportedFeatures; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = limits)] + #[doc = "Getter for the `limits` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/limits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn limits(this: &GpuDevice) -> GpuSupportedLimits; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = queue)] + #[doc = "Getter for the `queue` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/queue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn queue(this: &GpuDevice) -> GpuQueue; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = lost)] + #[doc = "Getter for the `lost` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/lost)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn lost(this: &GpuDevice) -> ::js_sys::Promise; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = onuncapturederror)] + #[doc = "Getter for the `onuncapturederror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/onuncapturederror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onuncapturederror(this: &GpuDevice) -> Option<::js_sys::Function>; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUDevice" , js_name = onuncapturederror)] + #[doc = "Setter for the `onuncapturederror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/onuncapturederror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onuncapturederror(this: &GpuDevice, value: Option<&::js_sys::Function>); + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuDevice) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUDevice" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuDevice, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBindGroup)] + #[doc = "The `createBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuBindGroupDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_bind_group(this: &GpuDevice, descriptor: &GpuBindGroupDescriptor) + -> GpuBindGroup; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBindGroupLayout)] + #[doc = "The `createBindGroupLayout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroupLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`, `GpuBindGroupLayoutDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_bind_group_layout( + this: &GpuDevice, + descriptor: &GpuBindGroupLayoutDescriptor, + ) -> GpuBindGroupLayout; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBuffer)] + #[doc = "The `createBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_buffer(this: &GpuDevice, descriptor: &GpuBufferDescriptor) -> GpuBuffer; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createCommandEncoder)] + #[doc = "The `createCommandEncoder()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createCommandEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_command_encoder(this: &GpuDevice) -> GpuCommandEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createCommandEncoder)] + #[doc = "The `createCommandEncoder()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createCommandEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuCommandEncoderDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_command_encoder_with_descriptor( + this: &GpuDevice, + descriptor: &GpuCommandEncoderDescriptor, + ) -> GpuCommandEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createComputePipeline)] + #[doc = "The `createComputePipeline()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createComputePipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipeline`, `GpuComputePipelineDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_compute_pipeline( + this: &GpuDevice, + descriptor: &GpuComputePipelineDescriptor, + ) -> GpuComputePipeline; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createComputePipelineAsync)] + #[doc = "The `createComputePipelineAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createComputePipelineAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_compute_pipeline_async( + this: &GpuDevice, + descriptor: &GpuComputePipelineDescriptor, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createPipelineLayout)] + #[doc = "The `createPipelineLayout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuPipelineLayout`, `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_pipeline_layout( + this: &GpuDevice, + descriptor: &GpuPipelineLayoutDescriptor, + ) -> GpuPipelineLayout; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createQuerySet)] + #[doc = "The `createQuerySet()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createQuerySet)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuQuerySet`, `GpuQuerySetDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_query_set(this: &GpuDevice, descriptor: &GpuQuerySetDescriptor) -> GpuQuerySet; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderBundleEncoder)] + #[doc = "The `createRenderBundleEncoder()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderBundleEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderBundleEncoder`, `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_render_bundle_encoder( + this: &GpuDevice, + descriptor: &GpuRenderBundleEncoderDescriptor, + ) -> GpuRenderBundleEncoder; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipeline)] + #[doc = "The `createRenderPipeline()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderPipeline`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_render_pipeline( + this: &GpuDevice, + descriptor: &GpuRenderPipelineDescriptor, + ) -> GpuRenderPipeline; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipelineAsync)] + #[doc = "The `createRenderPipelineAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipelineAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_render_pipeline_async( + this: &GpuDevice, + descriptor: &GpuRenderPipelineDescriptor, + ) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createSampler)] + #[doc = "The `createSampler()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createSampler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuSampler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_sampler(this: &GpuDevice) -> GpuSampler; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createSampler)] + #[doc = "The `createSampler()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createSampler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuSampler`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_sampler_with_descriptor( + this: &GpuDevice, + descriptor: &GpuSamplerDescriptor, + ) -> GpuSampler; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createShaderModule)] + #[doc = "The `createShaderModule()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createShaderModule)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuShaderModule`, `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_shader_module( + this: &GpuDevice, + descriptor: &GpuShaderModuleDescriptor, + ) -> GpuShaderModule; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createTexture)] + #[doc = "The `createTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuTexture`, `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_texture(this: &GpuDevice, descriptor: &GpuTextureDescriptor) -> GpuTexture; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = destroy)] + #[doc = "The `destroy()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/destroy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn destroy(this: &GpuDevice); + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = importExternalTexture)] + #[doc = "The `importExternalTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/importExternalTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuExternalTexture`, `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn import_external_texture( + this: &GpuDevice, + descriptor: &GpuExternalTextureDescriptor, + ) -> GpuExternalTexture; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = popErrorScope)] + #[doc = "The `popErrorScope()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/popErrorScope)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_error_scope(this: &GpuDevice) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = pushErrorScope)] + #[doc = "The `pushErrorScope()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/pushErrorScope)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuErrorFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_error_scope(this: &GpuDevice, filter: GpuErrorFilter); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs new file mode 100644 index 0000000000..4dcf14aa62 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceDescriptor.rs @@ -0,0 +1,103 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUDeviceDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDeviceDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuDeviceDescriptor; +} + +impl GpuDeviceDescriptor { + #[doc = "Construct a new `GpuDeviceDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `defaultQueue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("defaultQueue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("requiredFeatures"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuDeviceDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs new file mode 100644 index 0000000000..42700f01be --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostInfo.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUDeviceLostInfo , typescript_type = "GPUDeviceLostInfo")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDeviceLostInfo` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuDeviceLostInfo; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = reason)] + #[doc = "Getter for the `reason` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo/reason)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`, `GpuDeviceLostReason`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reason(this: &GpuDeviceLostInfo) -> GpuDeviceLostReason; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = message)] + #[doc = "Getter for the `message` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo/message)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn message(this: &GpuDeviceLostInfo) -> String; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs new file mode 100644 index 0000000000..53dece5bd4 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuDeviceLostReason.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuDeviceLostReason` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostReason`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuDeviceLostReason { + Unknown = "unknown", + Destroyed = "destroyed", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs new file mode 100644 index 0000000000..342fe3f3fb --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuError.rs @@ -0,0 +1,37 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUError , typescript_type = "GPUError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuError; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUError" , js_name = message)] + #[doc = "Getter for the `message` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUError/message)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn message(this: &GpuError) -> String; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs new file mode 100644 index 0000000000..a3d7cd8837 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuErrorFilter.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuErrorFilter` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuErrorFilter`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuErrorFilter { + Validation = "validation", + OutOfMemory = "out-of-memory", + Internal = "internal", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs new file mode 100644 index 0000000000..6937907432 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExtent3dDict.rs @@ -0,0 +1,95 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUExtent3DDict)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuExtent3dDict` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuExtent3dDict; +} + +impl GpuExtent3dDict { + #[doc = "Construct a new `GpuExtent3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(width: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.width(width); + ret + } + + #[doc = "Change the `depthOrArrayLayers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthOrArrayLayers"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn height(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn width(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs new file mode 100644 index 0000000000..056edea181 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTexture.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUExternalTexture , typescript_type = "GPUExternalTexture")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuExternalTexture` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUExternalTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuExternalTexture; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUExternalTexture" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUExternalTexture/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuExternalTexture) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUExternalTexture" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUExternalTexture/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuExternalTexture, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs new file mode 100644 index 0000000000..7d68c8bc7f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureBindingLayout.rs @@ -0,0 +1,44 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUExternalTextureBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuExternalTextureBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuExternalTextureBindingLayout; +} + +impl GpuExternalTextureBindingLayout { + #[doc = "Construct a new `GpuExternalTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } +} + +impl Default for GpuExternalTextureBindingLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs new file mode 100644 index 0000000000..6a650e9335 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuExternalTextureDescriptor.rs @@ -0,0 +1,74 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUExternalTextureDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuExternalTextureDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuExternalTextureDescriptor; +} + +impl GpuExternalTextureDescriptor { + #[doc = "Construct a new `GpuExternalTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.source(source); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs new file mode 100644 index 0000000000..37643db20c --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFeatureName.rs @@ -0,0 +1,32 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuFeatureName` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuFeatureName`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuFeatureName { + DepthClipControl = "depth-clip-control", + Depth32floatStencil8 = "depth32float-stencil8", + TextureCompressionBc = "texture-compression-bc", + TextureCompressionEtc2 = "texture-compression-etc2", + TextureCompressionAstc = "texture-compression-astc", + TimestampQuery = "timestamp-query", + IndirectFirstInstance = "indirect-first-instance", + ShaderF16 = "shader-f16", + Rg11b10ufloatRenderable = "rg11b10ufloat-renderable", + Bgra8unormStorage = "bgra8unorm-storage", + Float32Filterable = "float32-filterable", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs new file mode 100644 index 0000000000..28db3b5ed1 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFilterMode.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuFilterMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuFilterMode { + Nearest = "nearest", + Linear = "linear", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs new file mode 100644 index 0000000000..3378332431 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFragmentState.rs @@ -0,0 +1,105 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUFragmentState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuFragmentState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuFragmentState; +} + +impl GpuFragmentState { + #[doc = "Construct a new `GpuFragmentState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + entry_point: &str, + module: &GpuShaderModule, + targets: &::wasm_bindgen::JsValue, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entry_point(entry_point); + ret.module(module); + ret.targets(targets); + ret + } + + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entryPoint"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `targets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("targets"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs new file mode 100644 index 0000000000..d27328fa33 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuFrontFace.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuFrontFace` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuFrontFace { + Ccw = "ccw", + Cw = "cw", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs new file mode 100644 index 0000000000..31f11bbd0c --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyBuffer.rs @@ -0,0 +1,117 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuImageCopyBuffer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuImageCopyBuffer; +} + +impl GpuImageCopyBuffer { + #[doc = "Construct a new `GpuImageCopyBuffer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.buffer(buffer); + ret + } + + #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bytesPerRow"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn offset(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("rowsPerImage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs new file mode 100644 index 0000000000..e6d1cf0ba7 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyExternalImage.rs @@ -0,0 +1,92 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyExternalImage)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuImageCopyExternalImage` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuImageCopyExternalImage; +} + +impl GpuImageCopyExternalImage { + #[doc = "Construct a new `GpuImageCopyExternalImage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.source(source); + ret + } + + #[doc = "Change the `flipY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn flip_y(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flipY"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs new file mode 100644 index 0000000000..8d80479d81 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTexture.rs @@ -0,0 +1,117 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTexture)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuImageCopyTexture` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuImageCopyTexture; +} + +impl GpuImageCopyTexture { + #[doc = "Construct a new `GpuImageCopyTexture`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.texture(texture); + ret + } + + #[doc = "Change the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mipLevel"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("texture"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs new file mode 100644 index 0000000000..e105d6e163 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageCopyTextureTagged.rs @@ -0,0 +1,138 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTextureTagged)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuImageCopyTextureTagged` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuImageCopyTextureTagged; +} + +impl GpuImageCopyTextureTagged { + #[doc = "Construct a new `GpuImageCopyTextureTagged`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.texture(texture); + ret + } + + #[doc = "Change the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mipLevel"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("texture"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("premultipliedAlpha"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs new file mode 100644 index 0000000000..09514a5e07 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuImageDataLayout.rs @@ -0,0 +1,104 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageDataLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuImageDataLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuImageDataLayout; +} + +impl GpuImageDataLayout { + #[doc = "Construct a new `GpuImageDataLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bytesPerRow"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn offset(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("rowsPerImage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuImageDataLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs new file mode 100644 index 0000000000..060781f6cb --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuIndexFormat.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuIndexFormat` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuIndexFormat { + Uint16 = "uint16", + Uint32 = "uint32", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs new file mode 100644 index 0000000000..3bcd76e7db --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuLoadOp.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuLoadOp` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuLoadOp { + Load = "load", + Clear = "clear", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs new file mode 100644 index 0000000000..614292dadb --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMipmapFilterMode.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuMipmapFilterMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuMipmapFilterMode { + Nearest = "nearest", + Linear = "linear", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs new file mode 100644 index 0000000000..16956c7990 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuMultisampleState.rs @@ -0,0 +1,99 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUMultisampleState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuMultisampleState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuMultisampleState; +} + +impl GpuMultisampleState { + #[doc = "Construct a new `GpuMultisampleState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `alphaToCoverageEnabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("alphaToCoverageEnabled"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuMultisampleState { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs new file mode 100644 index 0000000000..8d89a2881f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuObjectDescriptorBase.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUObjectDescriptorBase)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuObjectDescriptorBase` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuObjectDescriptorBase; +} + +impl GpuObjectDescriptorBase { + #[doc = "Construct a new `GpuObjectDescriptorBase`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuObjectDescriptorBase { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs new file mode 100644 index 0000000000..8ee471283d --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin2dDict.rs @@ -0,0 +1,78 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUOrigin2DDict)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuOrigin2dDict` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuOrigin2dDict; +} + +impl GpuOrigin2dDict { + #[doc = "Construct a new `GpuOrigin2dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn x(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn y(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuOrigin2dDict { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs new file mode 100644 index 0000000000..5e351cbfc2 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOrigin3dDict.rs @@ -0,0 +1,95 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUOrigin3DDict)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuOrigin3dDict` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuOrigin3dDict; +} + +impl GpuOrigin3dDict { + #[doc = "Construct a new `GpuOrigin3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn x(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn y(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn z(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuOrigin3dDict { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs new file mode 100644 index 0000000000..5dbea5d99f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuOutOfMemoryError.rs @@ -0,0 +1,37 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = GpuError , extends = :: js_sys :: Object , js_name = GPUOutOfMemoryError , typescript_type = "GPUOutOfMemoryError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuOutOfMemoryError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUOutOfMemoryError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOutOfMemoryError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuOutOfMemoryError; + + #[wasm_bindgen(catch, constructor, js_class = "GPUOutOfMemoryError")] + #[doc = "The `new GpuOutOfMemoryError(..)` constructor, creating a new instance of `GpuOutOfMemoryError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUOutOfMemoryError/GPUOutOfMemoryError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOutOfMemoryError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(message: &str) -> Result; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs new file mode 100644 index 0000000000..1356af41a5 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineDescriptorBase.rs @@ -0,0 +1,74 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPipelineDescriptorBase)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineDescriptorBase` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPipelineDescriptorBase; +} + +impl GpuPipelineDescriptorBase { + #[doc = "Construct a new `GpuPipelineDescriptorBase`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.layout(layout); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs new file mode 100644 index 0000000000..d02240038b --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayout.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPipelineLayout , typescript_type = "GPUPipelineLayout")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineLayout` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPipelineLayout; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUPipelineLayout" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuPipelineLayout) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUPipelineLayout" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuPipelineLayout, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs new file mode 100644 index 0000000000..23d14344b6 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPipelineLayoutDescriptor.rs @@ -0,0 +1,77 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPipelineLayoutDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineLayoutDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPipelineLayoutDescriptor; +} + +impl GpuPipelineLayoutDescriptor { + #[doc = "Construct a new `GpuPipelineLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(bind_group_layouts: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.bind_group_layouts(bind_group_layouts); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `bindGroupLayouts` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bind_group_layouts(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bindGroupLayouts"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs new file mode 100644 index 0000000000..eb2aa505f5 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPowerPreference.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuPowerPreference` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuPowerPreference`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuPowerPreference { + LowPower = "low-power", + HighPerformance = "high-performance", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs new file mode 100644 index 0000000000..b43f60c129 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveState.rs @@ -0,0 +1,149 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPrimitiveState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPrimitiveState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPrimitiveState; +} + +impl GpuPrimitiveState { + #[doc = "Construct a new `GpuPrimitiveState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `cullMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("cullMode"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `frontFace` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("frontFace"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stripIndexFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stripIndexFormat"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `topology` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuPrimitiveTopology`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("topology"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `unclippedDepth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn unclipped_depth(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("unclippedDepth"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuPrimitiveState { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs new file mode 100644 index 0000000000..588134ab73 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuPrimitiveTopology.rs @@ -0,0 +1,26 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuPrimitiveTopology` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveTopology`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuPrimitiveTopology { + PointList = "point-list", + LineList = "line-list", + LineStrip = "line-strip", + TriangleList = "triangle-list", + TriangleStrip = "triangle-strip", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs new file mode 100644 index 0000000000..5f957d599e --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuProgrammableStage.rs @@ -0,0 +1,79 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUProgrammableStage)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuProgrammableStage` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuProgrammableStage; +} + +impl GpuProgrammableStage { + #[doc = "Construct a new `GpuProgrammableStage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entry_point(entry_point); + ret.module(module); + ret + } + + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entryPoint"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs new file mode 100644 index 0000000000..bb0f529404 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySet.rs @@ -0,0 +1,81 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQuerySet , typescript_type = "GPUQuerySet")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuQuerySet` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuQuerySet; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , js_name = type)] + #[doc = "Getter for the `type` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/type)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(this: &GpuQuerySet) -> GpuQueryType; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , js_name = count)] + #[doc = "Getter for the `count` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/count)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn count(this: &GpuQuerySet) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuQuerySet) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUQuerySet" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuQuerySet, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUQuerySet" , js_name = destroy)] + #[doc = "The `destroy()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/destroy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn destroy(this: &GpuQuerySet); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs new file mode 100644 index 0000000000..97b6978aae --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQuerySetDescriptor.rs @@ -0,0 +1,91 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQuerySetDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuQuerySetDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuQuerySetDescriptor; +} + +impl GpuQuerySetDescriptor { + #[doc = "Construct a new `GpuQuerySetDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(count: u32, type_: GpuQueryType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.count(count); + ret.type_(type_); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(&mut self, val: GpuQueryType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs new file mode 100644 index 0000000000..a3b90f0ddd --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueryType.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuQueryType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuQueryType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuQueryType { + Occlusion = "occlusion", + Timestamp = "timestamp", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs new file mode 100644 index 0000000000..248afd0b5f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueue.rs @@ -0,0 +1,658 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQueue , typescript_type = "GPUQueue")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuQueue` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuQueue; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUQueue" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuQueue) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUQueue" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuQueue, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + #[doc = "The `copyExternalImageToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_external_image_to_texture_with_u32_sequence( + this: &GpuQueue, + source: &GpuImageCopyExternalImage, + destination: &GpuImageCopyTextureTagged, + copy_size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + #[doc = "The `copyExternalImageToTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_external_image_to_texture_with_gpu_extent_3d_dict( + this: &GpuQueue, + source: &GpuImageCopyExternalImage, + destination: &GpuImageCopyTextureTagged, + copy_size: &GpuExtent3dDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = onSubmittedWorkDone)] + #[doc = "The `onSubmittedWorkDone()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/onSubmittedWorkDone)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn on_submitted_work_done(this: &GpuQueue) -> ::js_sys::Promise; + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = submit)] + #[doc = "The `submit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/submit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn submit(this: &GpuQueue, command_buffers: &::wasm_bindgen::JsValue); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_buffer_source_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Object, + data_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_buffer_source_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Object, + data_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &[u8], + data_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &[u8], + data_offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_buffer_source_and_u32_sequence( + this: &GpuQueue, + destination: &GpuImageCopyTexture, + data: &::js_sys::Object, + data_layout: &GpuImageDataLayout, + size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_u32_sequence( + this: &GpuQueue, + destination: &GpuImageCopyTexture, + data: &[u8], + data_layout: &GpuImageDataLayout, + size: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_buffer_source_and_gpu_extent_3d_dict( + this: &GpuQueue, + destination: &GpuImageCopyTexture, + data: &::js_sys::Object, + data_layout: &GpuImageDataLayout, + size: &GpuExtent3dDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( + this: &GpuQueue, + destination: &GpuImageCopyTexture, + data: &[u8], + data_layout: &GpuImageDataLayout, + size: &GpuExtent3dDict, + ); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs new file mode 100644 index 0000000000..b81ac8240c --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuQueueDescriptor.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQueueDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuQueueDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuQueueDescriptor; +} + +impl GpuQueueDescriptor { + #[doc = "Construct a new `GpuQueueDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuQueueDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs new file mode 100644 index 0000000000..43178cabbe --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundle.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderBundle , typescript_type = "GPURenderBundle")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundle` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderBundle; + + # [wasm_bindgen (structural , method , getter , js_class = "GPURenderBundle" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderBundle) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundle" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuRenderBundle, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs new file mode 100644 index 0000000000..b62393c923 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleDescriptor.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderBundleDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundleDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderBundleDescriptor; +} + +impl GpuRenderBundleDescriptor { + #[doc = "Construct a new `GpuRenderBundleDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuRenderBundleDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs new file mode 100644 index 0000000000..3f969e4760 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoder.rs @@ -0,0 +1,606 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderBundleEncoder , typescript_type = "GPURenderBundleEncoder")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundleEncoder` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderBundleEncoder; + + # [wasm_bindgen (structural , method , getter , js_class = "GPURenderBundleEncoder" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderBundleEncoder) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundleEncoder" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuRenderBundleEncoder, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = finish)] + #[doc = "The `finish()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/finish)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundle`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish(this: &GpuRenderBundleEncoder) -> GpuRenderBundle; + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = finish)] + #[doc = "The `finish()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/finish)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundle`, `GpuRenderBundleDescriptor`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish_with_descriptor( + this: &GpuRenderBundleEncoder, + descriptor: &GpuRenderBundleDescriptor, + ) -> GpuRenderBundle; + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_sequence( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuRenderBundleEncoder, marker_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuRenderBundleEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuRenderBundleEncoder, group_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw(this: &GpuRenderBundleEncoder, vertex_count: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count( + this: &GpuRenderBundleEncoder, + vertex_count: u32, + instance_count: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count_and_first_vertex( + this: &GpuRenderBundleEncoder, + vertex_count: u32, + instance_count: u32, + first_vertex: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count_and_first_vertex_and_first_instance( + this: &GpuRenderBundleEncoder, + vertex_count: u32, + instance_count: u32, + first_vertex: u32, + first_instance: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed(this: &GpuRenderBundleEncoder, index_count: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count( + this: &GpuRenderBundleEncoder, + index_count: u32, + instance_count: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index( + this: &GpuRenderBundleEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index_and_base_vertex( + this: &GpuRenderBundleEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + base_vertex: i32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index_and_base_vertex_and_first_instance( + this: &GpuRenderBundleEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + base_vertex: i32, + first_instance: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexedIndirect)] + #[doc = "The `drawIndexedIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexedIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_indirect_with_u32( + this: &GpuRenderBundleEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndexedIndirect)] + #[doc = "The `drawIndexedIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexedIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_indirect_with_f64( + this: &GpuRenderBundleEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndirect)] + #[doc = "The `drawIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indirect_with_u32( + this: &GpuRenderBundleEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = drawIndirect)] + #[doc = "The `drawIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indirect_with_f64( + this: &GpuRenderBundleEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32_and_u32( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64_and_u32( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32_and_f64( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64_and_f64( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setPipeline)] + #[doc = "The `setPipeline()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setPipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`, `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_pipeline(this: &GpuRenderBundleEncoder, pipeline: &GpuRenderPipeline); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer(this: &GpuRenderBundleEncoder, slot: u32, buffer: Option<&GpuBuffer>); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32_and_u32( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64_and_u32( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32_and_f64( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64_and_f64( + this: &GpuRenderBundleEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + size: f64, + ); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs new file mode 100644 index 0000000000..1c6c0d1ee4 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderBundleEncoderDescriptor.rs @@ -0,0 +1,161 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderBundleEncoderDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundleEncoderDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderBundleEncoderDescriptor; +} + +impl GpuRenderBundleEncoderDescriptor { + #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.color_formats(color_formats); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `colorFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("colorFormats"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthStencilFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthStencilFormat"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampleCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthReadOnly"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilReadOnly"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs new file mode 100644 index 0000000000..9358bc1048 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassColorAttachment.rs @@ -0,0 +1,139 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassColorAttachment)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassColorAttachment` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassColorAttachment; +} + +impl GpuRenderPassColorAttachment { + #[doc = "Construct a new `GpuRenderPassColorAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.load_op(load_op); + ret.store_op(store_op); + ret.view(view); + ret + } + + #[doc = "Change the `clearValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("clearValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `loadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loadOp"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `resolveTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("resolveTarget"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `storeOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("storeOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs new file mode 100644 index 0000000000..88f8755e9d --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDepthStencilAttachment.rs @@ -0,0 +1,224 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassDepthStencilAttachment)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassDepthStencilAttachment` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassDepthStencilAttachment; +} + +impl GpuRenderPassDepthStencilAttachment { + #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.view(view); + ret + } + + #[doc = "Change the `depthClearValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_clear_value(&mut self, val: f32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthClearValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthLoadOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthReadOnly"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthStoreOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilClearValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_clear_value(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilClearValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilLoadOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilReadOnly"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stencilStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilStoreOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs new file mode 100644 index 0000000000..3471b2fea6 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassDescriptor.rs @@ -0,0 +1,164 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassDescriptor; +} + +impl GpuRenderPassDescriptor { + #[doc = "Construct a new `GpuRenderPassDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_attachments: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.color_attachments(color_attachments); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `colorAttachments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("colorAttachments"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthStencilAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_stencil_attachment( + &mut self, + val: &GpuRenderPassDepthStencilAttachment, + ) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthStencilAttachment"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `maxDrawCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_draw_count(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxDrawCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `occlusionQuerySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn occlusion_query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("occlusionQuerySet"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn timestamp_writes(&mut self, val: &GpuRenderPassTimestampWrites) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("timestampWrites"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs new file mode 100644 index 0000000000..e3646d45a5 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassEncoder.rs @@ -0,0 +1,694 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassEncoder , typescript_type = "GPURenderPassEncoder")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassEncoder` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassEncoder; + + # [wasm_bindgen (structural , method , getter , js_class = "GPURenderPassEncoder" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderPassEncoder) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPassEncoder" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuRenderPassEncoder, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = beginOcclusionQuery)] + #[doc = "The `beginOcclusionQuery()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/beginOcclusionQuery)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn begin_occlusion_query(this: &GpuRenderPassEncoder, query_index: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = end)] + #[doc = "The `end()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/end)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end(this: &GpuRenderPassEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = endOcclusionQuery)] + #[doc = "The `endOcclusionQuery()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/endOcclusionQuery)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end_occlusion_query(this: &GpuRenderPassEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = executeBundles)] + #[doc = "The `executeBundles()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/executeBundles)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn execute_bundles(this: &GpuRenderPassEncoder, bundles: &::wasm_bindgen::JsValue); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + #[doc = "The `setBlendConstant()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_blend_constant_with_f64_sequence( + this: &GpuRenderPassEncoder, + color: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + #[doc = "The `setBlendConstant()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_blend_constant_with_gpu_color_dict( + this: &GpuRenderPassEncoder, + color: &GpuColorDict, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setScissorRect)] + #[doc = "The `setScissorRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setScissorRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_scissor_rect(this: &GpuRenderPassEncoder, x: u32, y: u32, width: u32, height: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setStencilReference)] + #[doc = "The `setStencilReference()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setStencilReference)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_stencil_reference(this: &GpuRenderPassEncoder, reference: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setViewport)] + #[doc = "The `setViewport()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setViewport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_viewport( + this: &GpuRenderPassEncoder, + x: f32, + y: f32, + width: f32, + height: f32, + min_depth: f32, + max_depth: f32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_sequence( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuRenderPassEncoder, marker_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuRenderPassEncoder); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuRenderPassEncoder, group_label: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw(this: &GpuRenderPassEncoder, vertex_count: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count( + this: &GpuRenderPassEncoder, + vertex_count: u32, + instance_count: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count_and_first_vertex( + this: &GpuRenderPassEncoder, + vertex_count: u32, + instance_count: u32, + first_vertex: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = draw)] + #[doc = "The `draw()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_with_instance_count_and_first_vertex_and_first_instance( + this: &GpuRenderPassEncoder, + vertex_count: u32, + instance_count: u32, + first_vertex: u32, + first_instance: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed(this: &GpuRenderPassEncoder, index_count: u32); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count( + this: &GpuRenderPassEncoder, + index_count: u32, + instance_count: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index( + this: &GpuRenderPassEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index_and_base_vertex( + this: &GpuRenderPassEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + base_vertex: i32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexed)] + #[doc = "The `drawIndexed()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_with_instance_count_and_first_index_and_base_vertex_and_first_instance( + this: &GpuRenderPassEncoder, + index_count: u32, + instance_count: u32, + first_index: u32, + base_vertex: i32, + first_instance: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexedIndirect)] + #[doc = "The `drawIndexedIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexedIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_indirect_with_u32( + this: &GpuRenderPassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndexedIndirect)] + #[doc = "The `drawIndexedIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexedIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indexed_indirect_with_f64( + this: &GpuRenderPassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndirect)] + #[doc = "The `drawIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indirect_with_u32( + this: &GpuRenderPassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = drawIndirect)] + #[doc = "The `drawIndirect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndirect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_indirect_with_f64( + this: &GpuRenderPassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32_and_u32( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64_and_u32( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_u32_and_f64( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] + #[doc = "The `setIndexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_index_buffer_with_f64_and_f64( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setPipeline)] + #[doc = "The `setPipeline()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setPipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`, `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_pipeline(this: &GpuRenderPassEncoder, pipeline: &GpuRenderPipeline); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer(this: &GpuRenderPassEncoder, slot: u32, buffer: Option<&GpuBuffer>); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32_and_u32( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64_and_u32( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + size: u32, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_u32_and_f64( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: u32, + size: f64, + ); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] + #[doc = "The `setVertexBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_vertex_buffer_with_f64_and_f64( + this: &GpuRenderPassEncoder, + slot: u32, + buffer: Option<&GpuBuffer>, + offset: f64, + size: f64, + ); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs new file mode 100644 index 0000000000..836c6dad13 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPassTimestampWrites.rs @@ -0,0 +1,102 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassTimestampWrites)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassTimestampWrites` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassTimestampWrites; +} + +impl GpuRenderPassTimestampWrites { + #[doc = "Construct a new `GpuRenderPassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.query_set(query_set); + ret + } + + #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("beginningOfPassWriteIndex"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("endOfPassWriteIndex"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("querySet"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs new file mode 100644 index 0000000000..55742b12fe --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipeline.rs @@ -0,0 +1,59 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPipeline , typescript_type = "GPURenderPipeline")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPipeline` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPipeline; + + # [wasm_bindgen (structural , method , getter , js_class = "GPURenderPipeline" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderPipeline) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPipeline" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuRenderPipeline, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPURenderPipeline" , js_name = getBindGroupLayout)] + #[doc = "The `getBindGroupLayout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline/getBindGroupLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayout`, `GpuRenderPipeline`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_bind_group_layout(this: &GpuRenderPipeline, index: u32) -> GpuBindGroupLayout; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs new file mode 100644 index 0000000000..65266d56ba --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRenderPipelineDescriptor.rs @@ -0,0 +1,177 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPipelineDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPipelineDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPipelineDescriptor; +} + +impl GpuRenderPipelineDescriptor { + #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, vertex: &GpuVertexState) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.layout(layout); + ret.vertex(vertex); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthStencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthStencil"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `fragment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("fragment"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `multisample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("multisample"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `primitive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("primitive"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `vertex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn vertex(&mut self, val: &GpuVertexState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("vertex"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs new file mode 100644 index 0000000000..0c353b1a21 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuRequestAdapterOptions.rs @@ -0,0 +1,86 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURequestAdapterOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRequestAdapterOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRequestAdapterOptions; +} + +impl GpuRequestAdapterOptions { + #[doc = "Construct a new `GpuRequestAdapterOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `forceFallbackAdapter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn force_fallback_adapter(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("forceFallbackAdapter"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `powerPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPowerPreference`, `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn power_preference(&mut self, val: GpuPowerPreference) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("powerPreference"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuRequestAdapterOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs new file mode 100644 index 0000000000..54e71a7a0c --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSampler.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSampler , typescript_type = "GPUSampler")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSampler` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSampler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuSampler; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSampler" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSampler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuSampler) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUSampler" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSampler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuSampler, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs new file mode 100644 index 0000000000..b3f0320363 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingLayout.rs @@ -0,0 +1,61 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSamplerBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSamplerBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuSamplerBindingLayout; +} + +impl GpuSamplerBindingLayout { + #[doc = "Construct a new `GpuSamplerBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(&mut self, val: GpuSamplerBindingType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuSamplerBindingLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs new file mode 100644 index 0000000000..5fe4220858 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerBindingType.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuSamplerBindingType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuSamplerBindingType { + Filtering = "filtering", + NonFiltering = "non-filtering", + Comparison = "comparison", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs new file mode 100644 index 0000000000..deb316e8a8 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSamplerDescriptor.rs @@ -0,0 +1,271 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSamplerDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSamplerDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuSamplerDescriptor; +} + +impl GpuSamplerDescriptor { + #[doc = "Construct a new `GpuSamplerDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `addressModeU` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("addressModeU"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `addressModeV` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("addressModeV"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `addressModeW` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("addressModeW"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `compare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("compare"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `lodMaxClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("lodMaxClamp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `lodMinClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("lodMinClamp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `magFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("magFilter"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `maxAnisotropy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_anisotropy(&mut self, val: u16) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxAnisotropy"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `minFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("minFilter"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mipmapFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mipmap_filter(&mut self, val: GpuMipmapFilterMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mipmapFilter"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuSamplerDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs new file mode 100644 index 0000000000..65cf7ee65e --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModule.rs @@ -0,0 +1,59 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUShaderModule , typescript_type = "GPUShaderModule")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuShaderModule` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuShaderModule; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUShaderModule" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuShaderModule) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUShaderModule" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuShaderModule, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUShaderModule" , js_name = getCompilationInfo)] + #[doc = "The `getCompilationInfo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/getCompilationInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_compilation_info(this: &GpuShaderModule) -> ::js_sys::Promise; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs new file mode 100644 index 0000000000..099e72f028 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuShaderModuleDescriptor.rs @@ -0,0 +1,94 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUShaderModuleDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuShaderModuleDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuShaderModuleDescriptor; +} + +impl GpuShaderModuleDescriptor { + #[doc = "Construct a new `GpuShaderModuleDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(code: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.code(code); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn code(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `sourceMap` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn source_map(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sourceMap"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs new file mode 100644 index 0000000000..a95bfa30e4 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilFaceState.rs @@ -0,0 +1,122 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUStencilFaceState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuStencilFaceState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuStencilFaceState; +} + +impl GpuStencilFaceState { + #[doc = "Construct a new `GpuStencilFaceState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `compare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("compare"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `depthFailOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthFailOp"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `failOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("failOp"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `passOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pass_op(&mut self, val: GpuStencilOperation) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("passOp"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuStencilFaceState { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs new file mode 100644 index 0000000000..7381d34468 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStencilOperation.rs @@ -0,0 +1,29 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuStencilOperation` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuStencilOperation`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuStencilOperation { + Keep = "keep", + Zero = "zero", + Replace = "replace", + Invert = "invert", + IncrementClamp = "increment-clamp", + DecrementClamp = "decrement-clamp", + IncrementWrap = "increment-wrap", + DecrementWrap = "decrement-wrap", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs new file mode 100644 index 0000000000..5056c4403f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureAccess.rs @@ -0,0 +1,22 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuStorageTextureAccess` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuStorageTextureAccess { + WriteOnly = "write-only", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs new file mode 100644 index 0000000000..87b226d6b0 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStorageTextureBindingLayout.rs @@ -0,0 +1,96 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUStorageTextureBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuStorageTextureBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuStorageTextureBindingLayout; +} + +impl GpuStorageTextureBindingLayout { + #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); + ret + } + + #[doc = "Change the `access` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewDimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs new file mode 100644 index 0000000000..275a3b46ad --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuStoreOp.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuStoreOp` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuStoreOp`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuStoreOp { + Store = "store", + Discard = "discard", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs new file mode 100644 index 0000000000..bed6451faf --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedFeatures.rs @@ -0,0 +1,95 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSupportedFeatures , typescript_type = "GPUSupportedFeatures")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSupportedFeatures` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuSupportedFeatures; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedFeatures" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &GpuSupportedFeatures) -> u32; + + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; + + # [wasm_bindgen (catch , method , structural , js_class = "GPUSupportedFeatures" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &GpuSupportedFeatures, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &GpuSupportedFeatures, value: &str) -> bool; + + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; + + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs new file mode 100644 index 0000000000..2785263223 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuSupportedLimits.rs @@ -0,0 +1,378 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSupportedLimits , typescript_type = "GPUSupportedLimits")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSupportedLimits` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuSupportedLimits; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxTextureDimension1D)] + #[doc = "Getter for the `maxTextureDimension1D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxTextureDimension1D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_1d(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxTextureDimension2D)] + #[doc = "Getter for the `maxTextureDimension2D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxTextureDimension2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_2d(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxTextureDimension3D)] + #[doc = "Getter for the `maxTextureDimension3D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxTextureDimension3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_3d(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxTextureArrayLayers)] + #[doc = "Getter for the `maxTextureArrayLayers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxTextureArrayLayers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_array_layers(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBindGroups)] + #[doc = "Getter for the `maxBindGroups` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBindGroups)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bind_groups(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBindGroupsPlusVertexBuffers)] + #[doc = "Getter for the `maxBindGroupsPlusVertexBuffers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBindGroupsPlusVertexBuffers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bind_groups_plus_vertex_buffers(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBindingsPerBindGroup)] + #[doc = "Getter for the `maxBindingsPerBindGroup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBindingsPerBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bindings_per_bind_group(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxDynamicUniformBuffersPerPipelineLayout)] + #[doc = "Getter for the `maxDynamicUniformBuffersPerPipelineLayout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxDynamicUniformBuffersPerPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_dynamic_uniform_buffers_per_pipeline_layout(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxDynamicStorageBuffersPerPipelineLayout)] + #[doc = "Getter for the `maxDynamicStorageBuffersPerPipelineLayout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxDynamicStorageBuffersPerPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_dynamic_storage_buffers_per_pipeline_layout(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxSampledTexturesPerShaderStage)] + #[doc = "Getter for the `maxSampledTexturesPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxSampledTexturesPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_sampled_textures_per_shader_stage(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxSamplersPerShaderStage)] + #[doc = "Getter for the `maxSamplersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxSamplersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_samplers_per_shader_stage(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxStorageBuffersPerShaderStage)] + #[doc = "Getter for the `maxStorageBuffersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxStorageBuffersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_buffers_per_shader_stage(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxStorageTexturesPerShaderStage)] + #[doc = "Getter for the `maxStorageTexturesPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxStorageTexturesPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_textures_per_shader_stage(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxUniformBuffersPerShaderStage)] + #[doc = "Getter for the `maxUniformBuffersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxUniformBuffersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_uniform_buffers_per_shader_stage(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxUniformBufferBindingSize)] + #[doc = "Getter for the `maxUniformBufferBindingSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxUniformBufferBindingSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_uniform_buffer_binding_size(this: &GpuSupportedLimits) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxStorageBufferBindingSize)] + #[doc = "Getter for the `maxStorageBufferBindingSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxStorageBufferBindingSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_buffer_binding_size(this: &GpuSupportedLimits) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = minUniformBufferOffsetAlignment)] + #[doc = "Getter for the `minUniformBufferOffsetAlignment` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/minUniformBufferOffsetAlignment)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn min_uniform_buffer_offset_alignment(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = minStorageBufferOffsetAlignment)] + #[doc = "Getter for the `minStorageBufferOffsetAlignment` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/minStorageBufferOffsetAlignment)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn min_storage_buffer_offset_alignment(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxVertexBuffers)] + #[doc = "Getter for the `maxVertexBuffers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxVertexBuffers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_buffers(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBufferSize)] + #[doc = "Getter for the `maxBufferSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBufferSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_buffer_size(this: &GpuSupportedLimits) -> f64; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxVertexAttributes)] + #[doc = "Getter for the `maxVertexAttributes` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxVertexAttributes)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_attributes(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxVertexBufferArrayStride)] + #[doc = "Getter for the `maxVertexBufferArrayStride` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxVertexBufferArrayStride)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_buffer_array_stride(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderComponents)] + #[doc = "Getter for the `maxInterStageShaderComponents` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxInterStageShaderComponents)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_inter_stage_shader_components(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderVariables)] + #[doc = "Getter for the `maxInterStageShaderVariables` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxInterStageShaderVariables)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_inter_stage_shader_variables(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxColorAttachments)] + #[doc = "Getter for the `maxColorAttachments` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxColorAttachments)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_color_attachments(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxColorAttachmentBytesPerSample)] + #[doc = "Getter for the `maxColorAttachmentBytesPerSample` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxColorAttachmentBytesPerSample)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_color_attachment_bytes_per_sample(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupStorageSize)] + #[doc = "Getter for the `maxComputeWorkgroupStorageSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeWorkgroupStorageSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_workgroup_storage_size(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeInvocationsPerWorkgroup)] + #[doc = "Getter for the `maxComputeInvocationsPerWorkgroup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeInvocationsPerWorkgroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_invocations_per_workgroup(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupSizeX)] + #[doc = "Getter for the `maxComputeWorkgroupSizeX` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeWorkgroupSizeX)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_workgroup_size_x(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupSizeY)] + #[doc = "Getter for the `maxComputeWorkgroupSizeY` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeWorkgroupSizeY)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_workgroup_size_y(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupSizeZ)] + #[doc = "Getter for the `maxComputeWorkgroupSizeZ` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeWorkgroupSizeZ)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_workgroup_size_z(this: &GpuSupportedLimits) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupsPerDimension)] + #[doc = "Getter for the `maxComputeWorkgroupsPerDimension` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxComputeWorkgroupsPerDimension)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_compute_workgroups_per_dimension(this: &GpuSupportedLimits) -> u32; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs new file mode 100644 index 0000000000..3154c78e19 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTexture.rs @@ -0,0 +1,172 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexture , typescript_type = "GPUTexture")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTexture` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTexture; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = width)] + #[doc = "Getter for the `width` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/width)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn width(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = height)] + #[doc = "Getter for the `height` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/height)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn height(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = depthOrArrayLayers)] + #[doc = "Getter for the `depthOrArrayLayers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/depthOrArrayLayers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_or_array_layers(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = mipLevelCount)] + #[doc = "Getter for the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/mipLevelCount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level_count(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = sampleCount)] + #[doc = "Getter for the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/sampleCount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_count(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = dimension)] + #[doc = "Getter for the `dimension` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/dimension)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dimension(this: &GpuTexture) -> GpuTextureDimension; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = format)] + #[doc = "Getter for the `format` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/format)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(this: &GpuTexture) -> GpuTextureFormat; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = usage)] + #[doc = "Getter for the `usage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/usage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(this: &GpuTexture) -> u32; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuTexture) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUTexture" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuTexture, value: &str); + + # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + #[doc = "The `createView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_view(this: &GpuTexture) -> GpuTextureView; + + # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + #[doc = "The `createView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureView`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_view_with_descriptor( + this: &GpuTexture, + descriptor: &GpuTextureViewDescriptor, + ) -> GpuTextureView; + + # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = destroy)] + #[doc = "The `destroy()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/destroy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn destroy(this: &GpuTexture); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs new file mode 100644 index 0000000000..3c7b987e0f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureAspect.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuTextureAspect` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuTextureAspect { + All = "all", + StencilOnly = "stencil-only", + DepthOnly = "depth-only", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs new file mode 100644 index 0000000000..2dea62b38c --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureBindingLayout.rs @@ -0,0 +1,107 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTextureBindingLayout; +} + +impl GpuTextureBindingLayout { + #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `multisampled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn multisampled(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("multisampled"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `sampleType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureSampleType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampleType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewDimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuTextureBindingLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs new file mode 100644 index 0000000000..f6d0d4b50f --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDescriptor.rs @@ -0,0 +1,194 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTextureDescriptor; +} + +impl GpuTextureDescriptor { + #[doc = "Construct a new `GpuTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); + ret.size(size); + ret.usage(usage); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("dimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level_count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mipLevelCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampleCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewFormats"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs new file mode 100644 index 0000000000..08fa4917ec --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureDimension.rs @@ -0,0 +1,24 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuTextureDimension` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureDimension`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuTextureDimension { + N1d = "1d", + N2d = "2d", + N3d = "3d", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs new file mode 100644 index 0000000000..3a2f8ab365 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureFormat.rs @@ -0,0 +1,115 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuTextureFormat` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuTextureFormat { + R8unorm = "r8unorm", + R8snorm = "r8snorm", + R8uint = "r8uint", + R8sint = "r8sint", + R16uint = "r16uint", + R16sint = "r16sint", + R16float = "r16float", + Rg8unorm = "rg8unorm", + Rg8snorm = "rg8snorm", + Rg8uint = "rg8uint", + Rg8sint = "rg8sint", + R32uint = "r32uint", + R32sint = "r32sint", + R32float = "r32float", + Rg16uint = "rg16uint", + Rg16sint = "rg16sint", + Rg16float = "rg16float", + Rgba8unorm = "rgba8unorm", + Rgba8unormSrgb = "rgba8unorm-srgb", + Rgba8snorm = "rgba8snorm", + Rgba8uint = "rgba8uint", + Rgba8sint = "rgba8sint", + Bgra8unorm = "bgra8unorm", + Bgra8unormSrgb = "bgra8unorm-srgb", + Rgb9e5ufloat = "rgb9e5ufloat", + Rgb10a2unorm = "rgb10a2unorm", + Rg11b10ufloat = "rg11b10ufloat", + Rg32uint = "rg32uint", + Rg32sint = "rg32sint", + Rg32float = "rg32float", + Rgba16uint = "rgba16uint", + Rgba16sint = "rgba16sint", + Rgba16float = "rgba16float", + Rgba32uint = "rgba32uint", + Rgba32sint = "rgba32sint", + Rgba32float = "rgba32float", + Stencil8 = "stencil8", + Depth16unorm = "depth16unorm", + Depth24plus = "depth24plus", + Depth24plusStencil8 = "depth24plus-stencil8", + Depth32float = "depth32float", + Depth32floatStencil8 = "depth32float-stencil8", + Bc1RgbaUnorm = "bc1-rgba-unorm", + Bc1RgbaUnormSrgb = "bc1-rgba-unorm-srgb", + Bc2RgbaUnorm = "bc2-rgba-unorm", + Bc2RgbaUnormSrgb = "bc2-rgba-unorm-srgb", + Bc3RgbaUnorm = "bc3-rgba-unorm", + Bc3RgbaUnormSrgb = "bc3-rgba-unorm-srgb", + Bc4RUnorm = "bc4-r-unorm", + Bc4RSnorm = "bc4-r-snorm", + Bc5RgUnorm = "bc5-rg-unorm", + Bc5RgSnorm = "bc5-rg-snorm", + Bc6hRgbUfloat = "bc6h-rgb-ufloat", + Bc6hRgbFloat = "bc6h-rgb-float", + Bc7RgbaUnorm = "bc7-rgba-unorm", + Bc7RgbaUnormSrgb = "bc7-rgba-unorm-srgb", + Etc2Rgb8unorm = "etc2-rgb8unorm", + Etc2Rgb8unormSrgb = "etc2-rgb8unorm-srgb", + Etc2Rgb8a1unorm = "etc2-rgb8a1unorm", + Etc2Rgb8a1unormSrgb = "etc2-rgb8a1unorm-srgb", + Etc2Rgba8unorm = "etc2-rgba8unorm", + Etc2Rgba8unormSrgb = "etc2-rgba8unorm-srgb", + EacR11unorm = "eac-r11unorm", + EacR11snorm = "eac-r11snorm", + EacRg11unorm = "eac-rg11unorm", + EacRg11snorm = "eac-rg11snorm", + Astc4x4Unorm = "astc-4x4-unorm", + Astc4x4UnormSrgb = "astc-4x4-unorm-srgb", + Astc5x4Unorm = "astc-5x4-unorm", + Astc5x4UnormSrgb = "astc-5x4-unorm-srgb", + Astc5x5Unorm = "astc-5x5-unorm", + Astc5x5UnormSrgb = "astc-5x5-unorm-srgb", + Astc6x5Unorm = "astc-6x5-unorm", + Astc6x5UnormSrgb = "astc-6x5-unorm-srgb", + Astc6x6Unorm = "astc-6x6-unorm", + Astc6x6UnormSrgb = "astc-6x6-unorm-srgb", + Astc8x5Unorm = "astc-8x5-unorm", + Astc8x5UnormSrgb = "astc-8x5-unorm-srgb", + Astc8x6Unorm = "astc-8x6-unorm", + Astc8x6UnormSrgb = "astc-8x6-unorm-srgb", + Astc8x8Unorm = "astc-8x8-unorm", + Astc8x8UnormSrgb = "astc-8x8-unorm-srgb", + Astc10x5Unorm = "astc-10x5-unorm", + Astc10x5UnormSrgb = "astc-10x5-unorm-srgb", + Astc10x6Unorm = "astc-10x6-unorm", + Astc10x6UnormSrgb = "astc-10x6-unorm-srgb", + Astc10x8Unorm = "astc-10x8-unorm", + Astc10x8UnormSrgb = "astc-10x8-unorm-srgb", + Astc10x10Unorm = "astc-10x10-unorm", + Astc10x10UnormSrgb = "astc-10x10-unorm-srgb", + Astc12x10Unorm = "astc-12x10-unorm", + Astc12x10UnormSrgb = "astc-12x10-unorm-srgb", + Astc12x12Unorm = "astc-12x12-unorm", + Astc12x12UnormSrgb = "astc-12x12-unorm-srgb", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs new file mode 100644 index 0000000000..5550c0d059 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureSampleType.rs @@ -0,0 +1,26 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuTextureSampleType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureSampleType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuTextureSampleType { + Float = "float", + UnfilterableFloat = "unfilterable-float", + Depth = "depth", + Sint = "sint", + Uint = "uint", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs new file mode 100644 index 0000000000..507b7dc814 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureView.rs @@ -0,0 +1,48 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureView , typescript_type = "GPUTextureView")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureView` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTextureView; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUTextureView" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuTextureView) -> String; + + # [wasm_bindgen (structural , method , setter , js_class = "GPUTextureView" , js_name = label)] + #[doc = "Setter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuTextureView, value: &str); +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs new file mode 100644 index 0000000000..0084b0089a --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDescriptor.rs @@ -0,0 +1,202 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureViewDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureViewDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTextureViewDescriptor; +} + +impl GpuTextureViewDescriptor { + #[doc = "Construct a new `GpuTextureViewDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `arrayLayerCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn array_layer_count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("arrayLayerCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `baseArrayLayer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn base_array_layer(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("baseArrayLayer"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `baseMipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn base_mip_level(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("baseMipLevel"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("dimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level_count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mipLevelCount"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} + +impl Default for GpuTextureViewDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs new file mode 100644 index 0000000000..045e7dd054 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuTextureViewDimension.rs @@ -0,0 +1,27 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuTextureViewDimension` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDimension`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuTextureViewDimension { + N1d = "1d", + N2d = "2d", + N2dArray = "2d-array", + Cube = "cube", + CubeArray = "cube-array", + N3d = "3d", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs new file mode 100644 index 0000000000..862ccb6869 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEvent.rs @@ -0,0 +1,51 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = GPUUncapturedErrorEvent , typescript_type = "GPUUncapturedErrorEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuUncapturedErrorEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuUncapturedErrorEvent; + + # [wasm_bindgen (structural , method , getter , js_class = "GPUUncapturedErrorEvent" , js_name = error)] + #[doc = "Getter for the `error` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn error(this: &GpuUncapturedErrorEvent) -> GpuError; + + #[wasm_bindgen(catch, constructor, js_class = "GPUUncapturedErrorEvent")] + #[doc = "The `new GpuUncapturedErrorEvent(..)` constructor, creating a new instance of `GpuUncapturedErrorEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent/GPUUncapturedErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + type_: &str, + gpu_uncaptured_error_event_init_dict: &GpuUncapturedErrorEventInit, + ) -> Result; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs new file mode 100644 index 0000000000..f37df25fc6 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuUncapturedErrorEventInit.rs @@ -0,0 +1,119 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUUncapturedErrorEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuUncapturedErrorEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuUncapturedErrorEventInit; +} + +impl GpuUncapturedErrorEventInit { + #[doc = "Construct a new `GpuUncapturedErrorEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &GpuError) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.error(error); + ret + } + + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bubbles"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("cancelable"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn composed(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("composed"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn error(&mut self, val: &GpuError) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs new file mode 100644 index 0000000000..15bb2b8da9 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuValidationError.rs @@ -0,0 +1,37 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = GpuError , extends = :: js_sys :: Object , js_name = GPUValidationError , typescript_type = "GPUValidationError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuValidationError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuValidationError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuValidationError; + + #[wasm_bindgen(catch, constructor, js_class = "GPUValidationError")] + #[doc = "The `new GpuValidationError(..)` constructor, creating a new instance of `GpuValidationError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError/GPUValidationError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuValidationError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(message: &str) -> Result; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs new file mode 100644 index 0000000000..6b6ed56f8e --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexAttribute.rs @@ -0,0 +1,98 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexAttribute)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuVertexAttribute` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuVertexAttribute; +} + +impl GpuVertexAttribute { + #[doc = "Construct a new `GpuVertexAttribute`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); + ret.offset(offset); + ret.shader_location(shader_location); + ret + } + + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn offset(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `shaderLocation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn shader_location(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("shaderLocation"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs new file mode 100644 index 0000000000..008bf2374e --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexBufferLayout.rs @@ -0,0 +1,103 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexBufferLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuVertexBufferLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuVertexBufferLayout; +} + +impl GpuVertexBufferLayout { + #[doc = "Construct a new `GpuVertexBufferLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.array_stride(array_stride); + ret.attributes(attributes); + ret + } + + #[doc = "Change the `arrayStride` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn array_stride(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("arrayStride"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("attributes"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `stepMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stepMode"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs new file mode 100644 index 0000000000..bdb056e3c0 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexFormat.rs @@ -0,0 +1,51 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuVertexFormat` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuVertexFormat`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuVertexFormat { + Uint8x2 = "uint8x2", + Uint8x4 = "uint8x4", + Sint8x2 = "sint8x2", + Sint8x4 = "sint8x4", + Unorm8x2 = "unorm8x2", + Unorm8x4 = "unorm8x4", + Snorm8x2 = "snorm8x2", + Snorm8x4 = "snorm8x4", + Uint16x2 = "uint16x2", + Uint16x4 = "uint16x4", + Sint16x2 = "sint16x2", + Sint16x4 = "sint16x4", + Unorm16x2 = "unorm16x2", + Unorm16x4 = "unorm16x4", + Snorm16x2 = "snorm16x2", + Snorm16x4 = "snorm16x4", + Float16x2 = "float16x2", + Float16x4 = "float16x4", + Float32 = "float32", + Float32x2 = "float32x2", + Float32x3 = "float32x3", + Float32x4 = "float32x4", + Uint32 = "uint32", + Uint32x2 = "uint32x2", + Uint32x3 = "uint32x3", + Uint32x4 = "uint32x4", + Sint32 = "sint32", + Sint32x2 = "sint32x2", + Sint32x3 = "sint32x3", + Sint32x4 = "sint32x4", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs new file mode 100644 index 0000000000..7441f4b5be --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexState.rs @@ -0,0 +1,100 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuVertexState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuVertexState; +} + +impl GpuVertexState { + #[doc = "Construct a new `GpuVertexState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entry_point(entry_point); + ret.module(module); + ret + } + + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entryPoint"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + + #[doc = "Change the `buffers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("buffers"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs new file mode 100644 index 0000000000..9f4b329b4e --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_GpuVertexStepMode.rs @@ -0,0 +1,23 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[doc = "The `GpuVertexStepMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuVertexStepMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuVertexStepMode { + Vertex = "vertex", + Instance = "instance", +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs new file mode 100644 index 0000000000..0babbf9d40 --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_WgslLanguageFeatures.rs @@ -0,0 +1,95 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WGSLLanguageFeatures , typescript_type = "WGSLLanguageFeatures")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WgslLanguageFeatures` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WgslLanguageFeatures; + + # [wasm_bindgen (structural , method , getter , js_class = "WGSLLanguageFeatures" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &WgslLanguageFeatures) -> u32; + + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; + + # [wasm_bindgen (catch , method , structural , js_class = "WGSLLanguageFeatures" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &WgslLanguageFeatures, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &WgslLanguageFeatures, value: &str) -> bool; + + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; + + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs b/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs new file mode 100644 index 0000000000..ce3557ed7a --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/gen_gpu_map_mode.rs @@ -0,0 +1,33 @@ +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. + +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_map_mode { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; + + #[doc = "The `GPUMapMode.READ` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_map_mode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const READ: u32 = 1u64 as u32; + + #[doc = "The `GPUMapMode.WRITE` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_map_mode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const WRITE: u32 = 2u64 as u32; +} diff --git a/wgpu/src/backend/webgpu/webgpu_sys/mod.rs b/wgpu/src/backend/webgpu/webgpu_sys/mod.rs new file mode 100644 index 0000000000..41a118dfea --- /dev/null +++ b/wgpu/src/backend/webgpu/webgpu_sys/mod.rs @@ -0,0 +1,261 @@ +//! Bindings to the WebGPU API. +//! +//! Internally vendored from the `web-sys` crate until the WebGPU binding are stabilized. +// DO NOT EDIT THIS FILE! +// +// This module part of a subset of web-sys that is used by wgpu's webgpu backend. +// +// If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. +// +// This file was generated by the `cargo xtask vendor-web-sys --version 0.2.90` command. + +#![allow(unused_imports, non_snake_case)] +use web_sys::{Event, EventTarget}; +mod gen_Gpu; +pub use gen_Gpu::*; +mod gen_GpuAdapter; +pub use gen_GpuAdapter::*; +mod gen_GpuAddressMode; +pub use gen_GpuAddressMode::*; +mod gen_GpuAutoLayoutMode; +pub use gen_GpuAutoLayoutMode::*; +mod gen_GpuBindGroup; +pub use gen_GpuBindGroup::*; +mod gen_GpuBindGroupDescriptor; +pub use gen_GpuBindGroupDescriptor::*; +mod gen_GpuBindGroupEntry; +pub use gen_GpuBindGroupEntry::*; +mod gen_GpuBindGroupLayout; +pub use gen_GpuBindGroupLayout::*; +mod gen_GpuBindGroupLayoutDescriptor; +pub use gen_GpuBindGroupLayoutDescriptor::*; +mod gen_GpuBindGroupLayoutEntry; +pub use gen_GpuBindGroupLayoutEntry::*; +mod gen_GpuBlendComponent; +pub use gen_GpuBlendComponent::*; +mod gen_GpuBlendFactor; +pub use gen_GpuBlendFactor::*; +mod gen_GpuBlendOperation; +pub use gen_GpuBlendOperation::*; +mod gen_GpuBlendState; +pub use gen_GpuBlendState::*; +mod gen_GpuBuffer; +pub use gen_GpuBuffer::*; +mod gen_GpuBufferBinding; +pub use gen_GpuBufferBinding::*; +mod gen_GpuBufferBindingLayout; +pub use gen_GpuBufferBindingLayout::*; +mod gen_GpuBufferBindingType; +pub use gen_GpuBufferBindingType::*; +mod gen_GpuBufferDescriptor; +pub use gen_GpuBufferDescriptor::*; +mod gen_GpuBufferMapState; +pub use gen_GpuBufferMapState::*; +mod gen_GpuCanvasAlphaMode; +pub use gen_GpuCanvasAlphaMode::*; +mod gen_GpuCanvasContext; +pub use gen_GpuCanvasContext::*; +mod gen_GpuCanvasConfiguration; +pub use gen_GpuCanvasConfiguration::*; +mod gen_GpuColorDict; +pub use gen_GpuColorDict::*; +mod gen_GpuColorTargetState; +pub use gen_GpuColorTargetState::*; +mod gen_GpuCommandBuffer; +pub use gen_GpuCommandBuffer::*; +mod gen_GpuCommandBufferDescriptor; +pub use gen_GpuCommandBufferDescriptor::*; +mod gen_GpuCommandEncoder; +pub use gen_GpuCommandEncoder::*; +mod gen_GpuCommandEncoderDescriptor; +pub use gen_GpuCommandEncoderDescriptor::*; +mod gen_GpuCompareFunction; +pub use gen_GpuCompareFunction::*; +mod gen_GpuCompilationInfo; +pub use gen_GpuCompilationInfo::*; +mod gen_GpuCompilationMessage; +pub use gen_GpuCompilationMessage::*; +mod gen_GpuCompilationMessageType; +pub use gen_GpuCompilationMessageType::*; +mod gen_GpuComputePassDescriptor; +pub use gen_GpuComputePassDescriptor::*; +mod gen_GpuComputePassEncoder; +pub use gen_GpuComputePassEncoder::*; +mod gen_GpuComputePassTimestampWrites; +pub use gen_GpuComputePassTimestampWrites::*; +mod gen_GpuComputePipeline; +pub use gen_GpuComputePipeline::*; +mod gen_GpuComputePipelineDescriptor; +pub use gen_GpuComputePipelineDescriptor::*; +mod gen_GpuCullMode; +pub use gen_GpuCullMode::*; +mod gen_GpuDepthStencilState; +pub use gen_GpuDepthStencilState::*; +mod gen_GpuDevice; +pub use gen_GpuDevice::*; +mod gen_GpuDeviceDescriptor; +pub use gen_GpuDeviceDescriptor::*; +mod gen_GpuDeviceLostInfo; +pub use gen_GpuDeviceLostInfo::*; +mod gen_GpuDeviceLostReason; +pub use gen_GpuDeviceLostReason::*; +mod gen_GpuError; +pub use gen_GpuError::*; +mod gen_GpuErrorFilter; +pub use gen_GpuErrorFilter::*; +mod gen_GpuExternalTexture; +pub use gen_GpuExternalTexture::*; +mod gen_GpuExternalTextureBindingLayout; +pub use gen_GpuExternalTextureBindingLayout::*; +mod gen_GpuExternalTextureDescriptor; +pub use gen_GpuExternalTextureDescriptor::*; +mod gen_GpuExtent3dDict; +pub use gen_GpuExtent3dDict::*; +mod gen_GpuFeatureName; +pub use gen_GpuFeatureName::*; +mod gen_GpuFilterMode; +pub use gen_GpuFilterMode::*; +mod gen_GpuFragmentState; +pub use gen_GpuFragmentState::*; +mod gen_GpuFrontFace; +pub use gen_GpuFrontFace::*; +mod gen_GpuImageCopyBuffer; +pub use gen_GpuImageCopyBuffer::*; +mod gen_GpuImageCopyExternalImage; +pub use gen_GpuImageCopyExternalImage::*; +mod gen_GpuImageCopyTexture; +pub use gen_GpuImageCopyTexture::*; +mod gen_GpuImageCopyTextureTagged; +pub use gen_GpuImageCopyTextureTagged::*; +mod gen_GpuImageDataLayout; +pub use gen_GpuImageDataLayout::*; +mod gen_GpuIndexFormat; +pub use gen_GpuIndexFormat::*; +mod gen_GpuLoadOp; +pub use gen_GpuLoadOp::*; +mod gen_gpu_map_mode; +pub use gen_gpu_map_mode::*; +mod gen_GpuMipmapFilterMode; +pub use gen_GpuMipmapFilterMode::*; +mod gen_GpuMultisampleState; +pub use gen_GpuMultisampleState::*; +mod gen_GpuObjectDescriptorBase; +pub use gen_GpuObjectDescriptorBase::*; +mod gen_GpuOrigin2dDict; +pub use gen_GpuOrigin2dDict::*; +mod gen_GpuOrigin3dDict; +pub use gen_GpuOrigin3dDict::*; +mod gen_GpuOutOfMemoryError; +pub use gen_GpuOutOfMemoryError::*; +mod gen_GpuPipelineDescriptorBase; +pub use gen_GpuPipelineDescriptorBase::*; +mod gen_GpuPipelineLayout; +pub use gen_GpuPipelineLayout::*; +mod gen_GpuPipelineLayoutDescriptor; +pub use gen_GpuPipelineLayoutDescriptor::*; +mod gen_GpuPowerPreference; +pub use gen_GpuPowerPreference::*; +mod gen_GpuPrimitiveState; +pub use gen_GpuPrimitiveState::*; +mod gen_GpuPrimitiveTopology; +pub use gen_GpuPrimitiveTopology::*; +mod gen_GpuProgrammableStage; +pub use gen_GpuProgrammableStage::*; +mod gen_GpuQuerySet; +pub use gen_GpuQuerySet::*; +mod gen_GpuQuerySetDescriptor; +pub use gen_GpuQuerySetDescriptor::*; +mod gen_GpuQueryType; +pub use gen_GpuQueryType::*; +mod gen_GpuQueue; +pub use gen_GpuQueue::*; +mod gen_GpuQueueDescriptor; +pub use gen_GpuQueueDescriptor::*; +mod gen_GpuRenderBundle; +pub use gen_GpuRenderBundle::*; +mod gen_GpuRenderBundleDescriptor; +pub use gen_GpuRenderBundleDescriptor::*; +mod gen_GpuRenderBundleEncoder; +pub use gen_GpuRenderBundleEncoder::*; +mod gen_GpuRenderBundleEncoderDescriptor; +pub use gen_GpuRenderBundleEncoderDescriptor::*; +mod gen_GpuRenderPassColorAttachment; +pub use gen_GpuRenderPassColorAttachment::*; +mod gen_GpuRenderPassDepthStencilAttachment; +pub use gen_GpuRenderPassDepthStencilAttachment::*; +mod gen_GpuRenderPassDescriptor; +pub use gen_GpuRenderPassDescriptor::*; +mod gen_GpuRenderPassEncoder; +pub use gen_GpuRenderPassEncoder::*; +mod gen_GpuRenderPassTimestampWrites; +pub use gen_GpuRenderPassTimestampWrites::*; +mod gen_GpuRenderPipeline; +pub use gen_GpuRenderPipeline::*; +mod gen_GpuRenderPipelineDescriptor; +pub use gen_GpuRenderPipelineDescriptor::*; +mod gen_GpuRequestAdapterOptions; +pub use gen_GpuRequestAdapterOptions::*; +mod gen_GpuSampler; +pub use gen_GpuSampler::*; +mod gen_GpuSamplerBindingLayout; +pub use gen_GpuSamplerBindingLayout::*; +mod gen_GpuSamplerBindingType; +pub use gen_GpuSamplerBindingType::*; +mod gen_GpuSamplerDescriptor; +pub use gen_GpuSamplerDescriptor::*; +mod gen_GpuShaderModule; +pub use gen_GpuShaderModule::*; +mod gen_GpuShaderModuleDescriptor; +pub use gen_GpuShaderModuleDescriptor::*; +mod gen_GpuStencilFaceState; +pub use gen_GpuStencilFaceState::*; +mod gen_GpuStencilOperation; +pub use gen_GpuStencilOperation::*; +mod gen_GpuStorageTextureAccess; +pub use gen_GpuStorageTextureAccess::*; +mod gen_GpuStorageTextureBindingLayout; +pub use gen_GpuStorageTextureBindingLayout::*; +mod gen_GpuStoreOp; +pub use gen_GpuStoreOp::*; +mod gen_GpuSupportedFeatures; +pub use gen_GpuSupportedFeatures::*; +mod gen_GpuSupportedLimits; +pub use gen_GpuSupportedLimits::*; +mod gen_GpuTexture; +pub use gen_GpuTexture::*; +mod gen_GpuTextureAspect; +pub use gen_GpuTextureAspect::*; +mod gen_GpuTextureBindingLayout; +pub use gen_GpuTextureBindingLayout::*; +mod gen_GpuTextureDescriptor; +pub use gen_GpuTextureDescriptor::*; +mod gen_GpuTextureDimension; +pub use gen_GpuTextureDimension::*; +mod gen_GpuTextureFormat; +pub use gen_GpuTextureFormat::*; +mod gen_GpuTextureSampleType; +pub use gen_GpuTextureSampleType::*; +mod gen_GpuTextureView; +pub use gen_GpuTextureView::*; +mod gen_GpuTextureViewDescriptor; +pub use gen_GpuTextureViewDescriptor::*; +mod gen_GpuTextureViewDimension; +pub use gen_GpuTextureViewDimension::*; +mod gen_GpuUncapturedErrorEvent; +pub use gen_GpuUncapturedErrorEvent::*; +mod gen_GpuUncapturedErrorEventInit; +pub use gen_GpuUncapturedErrorEventInit::*; +mod gen_GpuValidationError; +pub use gen_GpuValidationError::*; +mod gen_GpuVertexAttribute; +pub use gen_GpuVertexAttribute::*; +mod gen_GpuVertexBufferLayout; +pub use gen_GpuVertexBufferLayout::*; +mod gen_GpuVertexFormat; +pub use gen_GpuVertexFormat::*; +mod gen_GpuVertexState; +pub use gen_GpuVertexState::*; +mod gen_GpuVertexStepMode; +pub use gen_GpuVertexStepMode::*; +mod gen_WgslLanguageFeatures; +pub use gen_WgslLanguageFeatures::*; diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index d98c0e3d25..a66f600771 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -1813,7 +1813,7 @@ impl Instance { ); } - #[cfg(all(webgpu, web_sys_unstable_apis))] + #[cfg(webgpu)] { let is_only_available_backend = !cfg!(wgpu_core); let requested_webgpu = _instance_desc.backends.contains(Backends::BROWSER_WEBGPU); @@ -3087,7 +3087,7 @@ impl<'a> BufferSlice<'a> { /// this function directly hands you the ArrayBuffer that we mapped the data into in js. /// /// This is only available on WebGPU, on any other backends this will return `None`. - #[cfg(all(webgpu, web_sys_unstable_apis))] + #[cfg(webgpu)] pub fn get_mapped_range_as_array_buffer(&self) -> Option { self.buffer .context diff --git a/xtask/Cargo.lock b/xtask/Cargo.lock index 50b572cd03..da50a58f99 100644 --- a/xtask/Cargo.lock +++ b/xtask/Cargo.lock @@ -29,6 +29,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + [[package]] name = "xshell" version = "0.2.5" @@ -52,5 +58,6 @@ dependencies = [ "env_logger", "log", "pico-args", + "regex-lite", "xshell", ] diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 3bbc64c46f..b608e4f80f 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -8,6 +8,7 @@ publish = false # The dependencies in this config have no transitive dependencies. anyhow = "1.0.71" env_logger = { version = "0.10.0", default-features = false } +regex-lite = "0.1.5" log = "0.4.18" pico-args = { version = "0.5.0", features = [ "eq-separator", diff --git a/xtask/src/cli.rs b/xtask/src/cli.rs deleted file mode 100644 index 78547268a9..0000000000 --- a/xtask/src/cli.rs +++ /dev/null @@ -1,67 +0,0 @@ -use std::process::exit; - -use anyhow::{anyhow, bail, Context}; -use pico_args::Arguments; - -const HELP: &str = "\ -Usage: xtask - -Commands: - run-wasm - --release Build in release mode - --no-serve Just build the generated files, don't serve them - test - --llvm-cov Run tests with LLVM code coverage using the llvm-cov tool - -Options: - -h, --help Print help -"; - -pub struct Args { - pub subcommand: Subcommand, - pub command_args: Arguments, -} - -impl Args { - pub fn parse() -> Self { - let mut args = Arguments::from_env(); - if args.contains("--help") { - eprint!("{HELP}"); - // Emulate Cargo exit status: - // - let cargo_like_exit_code = 101; - exit(cargo_like_exit_code); - } - match Subcommand::parse(&mut args) { - Ok(subcommand) => Self { - subcommand, - command_args: args, - }, - Err(e) => { - eprintln!("{:?}", anyhow!(e)); - exit(1) - } - } - } -} - -pub enum Subcommand { - RunWasm, - Test, -} - -impl Subcommand { - fn parse(args: &mut Arguments) -> anyhow::Result { - let subcmd = args - .subcommand() - .context("failed to parse subcommand")? - .context("no subcommand specified; see `--help` for more details")?; - match &*subcmd { - "run-wasm" => Ok(Self::RunWasm), - "test" => Ok(Self::Test), - other => { - bail!("unrecognized subcommand {other:?}; see `--help` for more details") - } - } - } -} diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 1ff0aa8efd..3f6eb622bf 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1,27 +1,76 @@ -use cli::Args; +use std::process::ExitCode; + +use anyhow::Context; +use pico_args::Arguments; -mod cli; mod run_wasm; mod test; mod util; +mod vendor_web_sys; + +const HELP: &str = "\ +Usage: xtask + +Commands: + run-wasm + --release Build in release mode + --no-serve Just build the generated files, don't serve them + test + --llvm-cov Run tests with LLVM code coverage using the llvm-cov tool + vendor-web-sys + --no-cleanup Don't clean up temporary checkout of wasm-bindgen + One of: + --path-to-checkout Path to a local checkout of wasm-bindgen to generate bindings from. + This is useful for testing changes to wasm-bindgen + --version String that can be passed to `git checkout` to checkout the wasm-bindgen repository. + +Options: + -h, --help Print help +"; + +/// Helper macro for printing the help message, then bailing with an error message. +#[macro_export] +macro_rules! bad_arguments { + ($($arg:tt)*) => {{ + eprintln!("{}", crate::HELP); + anyhow::bail!($($arg)*) + }}; +} -fn main() -> anyhow::Result<()> { +fn main() -> anyhow::Result { env_logger::builder() .filter_level(log::LevelFilter::Info) .parse_default_env() .format_indent(Some(0)) .init(); - let args = Args::parse(); + let mut args = Arguments::from_env(); - run(args) -} + if args.contains("--help") { + eprint!("{HELP}"); + return Ok(ExitCode::FAILURE); + } + + let subcommand = args + .subcommand() + .context("Expected subcommand to be UTF-8")?; -#[allow(unused_mut, unreachable_patterns)] -fn run(mut args: Args) -> anyhow::Result<()> { - match args.subcommand { - cli::Subcommand::RunWasm => run_wasm::run_wasm(args.command_args), - cli::Subcommand::Test => test::run_tests(args.command_args), - _ => unreachable!(), + // -- Shell Creation -- + + let shell = xshell::Shell::new().context("Couldn't create xshell shell")?; + shell.change_dir(String::from(env!("CARGO_MANIFEST_DIR")) + "/.."); + + match subcommand.as_deref() { + Some("run-wasm") => run_wasm::run_wasm(shell, args)?, + Some("test") => test::run_tests(shell, args)?, + Some("vendor-web-sys") => vendor_web_sys::run_vendor_web_sys(shell, args)?, + Some(subcommand) => { + bad_arguments!("Unknown subcommand: {}", subcommand) + } + None => { + bad_arguments!("Expected subcommand") + } } + + Ok(ExitCode::SUCCESS) } diff --git a/xtask/src/run_wasm.rs b/xtask/src/run_wasm.rs index 280ef82775..33351e670c 100644 --- a/xtask/src/run_wasm.rs +++ b/xtask/src/run_wasm.rs @@ -1,10 +1,11 @@ use anyhow::Context; use pico_args::Arguments; +use xshell::Shell; use crate::util::{check_all_programs, Program}; -pub(crate) fn run_wasm(mut args: Arguments) -> Result<(), anyhow::Error> { +pub(crate) fn run_wasm(shell: Shell, mut args: Arguments) -> Result<(), anyhow::Error> { let no_serve = args.contains("--no-serve"); let release = args.contains("--release"); @@ -31,9 +32,6 @@ pub(crate) fn run_wasm(mut args: Arguments) -> Result<(), anyhow::Error> { let release_flag: &[_] = if release { &["--release"] } else { &[] }; let output_dir = if release { "release" } else { "debug" }; - let shell = xshell::Shell::new().context("Couldn't create xshell shell")?; - shell.change_dir(String::from(env!("CARGO_MANIFEST_DIR")) + "/.."); - log::info!("building webgpu examples"); let cargo_args = args.finish(); diff --git a/xtask/src/test.rs b/xtask/src/test.rs index 71e084f044..70278df47b 100644 --- a/xtask/src/test.rs +++ b/xtask/src/test.rs @@ -1,7 +1,8 @@ use anyhow::Context; use pico_args::Arguments; +use xshell::Shell; -pub fn run_tests(mut args: Arguments) -> anyhow::Result<()> { +pub fn run_tests(shell: Shell, mut args: Arguments) -> anyhow::Result<()> { let llvm_cov = args.contains("--llvm-cov"); // These needs to match the command in "run wgpu-info" in `.github/workflows/ci.yml` let llvm_cov_flags: &[_] = if llvm_cov { @@ -15,10 +16,6 @@ pub fn run_tests(mut args: Arguments) -> anyhow::Result<()> { &["nextest", "run"] }; - let shell = xshell::Shell::new().context("Couldn't create xshell shell")?; - - shell.change_dir(String::from(env!("CARGO_MANIFEST_DIR")) + "/.."); - log::info!("Generating .gpuconfig file based on gpus on the system"); xshell::cmd!( diff --git a/xtask/src/vendor_web_sys.rs b/xtask/src/vendor_web_sys.rs new file mode 100644 index 0000000000..afa590fa6a --- /dev/null +++ b/xtask/src/vendor_web_sys.rs @@ -0,0 +1,302 @@ +use anyhow::Context; +use pico_args::Arguments; +use xshell::Shell; + +use crate::bad_arguments; + +/// Path to the webgpu_sys folder relative to the root of the repository +const WEBGPU_SYS_PATH: &str = "wgpu/src/backend/webgpu/webgpu_sys"; +/// Path to the temporary clone of the wasm-bindgen repository. +/// +/// This should be synchronized with the path in .gitignore. +const WASM_BINDGEN_TEMP_CLONE_PATH: &str = + "wgpu/src/backend/webgpu/webgpu_sys/wasm_bindgen_clone_tmp"; +/// Prefix of the file names in the wasm-bindgen repository that we need to copy. +/// +/// This prefix will be added to all of the feature names to get the full file name. +/// Relative to the root of the wasm-bindgen repository. +const WEB_SYS_FILE_PREFIX: &str = "crates/web-sys/src/features/gen_"; +const WEB_SYS_FEATURES_NEEDED: &[&str] = &[ + "Gpu", + "GpuAdapter", + "GpuAddressMode", + "GpuAutoLayoutMode", + "GpuBindGroup", + "GpuBindGroupDescriptor", + "GpuBindGroupEntry", + "GpuBindGroupLayout", + "GpuBindGroupLayoutDescriptor", + "GpuBindGroupLayoutEntry", + "GpuBlendComponent", + "GpuBlendFactor", + "GpuBlendOperation", + "GpuBlendState", + "GpuBuffer", + "GpuBufferBinding", + "GpuBufferBindingLayout", + "GpuBufferBindingType", + "GpuBufferDescriptor", + "GpuBufferMapState", + "GpuCanvasAlphaMode", + "GpuCanvasContext", + "GpuCanvasConfiguration", + "GpuColorDict", + "GpuColorTargetState", + "GpuCommandBuffer", + "GpuCommandBufferDescriptor", + "GpuCommandEncoder", + "GpuCommandEncoderDescriptor", + "GpuCompareFunction", + "GpuCompilationInfo", + "GpuCompilationMessage", + "GpuCompilationMessageType", + "GpuComputePassDescriptor", + "GpuComputePassEncoder", + "GpuComputePassTimestampWrites", + "GpuComputePipeline", + "GpuComputePipelineDescriptor", + "GpuCullMode", + "GpuDepthStencilState", + "GpuDevice", + "GpuDeviceDescriptor", + "GpuDeviceLostInfo", + "GpuDeviceLostReason", + "GpuError", + "GpuErrorFilter", + "GpuExternalTexture", + "GpuExternalTextureBindingLayout", + "GpuExternalTextureDescriptor", + // "GpuExtent2dDict", Not yet implemented in web_sys + "GpuExtent3dDict", + "GpuFeatureName", + "GpuFilterMode", + "GpuFragmentState", + "GpuFrontFace", + "GpuImageCopyBuffer", + "GpuImageCopyExternalImage", + "GpuImageCopyTexture", + "GpuImageCopyTextureTagged", + "GpuImageDataLayout", + "GpuIndexFormat", + "GpuLoadOp", + "gpu_map_mode", + "GpuMipmapFilterMode", + "GpuMultisampleState", + "GpuObjectDescriptorBase", + "GpuOrigin2dDict", + "GpuOrigin3dDict", + "GpuOutOfMemoryError", + "GpuPipelineDescriptorBase", + "GpuPipelineLayout", + "GpuPipelineLayoutDescriptor", + "GpuPowerPreference", + "GpuPrimitiveState", + "GpuPrimitiveTopology", + "GpuProgrammableStage", + "GpuQuerySet", + "GpuQuerySetDescriptor", + "GpuQueryType", + "GpuQueue", + "GpuQueueDescriptor", + "GpuRenderBundle", + "GpuRenderBundleDescriptor", + "GpuRenderBundleEncoder", + "GpuRenderBundleEncoderDescriptor", + "GpuRenderPassColorAttachment", + "GpuRenderPassDepthStencilAttachment", + "GpuRenderPassDescriptor", + "GpuRenderPassEncoder", + "GpuRenderPassTimestampWrites", + "GpuRenderPipeline", + "GpuRenderPipelineDescriptor", + "GpuRequestAdapterOptions", + "GpuSampler", + "GpuSamplerBindingLayout", + "GpuSamplerBindingType", + "GpuSamplerDescriptor", + "GpuShaderModule", + "GpuShaderModuleDescriptor", + "GpuStencilFaceState", + "GpuStencilOperation", + "GpuStorageTextureAccess", + "GpuStorageTextureBindingLayout", + "GpuStoreOp", + "GpuSupportedFeatures", + "GpuSupportedLimits", + "GpuTexture", + "GpuTextureAspect", + "GpuTextureBindingLayout", + "GpuTextureDescriptor", + "GpuTextureDimension", + "GpuTextureFormat", + "GpuTextureSampleType", + "GpuTextureView", + "GpuTextureViewDescriptor", + "GpuTextureViewDimension", + "GpuUncapturedErrorEvent", + "GpuUncapturedErrorEventInit", + "GpuValidationError", + "GpuVertexAttribute", + "GpuVertexBufferLayout", + "GpuVertexFormat", + "GpuVertexState", + "GpuVertexStepMode", + "WgslLanguageFeatures", +]; + +pub(crate) fn run_vendor_web_sys(shell: Shell, mut args: Arguments) -> anyhow::Result<()> { + // -- Argument Parsing -- + + let no_cleanup = args.contains("--no-cleanup"); + + // We only allow one of these arguments to be passed at a time. + let version: Option = args.opt_value_from_str("--version")?; + let path_to_checkout_arg: Option = args.opt_value_from_str("--path-to-checkout")?; + + // Plain text of the command that was run. + let argument_description; + // Path to the checkout we're using + let path_to_wasm_bindgen_checkout; + match (path_to_checkout_arg.as_deref(), version.as_deref()) { + (Some(path), None) => { + argument_description = format!("--path-to-checkout {path}"); + path_to_wasm_bindgen_checkout = path + } + (None, Some(version)) => { + argument_description = format!("--version {version}"); + path_to_wasm_bindgen_checkout = WASM_BINDGEN_TEMP_CLONE_PATH + } + (Some(_), Some(_)) => { + bad_arguments!("Cannot use both --path-to-checkout and --version at the same time") + } + (None, None) => { + bad_arguments!("Expected either --path-to-checkout or --version") + } + }; + + let unknown_args = args.finish(); + if !unknown_args.is_empty() { + bad_arguments!( + "Unknown arguments to vendor-web-sys subcommand: {:?}", + unknown_args + ); + } + + // -- Main Logic -- + + eprintln!("# Removing {WEBGPU_SYS_PATH}"); + shell + .remove_path(WEBGPU_SYS_PATH) + .context("could not remove webgpu_sys")?; + + if let Some(ref version) = version { + eprintln!("# Cloning wasm-bindgen repository with version {version}"); + shell + .cmd("git") + .args([ + "clone", + "-b", + version, + "--depth", + "1", + "https://github.com/rustwasm/wasm-bindgen.git", + WASM_BINDGEN_TEMP_CLONE_PATH, + ]) + .ignore_stderr() + .run() + .context("Could not clone wasm-bindgen repository")?; + } + + if let Some(ref path) = path_to_checkout_arg { + eprintln!("# Using local checkout of wasm-bindgen at {path}"); + } + + shell + .create_dir(WEBGPU_SYS_PATH) + .context("Could not create webgpu_sys folder")?; + + // The indentation here does not matter, as rustfmt will normalize it. + let file_prefix = format!("\ + // DO NOT EDIT THIS FILE! + // + // This module part of a subset of web-sys that is used by wgpu's webgpu backend. + // + // If you want to improve the generated code, please submit a PR to the https://github.com/rustwasm/wasm-bindgen repository. + // + // This file was generated by the `cargo xtask vendor-web-sys {argument_description}` command.\n" + ); + + eprintln!( + "# Copying {} files and removing `#[cfg(...)]` attributes", + WEB_SYS_FEATURES_NEEDED.len() + ); + + // Matches all `#[cfg(...)]` attributes, including multi-line ones. + // + // The ? is very important, otherwise the regex will match the entire file. + let regex = regex_lite::RegexBuilder::new(r#"#\[cfg\(.*?\)\]"#) + .dot_matches_new_line(true) + .build() + .unwrap(); + + for &feature in WEB_SYS_FEATURES_NEEDED { + let feature_file = + format!("{path_to_wasm_bindgen_checkout}/{WEB_SYS_FILE_PREFIX}{feature}.rs"); + let destination = format!("{WEBGPU_SYS_PATH}/gen_{feature}.rs"); + + let file_contents = shell + .read_file(&feature_file) + .context("Could not read file")?; + + let mut file_contents = regex.replace_all(&file_contents, "").to_string(); + file_contents.insert_str(0, &file_prefix); + + shell + .write_file(destination, file_contents.as_bytes()) + .context("could not write file")?; + } + + eprintln!("# Writing mod.rs file"); + + let mut module_file_contents = format!( + "\ + //! Bindings to the WebGPU API. + //! + //! Internally vendored from the `web-sys` crate until the WebGPU binding are stabilized. + {file_prefix} + #![allow(unused_imports, non_snake_case)]\n" + ); + + module_file_contents.push_str("use web_sys::{Event, EventTarget};\n"); + + for &feature in WEB_SYS_FEATURES_NEEDED { + module_file_contents.push_str(&format!("mod gen_{};\n", feature)); + module_file_contents.push_str(&format!("pub use gen_{}::*;\n", feature)); + } + + shell.write_file(format!("{}/mod.rs", WEBGPU_SYS_PATH), module_file_contents)?; + + eprintln!("# Formatting files"); + + shell + .cmd("rustfmt") + .arg(format!("{WEBGPU_SYS_PATH}/mod.rs")) + .run() + .context("could not format")?; + + if !no_cleanup { + // We only need to remove this if we cloned it in the first place. + if version.is_some() { + eprintln!("# Removing wasm-bindgen clone"); + shell + .remove_path(WASM_BINDGEN_TEMP_CLONE_PATH) + .context("could not remove wasm-bindgen clone")?; + } + } else { + eprintln!("# Skipping cleanup"); + } + + eprintln!("# Finished!"); + + Ok(()) +} From 75fd68939cb3984b2f6de18496b5fcc2ffe3f0a3 Mon Sep 17 00:00:00 2001 From: Eshed Schacham Date: Fri, 1 Mar 2024 23:16:09 +0200 Subject: [PATCH 5/6] wgpu-hal: add ndk-sys dependency to fix linking error. (#5326) --- CHANGELOG.md | 3 +++ Cargo.lock | 1 + wgpu-hal/Cargo.toml | 1 + wgpu-hal/src/gles/egl.rs | 17 ++++++----------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd5e01c529..8b78f5c9ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,9 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325). - Fix an issue where command encoders weren't properly freed if an error occurred during command encoding. By @ErichDonGubler in [#5251](https://github.com/gfx-rs/wgpu/pull/5251). +#### Android +- Fix linking error when targeting android without `winit`. By @ashdnazg in [#5326](https://github.com/gfx-rs/wgpu/pull/5326). + ## v0.19.2 (2024-02-29) ### Added/New Features diff --git a/Cargo.lock b/Cargo.lock index b24210301d..42f60a97df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4072,6 +4072,7 @@ dependencies = [ "log", "metal", "naga", + "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", "parking_lot", diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 80f28b5366..26ce5b1516 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -154,6 +154,7 @@ libc = "0.2" [target.'cfg(target_os = "android")'.dependencies] android_system_properties = "0.1.1" +ndk-sys = "0.5.0" [dependencies.naga] path = "../naga" diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index d96dcc8dbf..8b2eb49d6e 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -50,16 +50,6 @@ type WlEglWindowResizeFun = unsafe extern "system" fn( type WlEglWindowDestroyFun = unsafe extern "system" fn(window: *const raw::c_void); -#[cfg(target_os = "android")] -extern "C" { - pub fn ANativeWindow_setBuffersGeometry( - window: *mut raw::c_void, - width: i32, - height: i32, - format: i32, - ) -> i32; -} - type EglLabel = *const raw::c_void; #[allow(clippy::upper_case_acronyms)] @@ -863,7 +853,12 @@ impl crate::Instance for Instance { .unwrap(); let ret = unsafe { - ANativeWindow_setBuffersGeometry(handle.a_native_window.as_ptr(), 0, 0, format) + ndk_sys::ANativeWindow_setBuffersGeometry( + handle.a_native_window.as_ptr() as *mut ndk_sys::ANativeWindow, + 0, + 0, + format, + ) }; if ret != 0 { From 9f505e730fa4ef62c040aa3f67e730ab2059a1cf Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 1 Mar 2024 16:45:53 -0500 Subject: [PATCH 6/6] Versions --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- wgpu-core/Cargo.toml | 2 +- wgpu-hal/Cargo.toml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42f60a97df..a2de51b4fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2555,7 +2555,7 @@ checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "player" -version = "0.19.2" +version = "0.19.3" dependencies = [ "env_logger", "log", @@ -3961,7 +3961,7 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.19.2" +version = "0.19.3" dependencies = [ "arrayvec 0.7.4", "cfg-if", @@ -3985,7 +3985,7 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.19.2" +version = "0.19.3" dependencies = [ "arrayvec 0.7.4", "bit-vec", @@ -4011,7 +4011,7 @@ dependencies = [ [[package]] name = "wgpu-examples" -version = "0.19.2" +version = "0.19.3" dependencies = [ "bytemuck", "cfg-if", @@ -4044,7 +4044,7 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.19.2" +version = "0.19.3" dependencies = [ "android_system_properties", "arrayvec 0.7.4", @@ -4092,7 +4092,7 @@ dependencies = [ [[package]] name = "wgpu-info" -version = "0.19.2" +version = "0.19.3" dependencies = [ "anyhow", "bitflags 2.4.1", @@ -4106,7 +4106,7 @@ dependencies = [ [[package]] name = "wgpu-macros" -version = "0.19.2" +version = "0.19.3" dependencies = [ "heck", "quote", @@ -4115,7 +4115,7 @@ dependencies = [ [[package]] name = "wgpu-test" -version = "0.19.2" +version = "0.19.3" dependencies = [ "anyhow", "arrayvec 0.7.4", diff --git a/Cargo.toml b/Cargo.toml index 118188a644..5bd9f0dae1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ keywords = ["graphics"] license = "MIT OR Apache-2.0" homepage = "https://wgpu.rs/" repository = "https://github.com/gfx-rs/wgpu" -version = "0.19.2" +version = "0.19.3" authors = ["gfx-rs developers"] [workspace.dependencies.wgc] diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index c7d8fbbcc1..e1a19da763 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-core" -version = "0.19.2" +version = "0.19.3" authors = ["gfx-rs developers"] edition = "2021" description = "WebGPU core logic on wgpu-hal" diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 26ce5b1516..dac5fbf9df 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-hal" -version = "0.19.2" +version = "0.19.3" authors = ["gfx-rs developers"] edition = "2021" description = "WebGPU hardware abstraction layer"