diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 6882a0fb440..c67cc6d0686 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -57,8 +57,6 @@ pub struct Export { /// Whether or not this function should be flagged as the wasm start /// function. pub start: bool, - /// Whether the API is unstable. This is only used internally. - pub unstable_api: bool, } /// The 3 types variations of `self`. @@ -79,7 +77,6 @@ pub struct Import { pub module: ImportModule, pub js_namespace: Option, pub kind: ImportKind, - pub unstable_api: bool, } #[cfg_attr(feature = "extra-traits", derive(Debug))] @@ -135,7 +132,6 @@ pub struct ImportFunction { pub kind: ImportFunctionKind, pub shim: Ident, pub doc_comment: Option, - pub unstable_api: bool, } #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] @@ -192,7 +188,6 @@ pub struct ImportType { pub js_name: String, pub attrs: Vec, pub typescript_name: Option, - pub unstable_api: bool, pub doc_comment: Option, pub instanceof_shim: String, pub is_type_of: Option, @@ -213,8 +208,6 @@ pub struct ImportEnum { pub variant_values: Vec, /// Attributes to apply to the Rust enum pub rust_attrs: Vec, - /// Whether the enum is part of an unstable WebIDL - pub unstable_api: bool, } #[cfg_attr(feature = "extra-traits", derive(Debug))] @@ -250,7 +243,6 @@ pub struct StructField { pub getter: Ident, pub setter: Ident, pub comments: Vec, - pub unstable_api: bool, } #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] @@ -260,7 +252,6 @@ pub struct Enum { pub variants: Vec, pub comments: Vec, pub hole: u32, - pub unstable_api: bool, } #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index 512e5c71fdc..4a9fd6c73b3 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -1,6 +1,6 @@ use crate::ast; use crate::encode; -use crate::util::{self, ShortHash}; +use crate::util::ShortHash; use crate::Diagnostic; use proc_macro2::{Ident, Literal, Span, TokenStream}; use quote::{quote, ToTokens}; @@ -41,7 +41,6 @@ impl TryToTokens for ast::Program { for i in self.imports.iter() { DescribeImport { kind: &i.kind, - unstable_api: i.unstable_api, }.to_tokens(tokens); // If there is a js namespace, check that name isn't a type. If it is, @@ -298,7 +297,6 @@ impl ToTokens for ast::StructField { inner: quote! { <#ty as WasmDescribe>::describe(); }, - unstable_api: self.unstable_api, attrs: vec![], } .to_tokens(tokens); @@ -536,7 +534,6 @@ impl TryToTokens for ast::Export { #(<#argtys as WasmDescribe>::describe();)* #describe_ret }, - unstable_api: self.unstable_api, attrs: attrs.clone(), } .to_tokens(into); @@ -563,7 +560,6 @@ impl ToTokens for ast::ImportType { let vis = &self.vis; let rust_name = &self.rust_name; let attrs = &self.attrs; - let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api); let doc_comment = match &self.doc_comment { None => "", Some(comment) => comment, @@ -612,14 +608,12 @@ impl ToTokens for ast::ImportType { #[doc = #doc_comment] #[repr(transparent)] #[allow(clippy::all)] - #unstable_api_attr #vis struct #rust_name { obj: #internal_obj } #[allow(bad_style)] #[allow(clippy::all)] - #unstable_api_attr const #const_name: () = { use wasm_bindgen::convert::{IntoWasmAbi, FromWasmAbi}; use wasm_bindgen::convert::{OptionIntoWasmAbi, OptionFromWasmAbi}; @@ -770,7 +764,6 @@ impl ToTokens for ast::ImportType { for superclass in self.extends.iter() { (quote! { #[allow(clippy::all)] - #unstable_api_attr impl From<#rust_name> for #superclass { #[inline] fn from(obj: #rust_name) -> #superclass { @@ -780,7 +773,6 @@ impl ToTokens for ast::ImportType { } #[allow(clippy::all)] - #unstable_api_attr impl AsRef<#superclass> for #rust_name { #[inline] fn as_ref(&self) -> &#superclass { @@ -802,7 +794,6 @@ impl ToTokens for ast::ImportEnum { let variants = &self.variants; let variant_strings = &self.variant_values; let attrs = &self.rust_attrs; - let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api); let mut current_idx: usize = 0; let variant_indexes: Vec = variants @@ -831,7 +822,6 @@ impl ToTokens for ast::ImportEnum { #[allow(bad_style)] #(#attrs)* #[allow(clippy::all)] - #unstable_api_attr #vis enum #name { #(#variants = #variant_indexes_ref,)* #[doc(hidden)] @@ -839,7 +829,6 @@ impl ToTokens for ast::ImportEnum { } #[allow(clippy::all)] - #unstable_api_attr impl #name { #vis fn from_js_value(obj: &wasm_bindgen::JsValue) -> Option<#name> { obj.as_string().and_then(|obj_str| match obj_str.as_str() { @@ -850,7 +839,6 @@ impl ToTokens for ast::ImportEnum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::describe::WasmDescribe for #name { fn describe() { wasm_bindgen::JsValue::describe() @@ -858,7 +846,6 @@ impl ToTokens for ast::ImportEnum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::IntoWasmAbi for #name { type Abi = ::Abi; @@ -870,7 +857,6 @@ impl ToTokens for ast::ImportEnum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::FromWasmAbi for #name { type Abi = ::Abi; @@ -881,21 +867,18 @@ impl ToTokens for ast::ImportEnum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::OptionIntoWasmAbi for #name { #[inline] fn none() -> Self::Abi { Object::none() } } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::OptionFromWasmAbi for #name { #[inline] fn is_none(abi: &Self::Abi) -> bool { Object::is_none(abi) } } #[allow(clippy::all)] - #unstable_api_attr impl From<#name> for wasm_bindgen::JsValue { fn from(obj: #name) -> wasm_bindgen::JsValue { match obj { @@ -1007,7 +990,6 @@ impl TryToTokens for ast::ImportFunction { let arguments = &arguments; let abi_arguments = &abi_arguments; let abi_argument_names = &abi_argument_names; - let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api); let doc_comment = match &self.doc_comment { None => "", @@ -1075,7 +1057,6 @@ impl TryToTokens for ast::ImportFunction { if let Some(class) = class_ty { (quote! { - #unstable_api_attr impl #class { #invocation } @@ -1092,7 +1073,6 @@ impl TryToTokens for ast::ImportFunction { // See comment above in ast::Export for what's going on here. struct DescribeImport<'a> { kind: &'a ast::ImportKind, - unstable_api: bool, } impl<'a> ToTokens for DescribeImport<'a> { @@ -1119,7 +1099,6 @@ impl<'a> ToTokens for DescribeImport<'a> { #(<#argtys as WasmDescribe>::describe();)* #inform_ret }, - unstable_api: self.unstable_api, attrs: f.function.rust_attrs.clone(), } .to_tokens(tokens); @@ -1130,7 +1109,6 @@ impl ToTokens for ast::Enum { fn to_tokens(&self, into: &mut TokenStream) { let enum_name = &self.name; let hole = &self.hole; - let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api); let cast_clauses = self.variants.iter().map(|variant| { let variant_name = &variant.name; quote! { @@ -1141,7 +1119,6 @@ impl ToTokens for ast::Enum { }); (quote! { #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::IntoWasmAbi for #enum_name { type Abi = u32; @@ -1152,7 +1129,6 @@ impl ToTokens for ast::Enum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::FromWasmAbi for #enum_name { type Abi = u32; @@ -1165,21 +1141,18 @@ impl ToTokens for ast::Enum { } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::OptionFromWasmAbi for #enum_name { #[inline] fn is_none(val: &u32) -> bool { *val == #hole } } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name { #[inline] fn none() -> Self::Abi { #hole } } #[allow(clippy::all)] - #unstable_api_attr impl wasm_bindgen::describe::WasmDescribe for #enum_name { fn describe() { use wasm_bindgen::describe::*; @@ -1230,7 +1203,6 @@ impl ToTokens for ast::ImportStatic { inner: quote! { <#ty as WasmDescribe>::describe(); }, - unstable_api: false, attrs: vec![], } .to_tokens(into); @@ -1242,7 +1214,6 @@ impl ToTokens for ast::ImportStatic { struct Descriptor<'a, T> { ident: &'a Ident, inner: T, - unstable_api: bool, attrs: Vec, } @@ -1271,7 +1242,6 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> { } let name = Ident::new(&format!("__wbindgen_describe_{}", ident), ident.span()); - let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api); let inner = &self.inner; let attrs = &self.attrs; (quote! { @@ -1281,7 +1251,6 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> { #[doc(hidden)] #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] #[allow(clippy::all)] - #unstable_api_attr pub extern "C" fn #name() { use wasm_bindgen::describe::*; // See definition of `link_mem_intrinsics` for what this is doing diff --git a/crates/backend/src/encode.rs b/crates/backend/src/encode.rs index 081a52cf4aa..d60e34c6757 100644 --- a/crates/backend/src/encode.rs +++ b/crates/backend/src/encode.rs @@ -188,7 +188,6 @@ fn shared_export<'a>( function: shared_function(&export.function, intern), method_kind, start: export.start, - unstable_api: export.unstable_api, }) } diff --git a/crates/backend/src/util.rs b/crates/backend/src/util.rs index 766aac06493..950ae9b4582 100644 --- a/crates/backend/src/util.rs +++ b/crates/backend/src/util.rs @@ -113,12 +113,10 @@ pub fn ident_ty(ident: Ident) -> syn::Type { } pub fn wrap_import_function(function: ast::ImportFunction) -> ast::Import { - let unstable_api = function.unstable_api; ast::Import { module: ast::ImportModule::None, js_namespace: None, kind: ast::ImportKind::Function(function), - unstable_api, } } @@ -156,20 +154,3 @@ impl fmt::Display for ShortHash { write!(f, "{:016x}", h.finish()) } } - - -/// Create syn attribute for `#[cfg(web_sys_unstable_apis)]` and a doc comment. -pub fn unstable_api_attrs() -> proc_macro2::TokenStream { - quote::quote!( - #[cfg(web_sys_unstable_apis)] - #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - ) -} - -pub fn maybe_unstable_api_attr(unstable_api: bool) -> Option { - if unstable_api { - Some(unstable_api_attrs()) - } else { - None - } -} diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index 033766ab930..9264f32b79f 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -22,7 +22,6 @@ struct AttributeParseState { pub struct BindgenAttrs { /// List of parsed attributes pub attrs: Vec<(Cell, BindgenAttr)>, - pub unstable_api_attr: Option, } macro_rules! attrgen { @@ -188,7 +187,7 @@ impl Default for BindgenAttrs { // sanity check that we call `check_used` an appropriate number of // times. ATTRS.with(|state| state.parsed.set(state.parsed.get() + 1)); - BindgenAttrs { attrs: Vec::new(), unstable_api_attr: None, } + BindgenAttrs { attrs: Vec::new() } } } @@ -355,7 +354,6 @@ impl<'a> ConvertToAst for &'a mut syn::ItemStruct { getter: Ident::new(&getter, Span::call_site()), setter: Ident::new(&setter, Span::call_site()), comments, - unstable_api: false, }); attrs.check_used()?; } @@ -516,7 +514,6 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte rust_name: self.sig.ident.clone(), shim: Ident::new(&shim, Span::call_site()), doc_comment: None, - unstable_api: false, }); opts.check_used()?; @@ -557,7 +554,6 @@ impl ConvertToAst for syn::ForeignItemType { Ok(ast::ImportKind::Type(ast::ImportType { vis: self.vis, attrs: self.attrs, - unstable_api: false, doc_comment: None, instanceof_shim: shim, is_type_of, @@ -785,7 +781,6 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { rust_class: None, rust_name, start, - unstable_api: false, }); } syn::Item::Struct(mut s) => { @@ -988,7 +983,6 @@ impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod { rust_class: Some(class.clone()), rust_name: self.sig.ident.clone(), start: false, - unstable_api: false, }); opts.check_used()?; Ok(()) @@ -1083,7 +1077,6 @@ impl MacroParse<()> for syn::ItemEnum { variants, comments, hole, - unstable_api: false, }); Ok(()) } @@ -1188,7 +1181,6 @@ impl MacroParse for syn::ForeignItem { module, js_namespace, kind, - unstable_api: false, }); Ok(()) diff --git a/crates/shared/src/lib.rs b/crates/shared/src/lib.rs index e0b59c11f64..ceea8baf210 100644 --- a/crates/shared/src/lib.rs +++ b/crates/shared/src/lib.rs @@ -94,7 +94,6 @@ macro_rules! shared_api { function: Function<'a>, method_kind: MethodKind<'a>, start: bool, - unstable_api: bool, } struct Enum<'a> { diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index e27aed50399..73baf7b1c82 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -410,7 +410,7 @@ GpuComputePipeline = [] GpuComputePipelineDescriptor = [] GpuCullMode = [] GpuDepthStencilStateDescriptor = [] -GpuDevice = [] +GpuDevice = ["EventTarget"] GpuDeviceDescriptor = [] GpuDeviceLostInfo = [] GpuErrorFilter = [] @@ -469,7 +469,7 @@ GpuTextureUsage = [] GpuTextureView = [] GpuTextureViewDescriptor = [] GpuTextureViewDimension = [] -GpuUncapturedErrorEvent = [] +GpuUncapturedErrorEvent = ["Event"] GpuUncapturedErrorEventInit = [] GpuValidationError = [] GpuVertexAttributeDescriptor = [] diff --git a/crates/web-sys/src/features/gen_Gpu.rs b/crates/web-sys/src/features/gen_Gpu.rs new file mode 100644 index 00000000000..6560ffd1d1d --- /dev/null +++ b/crates/web-sys/src/features/gen_Gpu.rs @@ -0,0 +1,25 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPU , typescript_name = GPU ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Gpu` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU)\n\n*This API requires the following crate features to be activated: `Gpu`*"] + pub type Gpu; + # [ wasm_bindgen ( method , structural , js_name = requestAdapter ) ] + #[doc = "The `requestAdapter()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter)\n\n*This API requires the following crate features to be activated: `Gpu`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuRequestAdapterOptions")] + # [ wasm_bindgen ( method , structural , js_name = requestAdapter ) ] + #[doc = "The `requestAdapter()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter)\n\n*This API requires the following crate features to be activated: `Gpu`, `GpuRequestAdapterOptions`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuAdapter.rs b/crates/web-sys/src/features/gen_GpuAdapter.rs new file mode 100644 index 00000000000..8da36cdb60d --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuAdapter.rs @@ -0,0 +1,30 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUAdapter , typescript_name = GPUAdapter ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuAdapter` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter)\n\n*This API requires the following crate features to be activated: `GpuAdapter`*"] + pub type GpuAdapter; + # [ wasm_bindgen ( structural , method , getter , js_name = name ) ] + #[doc = "Getter for the `name` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/name)\n\n*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(this: &GpuAdapter) -> String; + # [ wasm_bindgen ( method , structural , js_name = requestDevice ) ] + #[doc = "The `requestDevice()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)\n\n*This API requires the following crate features to be activated: `GpuAdapter`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuDeviceDescriptor")] + # [ wasm_bindgen ( method , structural , js_name = requestDevice ) ] + #[doc = "The `requestDevice()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)\n\n*This API requires the following crate features to be activated: `GpuAdapter`, `GpuDeviceDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuAddressMode.rs b/crates/web-sys/src/features/gen_GpuAddressMode.rs new file mode 100644 index 00000000000..8eaf748756c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuAddressMode.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuAddressMode` enum.\n\n*This API requires the following crate features to be activated: `GpuAddressMode`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuAddressMode { + ClampToEdge = "clamp-to-edge", + Repeat = "repeat", + MirrorRepeat = "mirror-repeat", +} diff --git a/crates/web-sys/src/features/gen_GpuBindGroup.rs b/crates/web-sys/src/features/gen_GpuBindGroup.rs new file mode 100644 index 00000000000..923d86c303d --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroup.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroup , typescript_name = GPUBindGroup ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroup` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`*"] + pub type GpuBindGroup; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup/label)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBindGroup) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup/label)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuBindGroupBinding.rs b/crates/web-sys/src/features/gen_GpuBindGroupBinding.rs new file mode 100644 index 00000000000..aaefb352f55 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroupBinding.rs @@ -0,0 +1,52 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupBinding ) ] + #[doc = "The `GpuBindGroupBinding` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"] + pub type GpuBindGroupBinding; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBindGroupBinding { + #[doc = "Construct a new `GpuBindGroupBinding`.\n\n*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"] + 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/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs new file mode 100644 index 00000000000..fc30ba44d1c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs @@ -0,0 +1,62 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupDescriptor ) ] + #[doc = "The `GpuBindGroupDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + pub type GpuBindGroupDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBindGroupDescriptor { + #[cfg(feature = "GpuBindGroupLayout")] + #[doc = "Construct a new `GpuBindGroupDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + pub fn new(bindings: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.bindings(bindings); + ret.layout(layout); + ret + } + #[doc = "Change the `label` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + 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 `bindings` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + pub fn bindings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bindings"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuBindGroupLayout")] + #[doc = "Change the `layout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + 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/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs new file mode 100644 index 00000000000..54807e31b6a --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupLayout , typescript_name = GPUBindGroupLayout ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBindGroupLayout` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout)\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + pub type GpuBindGroupLayout; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout/label)\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBindGroupLayout) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout/label)\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayout`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutBinding.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutBinding.rs new file mode 100644 index 00000000000..9eba93f9cf0 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutBinding.rs @@ -0,0 +1,128 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutBinding ) ] + #[doc = "The `GpuBindGroupLayoutBinding` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuBindingType`*"] + pub type GpuBindGroupLayoutBinding; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBindGroupLayoutBinding { + #[cfg(feature = "GpuBindingType")] + #[doc = "Construct a new `GpuBindGroupLayoutBinding`.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuBindingType`*"] + pub fn new(binding: u32, type_: GpuBindingType, visibility: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.binding(binding); + ret.type_(type_); + ret.visibility(visibility); + ret + } + #[doc = "Change the `binding` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"] + 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 `hasDynamicOffset` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"] + 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 `multisampled` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"] + 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 + } + #[cfg(feature = "GpuTextureComponentType")] + #[doc = "Change the `textureComponentType` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuTextureComponentType`*"] + pub fn texture_component_type(&mut self, val: GpuTextureComponentType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("textureComponentType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuTextureViewDimension")] + #[doc = "Change the `textureDimension` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuTextureViewDimension`*"] + pub fn texture_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("textureDimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuBindingType")] + #[doc = "Change the `type` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuBindingType`*"] + pub fn type_(&mut self, val: GpuBindingType) -> &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 + } + #[doc = "Change the `visibility` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"] + 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/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs new file mode 100644 index 00000000000..6a9f14f116c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs @@ -0,0 +1,47 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutDescriptor ) ] + #[doc = "The `GpuBindGroupLayoutDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + pub type GpuBindGroupLayoutDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBindGroupLayoutDescriptor { + #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + pub fn new(bindings: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.bindings(bindings); + ret + } + #[doc = "Change the `label` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + 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 `bindings` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + pub fn bindings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bindings"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuBindingType.rs b/crates/web-sys/src/features/gen_GpuBindingType.rs new file mode 100644 index 00000000000..6d742e3efaa --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBindingType.rs @@ -0,0 +1,14 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuBindingType` enum.\n\n*This API requires the following crate features to be activated: `GpuBindingType`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuBindingType { + UniformBuffer = "uniform-buffer", + StorageBuffer = "storage-buffer", + ReadonlyStorageBuffer = "readonly-storage-buffer", + Sampler = "sampler", + SampledTexture = "sampled-texture", + StorageTexture = "storage-texture", +} diff --git a/crates/web-sys/src/features/gen_GpuBlendDescriptor.rs b/crates/web-sys/src/features/gen_GpuBlendDescriptor.rs new file mode 100644 index 00000000000..02052283c6c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBlendDescriptor.rs @@ -0,0 +1,68 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBlendDescriptor ) ] + #[doc = "The `GpuBlendDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`*"] + pub type GpuBlendDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBlendDescriptor { + #[doc = "Construct a new `GpuBlendDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "GpuBlendFactor")] + #[doc = "Change the `dstFactor` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendFactor`*"] + 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 + } + #[cfg(feature = "GpuBlendOperation")] + #[doc = "Change the `operation` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendOperation`*"] + 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 + } + #[cfg(feature = "GpuBlendFactor")] + #[doc = "Change the `srcFactor` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendFactor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuBlendFactor.rs b/crates/web-sys/src/features/gen_GpuBlendFactor.rs new file mode 100644 index 00000000000..b013893d0bb --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBlendFactor.rs @@ -0,0 +1,21 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuBlendFactor` enum.\n\n*This API requires the following crate features to be activated: `GpuBlendFactor`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuBlendFactor { + Zero = "zero", + One = "one", + SrcColor = "src-color", + OneMinusSrcColor = "one-minus-src-color", + SrcAlpha = "src-alpha", + OneMinusSrcAlpha = "one-minus-src-alpha", + DstColor = "dst-color", + OneMinusDstColor = "one-minus-dst-color", + DstAlpha = "dst-alpha", + OneMinusDstAlpha = "one-minus-dst-alpha", + SrcAlphaSaturated = "src-alpha-saturated", + BlendColor = "blend-color", + OneMinusBlendColor = "one-minus-blend-color", +} diff --git a/crates/web-sys/src/features/gen_GpuBlendOperation.rs b/crates/web-sys/src/features/gen_GpuBlendOperation.rs new file mode 100644 index 00000000000..c79688d6fc8 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBlendOperation.rs @@ -0,0 +1,13 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuBlendOperation` enum.\n\n*This API requires the following crate features to be activated: `GpuBlendOperation`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuBlendOperation { + Add = "add", + Subtract = "subtract", + ReverseSubtract = "reverse-subtract", + Min = "min", + Max = "max", +} diff --git a/crates/web-sys/src/features/gen_GpuBuffer.rs b/crates/web-sys/src/features/gen_GpuBuffer.rs new file mode 100644 index 00000000000..cb2270a60bf --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBuffer.rs @@ -0,0 +1,41 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBuffer , typescript_name = GPUBuffer ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBuffer` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + pub type GpuBuffer; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuBuffer) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + # [ wasm_bindgen ( method , structural , js_name = destroy ) ] + #[doc = "The `destroy()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/destroy)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = mapReadAsync ) ] + #[doc = "The `mapReadAsync()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapReadAsync)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_read_async(this: &GpuBuffer) -> ::js_sys::Promise; + # [ wasm_bindgen ( method , structural , js_name = mapWriteAsync ) ] + #[doc = "The `mapWriteAsync()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapWriteAsync)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_write_async(this: &GpuBuffer) -> ::js_sys::Promise; + # [ wasm_bindgen ( method , structural , js_name = unmap ) ] + #[doc = "The `unmap()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/unmap)\n\n*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuBufferBinding.rs b/crates/web-sys/src/features/gen_GpuBufferBinding.rs new file mode 100644 index 00000000000..46aeeb3410e --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferBinding.rs @@ -0,0 +1,58 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBufferBinding ) ] + #[doc = "The `GpuBufferBinding` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + pub type GpuBufferBinding; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBufferBinding { + #[cfg(feature = "GpuBuffer")] + #[doc = "Construct a new `GpuBufferBinding`.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + 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 + } + #[cfg(feature = "GpuBuffer")] + #[doc = "Change the `buffer` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + 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/crates/web-sys/src/features/gen_GpuBufferCopyView.rs b/crates/web-sys/src/features/gen_GpuBufferCopyView.rs new file mode 100644 index 00000000000..a7ad73cccf0 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferCopyView.rs @@ -0,0 +1,79 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBufferCopyView ) ] + #[doc = "The `GpuBufferCopyView` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferCopyView`*"] + pub type GpuBufferCopyView; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBufferCopyView { + #[cfg(feature = "GpuBuffer")] + #[doc = "Construct a new `GpuBufferCopyView`.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferCopyView`*"] + pub fn new(buffer: &GpuBuffer, image_height: u32, row_pitch: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.buffer(buffer); + ret.image_height(image_height); + ret.row_pitch(row_pitch); + ret + } + #[cfg(feature = "GpuBuffer")] + #[doc = "Change the `buffer` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferCopyView`*"] + 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 `imageHeight` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`*"] + pub fn image_height(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("imageHeight"), + &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.\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`*"] + 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 `rowPitch` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`*"] + pub fn row_pitch(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("rowPitch"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs new file mode 100644 index 00000000000..a67d1fcfb82 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs @@ -0,0 +1,55 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBufferDescriptor ) ] + #[doc = "The `GpuBufferDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + pub type GpuBufferDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBufferDescriptor { + #[doc = "Construct a new `GpuBufferDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + 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 `size` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuBufferUsage.rs b/crates/web-sys/src/features/gen_GpuBufferUsage.rs new file mode 100644 index 00000000000..aa412b2c895 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferUsage.rs @@ -0,0 +1,42 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBufferUsage , typescript_name = GPUBufferUsage ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBufferUsage` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBufferUsage)\n\n*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + pub type GpuBufferUsage; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuBufferUsage { + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const MAP_READ: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const MAP_WRITE: u32 = 2u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COPY_SRC: u32 = 4u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COPY_DST: u32 = 8u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const INDEX: u32 = 16u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const VERTEX: u32 = 32u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const UNIFORM: u32 = 64u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const STORAGE: u32 = 128u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const INDIRECT: u32 = 256u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_GpuCanvasContext.rs b/crates/web-sys/src/features/gen_GpuCanvasContext.rs new file mode 100644 index 00000000000..fa5dbf76292 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCanvasContext.rs @@ -0,0 +1,29 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUCanvasContext , typescript_name = GPUCanvasContext ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCanvasContext` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext)\n\n*This API requires the following crate features to be activated: `GpuCanvasContext`*"] + pub type GpuCanvasContext; + #[cfg(all(feature = "GpuSwapChain", feature = "GpuSwapChainDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = configureSwapChain ) ] + #[doc = "The `configureSwapChain()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configureSwapChain)\n\n*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuSwapChain`, `GpuSwapChainDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn configure_swap_chain( + this: &GpuCanvasContext, + descriptor: &GpuSwapChainDescriptor, + ) -> GpuSwapChain; + #[cfg(feature = "GpuDevice")] + # [ wasm_bindgen ( method , structural , js_name = getSwapChainPreferredFormat ) ] + #[doc = "The `getSwapChainPreferredFormat()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getSwapChainPreferredFormat)\n\n*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_swap_chain_preferred_format( + this: &GpuCanvasContext, + device: &GpuDevice, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_GpuColorDict.rs b/crates/web-sys/src/features/gen_GpuColorDict.rs new file mode 100644 index 00000000000..3e5fcff7175 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuColorDict.rs @@ -0,0 +1,68 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUColorDict ) ] + #[doc = "The `GpuColorDict` dictionary.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + pub type GpuColorDict; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuColorDict { + #[doc = "Construct a new `GpuColorDict`.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuColorDict`*"] + 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/crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs new file mode 100644 index 00000000000..4be786f394e --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs @@ -0,0 +1,82 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUColorStateDescriptor ) ] + #[doc = "The `GpuColorStateDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuColorStateDescriptor`, `GpuTextureFormat`*"] + pub type GpuColorStateDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuColorStateDescriptor { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuColorStateDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuColorStateDescriptor`, `GpuTextureFormat`*"] + 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 + } + #[cfg(feature = "GpuBlendDescriptor")] + #[doc = "Change the `alphaBlend` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuColorStateDescriptor`*"] + pub fn alpha_blend(&mut self, val: &GpuBlendDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("alphaBlend"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuBlendDescriptor")] + #[doc = "Change the `colorBlend` field of this object.\n\n*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuColorStateDescriptor`*"] + pub fn color_blend(&mut self, val: &GpuBlendDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("colorBlend"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuColorStateDescriptor`, `GpuTextureFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuColorStateDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuColorWrite.rs b/crates/web-sys/src/features/gen_GpuColorWrite.rs new file mode 100644 index 00000000000..a1c04a6c1a0 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuColorWrite.rs @@ -0,0 +1,30 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUColorWrite , typescript_name = GPUColorWrite ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuColorWrite` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUColorWrite)\n\n*This API requires the following crate features to be activated: `GpuColorWrite`*"] + pub type GpuColorWrite; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuColorWrite { + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const RED: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const GREEN: u32 = 2u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const BLUE: u32 = 4u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const ALPHA: u32 = 8u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const ALL: u32 = 15u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_GpuCommandBuffer.rs b/crates/web-sys/src/features/gen_GpuCommandBuffer.rs new file mode 100644 index 00000000000..5c14c069533 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCommandBuffer.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUCommandBuffer , typescript_name = GPUCommandBuffer ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandBuffer` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer)\n\n*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + pub type GpuCommandBuffer; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer/label)\n\n*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuCommandBuffer) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer/label)\n\n*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs new file mode 100644 index 00000000000..da5d7c44595 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs @@ -0,0 +1,31 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUCommandBufferDescriptor ) ] + #[doc = "The `GpuCommandBufferDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + pub type GpuCommandBufferDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuCommandBufferDescriptor { + #[doc = "Construct a new `GpuCommandBufferDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs new file mode 100644 index 00000000000..255472b5a97 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs @@ -0,0 +1,256 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUCommandEncoder , typescript_name = GPUCommandEncoder ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCommandEncoder` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + pub type GpuCommandEncoder; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuCommandEncoder) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + #[cfg(feature = "GpuComputePassEncoder")] + # [ wasm_bindgen ( method , structural , js_name = beginComputePass ) ] + #[doc = "The `beginComputePass()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginComputePass)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all( + feature = "GpuComputePassDescriptor", + feature = "GpuComputePassEncoder", + ))] + # [ wasm_bindgen ( method , structural , js_name = beginComputePass ) ] + #[doc = "The `beginComputePass()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginComputePass)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuComputePassDescriptor`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuRenderPassDescriptor", feature = "GpuRenderPassEncoder",))] + # [ wasm_bindgen ( method , structural , js_name = beginRenderPass ) ] + #[doc = "The `beginRenderPass()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginRenderPass)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuRenderPassDescriptor`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToBuffer ) ] + #[doc = "The `copyBufferToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(all(feature = "GpuBufferCopyView", feature = "GpuTextureCopyView",))] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToTexture ) ] + #[doc = "The `copyBufferToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBufferCopyView, + destination: &GpuTextureCopyView, + copy_size: &::wasm_bindgen::JsValue, + ); + #[cfg(all( + feature = "GpuBufferCopyView", + feature = "GpuExtent3dDict", + feature = "GpuTextureCopyView", + ))] + # [ wasm_bindgen ( method , structural , js_name = copyBufferToTexture ) ] + #[doc = "The `copyBufferToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBufferCopyView, + destination: &GpuTextureCopyView, + copy_size: &GpuExtent3dDict, + ); + #[cfg(all(feature = "GpuBufferCopyView", feature = "GpuTextureCopyView",))] + # [ wasm_bindgen ( method , structural , js_name = copyTextureToBuffer ) ] + #[doc = "The `copyTextureToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuTextureCopyView, + destination: &GpuBufferCopyView, + copy_size: &::wasm_bindgen::JsValue, + ); + #[cfg(all( + feature = "GpuBufferCopyView", + feature = "GpuExtent3dDict", + feature = "GpuTextureCopyView", + ))] + # [ wasm_bindgen ( method , structural , js_name = copyTextureToBuffer ) ] + #[doc = "The `copyTextureToBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)\n\n*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuTextureCopyView, + destination: &GpuBufferCopyView, + copy_size: &GpuExtent3dDict, + ); + #[cfg(feature = "GpuTextureCopyView")] + # [ wasm_bindgen ( method , structural , js_name = copyTextureToTexture ) ] + #[doc = "The `copyTextureToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuTextureCopyView, + destination: &GpuTextureCopyView, + copy_size: &::wasm_bindgen::JsValue, + ); + #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuTextureCopyView",))] + # [ wasm_bindgen ( method , structural , js_name = copyTextureToTexture ) ] + #[doc = "The `copyTextureToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuTextureCopyView, + destination: &GpuTextureCopyView, + copy_size: &GpuExtent3dDict, + ); + #[cfg(feature = "GpuCommandBuffer")] + # [ wasm_bindgen ( method , structural , js_name = finish ) ] + #[doc = "The `finish()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/finish)\n\n*This API requires the following crate features to be activated: `GpuCommandBuffer`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish(this: &GpuCommandEncoder) -> GpuCommandBuffer; + #[cfg(all(feature = "GpuCommandBuffer", feature = "GpuCommandBufferDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = finish ) ] + #[doc = "The `finish()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/finish)\n\n*This API requires the following crate features to be activated: `GpuCommandBuffer`, `GpuCommandBufferDescriptor`, `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = insertDebugMarker ) ] + #[doc = "The `insertDebugMarker()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/insertDebugMarker)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = popDebugGroup ) ] + #[doc = "The `popDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/popDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = pushDebugGroup ) ] + #[doc = "The `pushDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/pushDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs new file mode 100644 index 00000000000..68ece317201 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs @@ -0,0 +1,31 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUCommandEncoderDescriptor ) ] + #[doc = "The `GpuCommandEncoderDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + pub type GpuCommandEncoderDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuCommandEncoderDescriptor { + #[doc = "Construct a new `GpuCommandEncoderDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuCompareFunction.rs b/crates/web-sys/src/features/gen_GpuCompareFunction.rs new file mode 100644 index 00000000000..22683a7ee50 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCompareFunction.rs @@ -0,0 +1,16 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuCompareFunction` enum.\n\n*This API requires the following crate features to be activated: `GpuCompareFunction`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +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/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs new file mode 100644 index 00000000000..f3953fd30d7 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs @@ -0,0 +1,31 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUComputePassDescriptor ) ] + #[doc = "The `GpuComputePassDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + pub type GpuComputePassDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuComputePassDescriptor { + #[doc = "Construct a new `GpuComputePassDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs b/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs new file mode 100644 index 00000000000..bd5729744f8 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs @@ -0,0 +1,125 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUComputePassEncoder , typescript_name = GPUComputePassEncoder ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePassEncoder` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + pub type GpuComputePassEncoder; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuComputePassEncoder) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + # [ wasm_bindgen ( method , structural , js_name = dispatch ) ] + #[doc = "The `dispatch()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch(this: &GpuComputePassEncoder, x: u32); + # [ wasm_bindgen ( method , structural , js_name = dispatch ) ] + #[doc = "The `dispatch()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_with_y(this: &GpuComputePassEncoder, x: u32, y: u32); + # [ wasm_bindgen ( method , structural , js_name = dispatch ) ] + #[doc = "The `dispatch()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_with_y_and_z(this: &GpuComputePassEncoder, x: u32, y: u32, z: u32); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = dispatchIndirect ) ] + #[doc = "The `dispatchIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_indirect_with_u32( + this: &GpuComputePassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = dispatchIndirect ) ] + #[doc = "The `dispatchIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dispatch_indirect_with_f64( + this: &GpuComputePassEncoder, + indirect_buffer: &GpuBuffer, + indirect_offset: f64, + ); + # [ wasm_bindgen ( method , structural , js_name = endPass ) ] + #[doc = "The `endPass()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/endPass)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end_pass(this: &GpuComputePassEncoder); + #[cfg(feature = "GpuComputePipeline")] + # [ wasm_bindgen ( method , structural , js_name = setPipeline ) ] + #[doc = "The `setPipeline()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setPipeline)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`, `GpuComputePipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = insertDebugMarker ) ] + #[doc = "The `insertDebugMarker()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/insertDebugMarker)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = popDebugGroup ) ] + #[doc = "The `popDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/popDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = pushDebugGroup ) ] + #[doc = "The `pushDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/pushDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); +} diff --git a/crates/web-sys/src/features/gen_GpuComputePipeline.rs b/crates/web-sys/src/features/gen_GpuComputePipeline.rs new file mode 100644 index 00000000000..4717586b4ed --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuComputePipeline.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUComputePipeline , typescript_name = GPUComputePipeline ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePipeline` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline)\n\n*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + pub type GpuComputePipeline; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline/label)\n\n*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuComputePipeline) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline/label)\n\n*This API requires the following crate features to be activated: `GpuComputePipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs new file mode 100644 index 00000000000..e8271a58558 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs @@ -0,0 +1,66 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUComputePipelineDescriptor ) ] + #[doc = "The `GpuComputePipelineDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`, `GpuProgrammableStageDescriptor`*"] + pub type GpuComputePipelineDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuComputePipelineDescriptor { + #[cfg(all( + feature = "GpuPipelineLayout", + feature = "GpuProgrammableStageDescriptor", + ))] + #[doc = "Construct a new `GpuComputePipelineDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`, `GpuProgrammableStageDescriptor`*"] + pub fn new(layout: &GpuPipelineLayout, compute_stage: &GpuProgrammableStageDescriptor) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.layout(layout); + ret.compute_stage(compute_stage); + ret + } + #[doc = "Change the `label` field of this object.\n\n*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + 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 + } + #[cfg(feature = "GpuPipelineLayout")] + #[doc = "Change the `layout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`*"] + pub fn layout(&mut self, val: &GpuPipelineLayout) -> &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 + } + #[cfg(feature = "GpuProgrammableStageDescriptor")] + #[doc = "Change the `computeStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStageDescriptor`*"] + pub fn compute_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("computeStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuCullMode.rs b/crates/web-sys/src/features/gen_GpuCullMode.rs new file mode 100644 index 00000000000..a251fe0cf13 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCullMode.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuCullMode` enum.\n\n*This API requires the following crate features to be activated: `GpuCullMode`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuCullMode { + None = "none", + Front = "front", + Back = "back", +} diff --git a/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs new file mode 100644 index 00000000000..561002993ea --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs @@ -0,0 +1,128 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUDepthStencilStateDescriptor ) ] + #[doc = "The `GpuDepthStencilStateDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuTextureFormat`*"] + pub type GpuDepthStencilStateDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuDepthStencilStateDescriptor { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuDepthStencilStateDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuTextureFormat`*"] + 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 + } + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Change the `depthCompare` field of this object.\n\n*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilStateDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuTextureFormat`*"] + 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 + } + #[cfg(feature = "GpuStencilStateFaceDescriptor")] + #[doc = "Change the `stencilBack` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuStencilStateFaceDescriptor`*"] + pub fn stencil_back(&mut self, val: &GpuStencilStateFaceDescriptor) -> &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 + } + #[cfg(feature = "GpuStencilStateFaceDescriptor")] + #[doc = "Change the `stencilFront` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuStencilStateFaceDescriptor`*"] + pub fn stencil_front(&mut self, val: &GpuStencilStateFaceDescriptor) -> &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.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuDevice.rs b/crates/web-sys/src/features/gen_GpuDevice.rs new file mode 100644 index 00000000000..f8f903979e4 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuDevice.rs @@ -0,0 +1,185 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = GPUDevice , typescript_name = GPUDevice ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDevice` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + pub type GpuDevice; + # [ wasm_bindgen ( structural , method , getter , js_name = adapter ) ] + #[cfg(feature = "GpuAdapter")] + #[doc = "Getter for the `adapter` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/adapter)\n\n*This API requires the following crate features to be activated: `GpuAdapter`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn adapter(this: &GpuDevice) -> GpuAdapter; + # [ wasm_bindgen ( structural , method , getter , js_name = limits ) ] + #[doc = "Getter for the `limits` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/limits)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn limits(this: &GpuDevice) -> ::js_sys::Object; + # [ wasm_bindgen ( structural , method , getter , js_name = defaultQueue ) ] + #[cfg(feature = "GpuQueue")] + #[doc = "Getter for the `defaultQueue` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/defaultQueue)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn default_queue(this: &GpuDevice) -> GpuQueue; + # [ wasm_bindgen ( structural , method , getter , js_name = lost ) ] + #[doc = "Getter for the `lost` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/lost)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = onuncapturederror ) ] + #[doc = "Getter for the `onuncapturederror` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/onuncapturederror)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = onuncapturederror ) ] + #[doc = "Setter for the `onuncapturederror` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/onuncapturederror)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/label)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuDevice) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/label)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + #[cfg(all(feature = "GpuBindGroup", feature = "GpuBindGroupDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createBindGroup ) ] + #[doc = "The `createBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuBindGroupDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all( + feature = "GpuBindGroupLayout", + feature = "GpuBindGroupLayoutDescriptor", + ))] + # [ wasm_bindgen ( method , structural , js_name = createBindGroupLayout ) ] + #[doc = "The `createBindGroupLayout()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroupLayout)\n\n*This API requires the following crate features to be activated: `GpuBindGroupLayout`, `GpuBindGroupLayoutDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuBuffer", feature = "GpuBufferDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createBuffer ) ] + #[doc = "The `createBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuBufferDescriptor")] + # [ wasm_bindgen ( method , structural , js_name = createBufferMapped ) ] + #[doc = "The `createBufferMapped()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBufferMapped)\n\n*This API requires the following crate features to be activated: `GpuBufferDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_buffer_mapped( + this: &GpuDevice, + descriptor: &GpuBufferDescriptor, + ) -> ::js_sys::Array; + #[cfg(feature = "GpuCommandEncoder")] + # [ wasm_bindgen ( method , structural , js_name = createCommandEncoder ) ] + #[doc = "The `createCommandEncoder()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createCommandEncoder)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuCommandEncoder", feature = "GpuCommandEncoderDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createCommandEncoder ) ] + #[doc = "The `createCommandEncoder()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createCommandEncoder)\n\n*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuCommandEncoderDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all( + feature = "GpuComputePipeline", + feature = "GpuComputePipelineDescriptor", + ))] + # [ wasm_bindgen ( method , structural , js_name = createComputePipeline ) ] + #[doc = "The `createComputePipeline()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createComputePipeline)\n\n*This API requires the following crate features to be activated: `GpuComputePipeline`, `GpuComputePipelineDescriptor`, `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuPipelineLayout", feature = "GpuPipelineLayoutDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createPipelineLayout ) ] + #[doc = "The `createPipelineLayout()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createPipelineLayout)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuPipelineLayout`, `GpuPipelineLayoutDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all( + feature = "GpuRenderBundleEncoder", + feature = "GpuRenderBundleEncoderDescriptor", + ))] + # [ wasm_bindgen ( method , structural , js_name = createRenderBundleEncoder ) ] + #[doc = "The `createRenderBundleEncoder()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderBundleEncoder)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderBundleEncoder`, `GpuRenderBundleEncoderDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuRenderPipeline", feature = "GpuRenderPipelineDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createRenderPipeline ) ] + #[doc = "The `createRenderPipeline()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipeline)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderPipeline`, `GpuRenderPipelineDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuSampler")] + # [ wasm_bindgen ( method , structural , js_name = createSampler ) ] + #[doc = "The `createSampler()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createSampler)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuSampler`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuSampler", feature = "GpuSamplerDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createSampler ) ] + #[doc = "The `createSampler()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createSampler)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuSampler`, `GpuSamplerDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuShaderModule", feature = "GpuShaderModuleDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createShaderModule ) ] + #[doc = "The `createShaderModule()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createShaderModule)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuShaderModule`, `GpuShaderModuleDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuTexture", feature = "GpuTextureDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createTexture ) ] + #[doc = "The `createTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createTexture)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuTexture`, `GpuTextureDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = popErrorScope ) ] + #[doc = "The `popErrorScope()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/popErrorScope)\n\n*This API requires the following crate features to be activated: `GpuDevice`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(feature = "GpuErrorFilter")] + # [ wasm_bindgen ( method , structural , js_name = pushErrorScope ) ] + #[doc = "The `pushErrorScope()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/pushErrorScope)\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuErrorFilter`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs new file mode 100644 index 00000000000..9d476017312 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs @@ -0,0 +1,59 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUDeviceDescriptor ) ] + #[doc = "The `GpuDeviceDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + pub type GpuDeviceDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuDeviceDescriptor { + #[doc = "Construct a new `GpuDeviceDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + 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 `extensions` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + pub fn extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("extensions"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuLimits")] + #[doc = "Change the `limits` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuLimits`*"] + pub fn limits(&mut self, val: &GpuLimits) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("limits"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs new file mode 100644 index 00000000000..5e8f28dafcc --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs @@ -0,0 +1,16 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUDeviceLostInfo , typescript_name = GPUDeviceLostInfo ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuDeviceLostInfo` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo)\n\n*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + pub type GpuDeviceLostInfo; + # [ wasm_bindgen ( structural , method , getter , js_name = message ) ] + #[doc = "Getter for the `message` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo/message)\n\n*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuErrorFilter.rs b/crates/web-sys/src/features/gen_GpuErrorFilter.rs new file mode 100644 index 00000000000..928b51f5e43 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuErrorFilter.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuErrorFilter` enum.\n\n*This API requires the following crate features to be activated: `GpuErrorFilter`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuErrorFilter { + None = "none", + OutOfMemory = "out-of-memory", + Validation = "validation", +} diff --git a/crates/web-sys/src/features/gen_GpuExtensionName.rs b/crates/web-sys/src/features/gen_GpuExtensionName.rs new file mode 100644 index 00000000000..849135eab8c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuExtensionName.rs @@ -0,0 +1,9 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuExtensionName` enum.\n\n*This API requires the following crate features to be activated: `GpuExtensionName`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuExtensionName { + TextureCompressionBc = "texture-compression-bc", +} diff --git a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs new file mode 100644 index 00000000000..3af63da6d87 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs @@ -0,0 +1,57 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUExtent3DDict ) ] + #[doc = "The `GpuExtent3dDict` dictionary.\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + pub type GpuExtent3dDict; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuExtent3dDict { + #[doc = "Construct a new `GpuExtent3dDict`.\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + pub fn new(depth: u32, height: u32, width: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.depth(depth); + ret.height(height); + ret.width(width); + ret + } + #[doc = "Change the `depth` field of this object.\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + pub fn depth(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &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.\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + 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/crates/web-sys/src/features/gen_GpuFence.rs b/crates/web-sys/src/features/gen_GpuFence.rs new file mode 100644 index 00000000000..2adeb9d5e47 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuFence.rs @@ -0,0 +1,36 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUFence , typescript_name = GPUFence ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuFence` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + pub type GpuFence; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/label)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuFence) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/label)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuFence, value: Option<&str>); + # [ wasm_bindgen ( method , structural , js_name = getCompletedValue ) ] + #[doc = "The `getCompletedValue()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/getCompletedValue)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_completed_value(this: &GpuFence) -> f64; + # [ wasm_bindgen ( method , structural , js_name = onCompletion ) ] + #[doc = "The `onCompletion()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/onCompletion)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn on_completion_with_u32(this: &GpuFence, completion_value: u32) -> ::js_sys::Promise; + # [ wasm_bindgen ( method , structural , js_name = onCompletion ) ] + #[doc = "The `onCompletion()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/onCompletion)\n\n*This API requires the following crate features to be activated: `GpuFence`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn on_completion_with_f64(this: &GpuFence, completion_value: f64) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_GpuFenceDescriptor.rs b/crates/web-sys/src/features/gen_GpuFenceDescriptor.rs new file mode 100644 index 00000000000..add2ae18049 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuFenceDescriptor.rs @@ -0,0 +1,46 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUFenceDescriptor ) ] + #[doc = "The `GpuFenceDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + pub type GpuFenceDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuFenceDescriptor { + #[doc = "Construct a new `GpuFenceDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + 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 `initialValue` field of this object.\n\n*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + pub fn initial_value(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("initialValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuFilterMode.rs b/crates/web-sys/src/features/gen_GpuFilterMode.rs new file mode 100644 index 00000000000..d4ed885ea88 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuFilterMode.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuFilterMode` enum.\n\n*This API requires the following crate features to be activated: `GpuFilterMode`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuFilterMode { + Nearest = "nearest", + Linear = "linear", +} diff --git a/crates/web-sys/src/features/gen_GpuFrontFace.rs b/crates/web-sys/src/features/gen_GpuFrontFace.rs new file mode 100644 index 00000000000..5653b14a5eb --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuFrontFace.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuFrontFace` enum.\n\n*This API requires the following crate features to be activated: `GpuFrontFace`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuFrontFace { + Ccw = "ccw", + Cw = "cw", +} diff --git a/crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs b/crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs new file mode 100644 index 00000000000..e13252f089c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs @@ -0,0 +1,50 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUImageBitmapCopyView ) ] + #[doc = "The `GpuImageBitmapCopyView` dictionary.\n\n*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `ImageBitmap`*"] + pub type GpuImageBitmapCopyView; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuImageBitmapCopyView { + #[cfg(feature = "ImageBitmap")] + #[doc = "Construct a new `GpuImageBitmapCopyView`.\n\n*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `ImageBitmap`*"] + pub fn new(image_bitmap: &ImageBitmap) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.image_bitmap(image_bitmap); + ret + } + #[cfg(feature = "ImageBitmap")] + #[doc = "Change the `imageBitmap` field of this object.\n\n*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `ImageBitmap`*"] + pub fn image_bitmap(&mut self, val: &ImageBitmap) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("imageBitmap"), + &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.\n\n*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuIndexFormat.rs b/crates/web-sys/src/features/gen_GpuIndexFormat.rs new file mode 100644 index 00000000000..78e15763cc5 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuIndexFormat.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuIndexFormat` enum.\n\n*This API requires the following crate features to be activated: `GpuIndexFormat`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuIndexFormat { + Uint16 = "uint16", + Uint32 = "uint32", +} diff --git a/crates/web-sys/src/features/gen_GpuInputStepMode.rs b/crates/web-sys/src/features/gen_GpuInputStepMode.rs new file mode 100644 index 00000000000..02fe219c1ed --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuInputStepMode.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuInputStepMode` enum.\n\n*This API requires the following crate features to be activated: `GpuInputStepMode`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuInputStepMode { + Vertex = "vertex", + Instance = "instance", +} diff --git a/crates/web-sys/src/features/gen_GpuLimits.rs b/crates/web-sys/src/features/gen_GpuLimits.rs new file mode 100644 index 00000000000..0f9da557e17 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuLimits.rs @@ -0,0 +1,140 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPULimits ) ] + #[doc = "The `GpuLimits` dictionary.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub type GpuLimits; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuLimits { + #[doc = "Construct a new `GpuLimits`.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `maxBindGroups` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_bind_groups(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxBindGroups"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxDynamicStorageBuffersPerPipelineLayout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_dynamic_storage_buffers_per_pipeline_layout(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxDynamicStorageBuffersPerPipelineLayout"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxDynamicUniformBuffersPerPipelineLayout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_dynamic_uniform_buffers_per_pipeline_layout(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxDynamicUniformBuffersPerPipelineLayout"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxSampledTexturesPerShaderStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_sampled_textures_per_shader_stage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxSampledTexturesPerShaderStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxSamplersPerShaderStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_samplers_per_shader_stage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxSamplersPerShaderStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxStorageBuffersPerShaderStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_storage_buffers_per_shader_stage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxStorageBuffersPerShaderStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxStorageTexturesPerShaderStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_storage_textures_per_shader_stage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxStorageTexturesPerShaderStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `maxUniformBuffersPerShaderStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuLimits`*"] + pub fn max_uniform_buffers_per_shader_stage(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("maxUniformBuffersPerShaderStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuLoadOp.rs b/crates/web-sys/src/features/gen_GpuLoadOp.rs new file mode 100644 index 00000000000..bfc07194139 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuLoadOp.rs @@ -0,0 +1,9 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuLoadOp` enum.\n\n*This API requires the following crate features to be activated: `GpuLoadOp`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuLoadOp { + Load = "load", +} diff --git a/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs new file mode 100644 index 00000000000..5724a120976 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs @@ -0,0 +1,31 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUObjectDescriptorBase ) ] + #[doc = "The `GpuObjectDescriptorBase` dictionary.\n\n*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + pub type GpuObjectDescriptorBase; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuObjectDescriptorBase { + #[doc = "Construct a new `GpuObjectDescriptorBase`.\n\n*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs new file mode 100644 index 00000000000..9e0104275df --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs @@ -0,0 +1,42 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUOrigin2DDict ) ] + #[doc = "The `GpuOrigin2dDict` dictionary.\n\n*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + pub type GpuOrigin2dDict; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuOrigin2dDict { + #[doc = "Construct a new `GpuOrigin2dDict`.\n\n*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs new file mode 100644 index 00000000000..b037aa36752 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs @@ -0,0 +1,53 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUOrigin3DDict ) ] + #[doc = "The `GpuOrigin3dDict` dictionary.\n\n*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + pub type GpuOrigin3dDict; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuOrigin3dDict { + #[doc = "Construct a new `GpuOrigin3dDict`.\n\n*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs b/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs new file mode 100644 index 00000000000..61bbaa52a84 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs @@ -0,0 +1,11 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUOutOfMemoryError , typescript_name = GPUOutOfMemoryError ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuOutOfMemoryError` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUOutOfMemoryError)\n\n*This API requires the following crate features to be activated: `GpuOutOfMemoryError`*"] + pub type GpuOutOfMemoryError; +} diff --git a/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs new file mode 100644 index 00000000000..1eae09c8930 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs @@ -0,0 +1,46 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUPipelineDescriptorBase ) ] + #[doc = "The `GpuPipelineDescriptorBase` dictionary.\n\n*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`, `GpuPipelineLayout`*"] + pub type GpuPipelineDescriptorBase; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuPipelineDescriptorBase { + #[cfg(feature = "GpuPipelineLayout")] + #[doc = "Construct a new `GpuPipelineDescriptorBase`.\n\n*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`, `GpuPipelineLayout`*"] + pub fn new(layout: &GpuPipelineLayout) -> 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.\n\n*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + 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 + } + #[cfg(feature = "GpuPipelineLayout")] + #[doc = "Change the `layout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`, `GpuPipelineLayout`*"] + pub fn layout(&mut self, val: &GpuPipelineLayout) -> &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/crates/web-sys/src/features/gen_GpuPipelineLayout.rs b/crates/web-sys/src/features/gen_GpuPipelineLayout.rs new file mode 100644 index 00000000000..77b40f31b2c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineLayout.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUPipelineLayout , typescript_name = GPUPipelineLayout ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineLayout` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout)\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + pub type GpuPipelineLayout; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout/label)\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuPipelineLayout) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout/label)\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs new file mode 100644 index 00000000000..b7f1dc4d2bc --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs @@ -0,0 +1,47 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUPipelineLayoutDescriptor ) ] + #[doc = "The `GpuPipelineLayoutDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + pub type GpuPipelineLayoutDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuPipelineLayoutDescriptor { + #[doc = "Construct a new `GpuPipelineLayoutDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuPowerPreference.rs b/crates/web-sys/src/features/gen_GpuPowerPreference.rs new file mode 100644 index 00000000000..c921ace8e98 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPowerPreference.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuPowerPreference` enum.\n\n*This API requires the following crate features to be activated: `GpuPowerPreference`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuPowerPreference { + LowPower = "low-power", + HighPerformance = "high-performance", +} diff --git a/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs b/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs new file mode 100644 index 00000000000..bf0b87a32b7 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs @@ -0,0 +1,13 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuPrimitiveTopology` enum.\n\n*This API requires the following crate features to be activated: `GpuPrimitiveTopology`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuPrimitiveTopology { + PointList = "point-list", + LineList = "line-list", + LineStrip = "line-strip", + TriangleList = "triangle-list", + TriangleStrip = "triangle-strip", +} diff --git a/crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs b/crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs new file mode 100644 index 00000000000..6c95d16fb5c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs @@ -0,0 +1,51 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUProgrammableStageDescriptor ) ] + #[doc = "The `GpuProgrammableStageDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuShaderModule`*"] + pub type GpuProgrammableStageDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuProgrammableStageDescriptor { + #[cfg(feature = "GpuShaderModule")] + #[doc = "Construct a new `GpuProgrammableStageDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuShaderModule`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`*"] + 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 + } + #[cfg(feature = "GpuShaderModule")] + #[doc = "Change the `module` field of this object.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuShaderModule`*"] + 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/crates/web-sys/src/features/gen_GpuQueue.rs b/crates/web-sys/src/features/gen_GpuQueue.rs new file mode 100644 index 00000000000..0402b948b3f --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuQueue.rs @@ -0,0 +1,79 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUQueue , typescript_name = GPUQueue ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuQueue` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue)\n\n*This API requires the following crate features to be activated: `GpuQueue`*"] + pub type GpuQueue; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/label)\n\n*This API requires the following crate features to be activated: `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuQueue) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/label)\n\n*This API requires the following crate features to be activated: `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + #[cfg(all(feature = "GpuImageBitmapCopyView", feature = "GpuTextureCopyView",))] + # [ wasm_bindgen ( method , structural , js_name = copyImageBitmapToTexture ) ] + #[doc = "The `copyImageBitmapToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyImageBitmapToTexture)\n\n*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `GpuQueue`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_image_bitmap_to_texture_with_u32_sequence( + this: &GpuQueue, + source: &GpuImageBitmapCopyView, + destination: &GpuTextureCopyView, + copy_size: &::wasm_bindgen::JsValue, + ); + #[cfg(all( + feature = "GpuExtent3dDict", + feature = "GpuImageBitmapCopyView", + feature = "GpuTextureCopyView", + ))] + # [ wasm_bindgen ( method , structural , js_name = copyImageBitmapToTexture ) ] + #[doc = "The `copyImageBitmapToTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyImageBitmapToTexture)\n\n*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageBitmapCopyView`, `GpuQueue`, `GpuTextureCopyView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_image_bitmap_to_texture_with_gpu_extent_3d_dict( + this: &GpuQueue, + source: &GpuImageBitmapCopyView, + destination: &GpuTextureCopyView, + copy_size: &GpuExtent3dDict, + ); + #[cfg(feature = "GpuFence")] + # [ wasm_bindgen ( method , structural , js_name = createFence ) ] + #[doc = "The `createFence()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/createFence)\n\n*This API requires the following crate features to be activated: `GpuFence`, `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_fence(this: &GpuQueue) -> GpuFence; + #[cfg(all(feature = "GpuFence", feature = "GpuFenceDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createFence ) ] + #[doc = "The `createFence()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/createFence)\n\n*This API requires the following crate features to be activated: `GpuFence`, `GpuFenceDescriptor`, `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_fence_with_descriptor( + this: &GpuQueue, + descriptor: &GpuFenceDescriptor, + ) -> GpuFence; + #[cfg(feature = "GpuFence")] + # [ wasm_bindgen ( method , structural , js_name = signal ) ] + #[doc = "The `signal()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/signal)\n\n*This API requires the following crate features to be activated: `GpuFence`, `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn signal_with_u32(this: &GpuQueue, fence: &GpuFence, signal_value: u32); + #[cfg(feature = "GpuFence")] + # [ wasm_bindgen ( method , structural , js_name = signal ) ] + #[doc = "The `signal()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/signal)\n\n*This API requires the following crate features to be activated: `GpuFence`, `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn signal_with_f64(this: &GpuQueue, fence: &GpuFence, signal_value: f64); + # [ wasm_bindgen ( method , structural , js_name = submit ) ] + #[doc = "The `submit()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/submit)\n\n*This API requires the following crate features to be activated: `GpuQueue`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); +} diff --git a/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs new file mode 100644 index 00000000000..92b29dfaeb0 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs @@ -0,0 +1,97 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURasterizationStateDescriptor ) ] + #[doc = "The `GpuRasterizationStateDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] + pub type GpuRasterizationStateDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRasterizationStateDescriptor { + #[doc = "Construct a new `GpuRasterizationStateDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "GpuCullMode")] + #[doc = "Change the `cullMode` field of this object.\n\n*This API requires the following crate features to be activated: `GpuCullMode`, `GpuRasterizationStateDescriptor`*"] + 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 `depthBias` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] + 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 + } + #[cfg(feature = "GpuFrontFace")] + #[doc = "Change the `frontFace` field of this object.\n\n*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuRasterizationStateDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderBundle.rs b/crates/web-sys/src/features/gen_GpuRenderBundle.rs new file mode 100644 index 00000000000..79a3e22df86 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderBundle.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderBundle , typescript_name = GPURenderBundle ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundle` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle)\n\n*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + pub type GpuRenderBundle; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle/label)\n\n*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderBundle) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle/label)\n\n*This API requires the following crate features to be activated: `GpuRenderBundle`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs new file mode 100644 index 00000000000..ff1b2c30501 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs @@ -0,0 +1,31 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderBundleDescriptor ) ] + #[doc = "The `GpuRenderBundleDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + pub type GpuRenderBundleDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderBundleDescriptor { + #[doc = "Construct a new `GpuRenderBundleDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs new file mode 100644 index 00000000000..534363aa779 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs @@ -0,0 +1,217 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderBundleEncoder , typescript_name = GPURenderBundleEncoder ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderBundleEncoder` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + pub type GpuRenderBundleEncoder; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderBundleEncoder) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + #[cfg(feature = "GpuRenderBundle")] + # [ wasm_bindgen ( method , structural , js_name = finish ) ] + #[doc = "The `finish()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/finish)\n\n*This API requires the following crate features to be activated: `GpuRenderBundle`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finish(this: &GpuRenderBundleEncoder) -> GpuRenderBundle; + #[cfg(all(feature = "GpuRenderBundle", feature = "GpuRenderBundleDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = finish ) ] + #[doc = "The `finish()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/finish)\n\n*This API requires the following crate features to be activated: `GpuRenderBundle`, `GpuRenderBundleDescriptor`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = insertDebugMarker ) ] + #[doc = "The `insertDebugMarker()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/insertDebugMarker)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = popDebugGroup ) ] + #[doc = "The `popDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/popDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = pushDebugGroup ) ] + #[doc = "The `pushDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/pushDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); + # [ wasm_bindgen ( method , structural , js_name = draw ) ] + #[doc = "The `draw()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/draw)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + instance_count: u32, + first_vertex: u32, + first_instance: u32, + ); + # [ wasm_bindgen ( method , structural , js_name = drawIndexed ) ] + #[doc = "The `drawIndexed()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexed)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + instance_count: u32, + first_index: u32, + base_vertex: i32, + first_instance: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndexedIndirect ) ] + #[doc = "The `drawIndexedIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexedIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndexedIndirect ) ] + #[doc = "The `drawIndexedIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndexedIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndirect ) ] + #[doc = "The `drawIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndirect ) ] + #[doc = "The `drawIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/drawIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + offset: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + offset: f64, + ); + #[cfg(feature = "GpuRenderPipeline")] + # [ wasm_bindgen ( method , structural , js_name = setPipeline ) ] + #[doc = "The `setPipeline()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setPipeline)\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`, `GpuRenderPipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer, + offset: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer, + offset: f64, + ); +} diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs new file mode 100644 index 00000000000..50ee8a06254 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs @@ -0,0 +1,78 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderBundleEncoderDescriptor ) ] + #[doc = "The `GpuRenderBundleEncoderDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + pub type GpuRenderBundleEncoderDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderBundleEncoderDescriptor { + #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `depthStencilFormat` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs new file mode 100644 index 00000000000..0d338477d63 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs @@ -0,0 +1,86 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPassColorAttachmentDescriptor ) ] + #[doc = "The `GpuRenderPassColorAttachmentDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + pub type GpuRenderPassColorAttachmentDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderPassColorAttachmentDescriptor { + #[cfg(feature = "GpuTextureView")] + #[doc = "Construct a new `GpuRenderPassColorAttachmentDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + pub fn new(attachment: &GpuTextureView, load_value: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.attachment(attachment); + ret.load_value(load_value); + ret + } + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `attachment` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + pub fn attachment(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("attachment"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `loadValue` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`*"] + pub fn load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("loadValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `resolveTarget` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + 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 + } + #[cfg(feature = "GpuStoreOp")] + #[doc = "Change the `storeOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuStoreOp`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs new file mode 100644 index 00000000000..fa3dbe26783 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs @@ -0,0 +1,110 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPassDepthStencilAttachmentDescriptor ) ] + #[doc = "The `GpuRenderPassDepthStencilAttachmentDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`, `GpuTextureView`*"] + pub type GpuRenderPassDepthStencilAttachmentDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderPassDepthStencilAttachmentDescriptor { + #[cfg(all(feature = "GpuStoreOp", feature = "GpuTextureView",))] + #[doc = "Construct a new `GpuRenderPassDepthStencilAttachmentDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`, `GpuTextureView`*"] + pub fn new( + attachment: &GpuTextureView, + depth_load_value: &::wasm_bindgen::JsValue, + depth_store_op: GpuStoreOp, + stencil_load_value: &::wasm_bindgen::JsValue, + stencil_store_op: GpuStoreOp, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.attachment(attachment); + ret.depth_load_value(depth_load_value); + ret.depth_store_op(depth_store_op); + ret.stencil_load_value(stencil_load_value); + ret.stencil_store_op(stencil_store_op); + ret + } + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `attachment` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuTextureView`*"] + pub fn attachment(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("attachment"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `depthLoadValue` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + pub fn depth_load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthLoadValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuStoreOp")] + #[doc = "Change the `depthStoreOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`*"] + 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 `stencilLoadValue` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + pub fn stencil_load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stencilLoadValue"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuStoreOp")] + #[doc = "Change the `stencilStoreOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs new file mode 100644 index 00000000000..00f9669c0b5 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs @@ -0,0 +1,66 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPassDescriptor ) ] + #[doc = "The `GpuRenderPassDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + pub type GpuRenderPassDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderPassDescriptor { + #[doc = "Construct a new `GpuRenderPassDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + 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 + } + #[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] + #[doc = "Change the `depthStencilAttachment` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuRenderPassDescriptor`*"] + pub fn depth_stencil_attachment( + &mut self, + val: &GpuRenderPassDepthStencilAttachmentDescriptor, + ) -> &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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs new file mode 100644 index 00000000000..741374e38b3 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs @@ -0,0 +1,241 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPassEncoder , typescript_name = GPURenderPassEncoder ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassEncoder` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + pub type GpuRenderPassEncoder; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderPassEncoder) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/label)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + # [ wasm_bindgen ( method , structural , js_name = endPass ) ] + #[doc = "The `endPass()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/endPass)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn end_pass(this: &GpuRenderPassEncoder); + # [ wasm_bindgen ( method , structural , js_name = executeBundles ) ] + #[doc = "The `executeBundles()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/executeBundles)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = setBlendColor ) ] + #[doc = "The `setBlendColor()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendColor)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_blend_color_with_f64_sequence( + this: &GpuRenderPassEncoder, + color: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "GpuColorDict")] + # [ wasm_bindgen ( method , structural , js_name = setBlendColor ) ] + #[doc = "The `setBlendColor()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendColor)\n\n*This API requires the following crate features to be activated: `GpuColorDict`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_blend_color_with_gpu_color_dict(this: &GpuRenderPassEncoder, color: &GpuColorDict); + # [ wasm_bindgen ( method , structural , js_name = setScissorRect ) ] + #[doc = "The `setScissorRect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setScissorRect)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = setStencilReference ) ] + #[doc = "The `setStencilReference()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setStencilReference)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = setViewport ) ] + #[doc = "The `setViewport()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setViewport)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = insertDebugMarker ) ] + #[doc = "The `insertDebugMarker()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/insertDebugMarker)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = popDebugGroup ) ] + #[doc = "The `popDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/popDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = pushDebugGroup ) ] + #[doc = "The `pushDebugGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/pushDebugGroup)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ); + #[cfg(feature = "GpuBindGroup")] + # [ wasm_bindgen ( method , structural , js_name = setBindGroup ) ] + #[doc = "The `setBindGroup()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)\n\n*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBindGroup, + dynamic_offsets_data: &mut [u32], + dynamic_offsets_data_start: f64, + dynamic_offsets_data_length: u32, + ); + # [ wasm_bindgen ( method , structural , js_name = draw ) ] + #[doc = "The `draw()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/draw)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + instance_count: u32, + first_vertex: u32, + first_instance: u32, + ); + # [ wasm_bindgen ( method , structural , js_name = drawIndexed ) ] + #[doc = "The `drawIndexed()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexed)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + instance_count: u32, + first_index: u32, + base_vertex: i32, + first_instance: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndexedIndirect ) ] + #[doc = "The `drawIndexedIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexedIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndexedIndirect ) ] + #[doc = "The `drawIndexedIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndexedIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndirect ) ] + #[doc = "The `drawIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = drawIndirect ) ] + #[doc = "The `drawIndirect()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/drawIndirect)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, offset: u32); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setIndexBuffer ) ] + #[doc = "The `setIndexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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, offset: f64); + #[cfg(feature = "GpuRenderPipeline")] + # [ wasm_bindgen ( method , structural , js_name = setPipeline ) ] + #[doc = "The `setPipeline()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setPipeline)\n\n*This API requires the following crate features to be activated: `GpuRenderPassEncoder`, `GpuRenderPipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer, + offset: u32, + ); + #[cfg(feature = "GpuBuffer")] + # [ wasm_bindgen ( method , structural , js_name = setVertexBuffer ) ] + #[doc = "The `setVertexBuffer()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setVertexBuffer)\n\n*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: &GpuBuffer, + offset: f64, + ); +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPipeline.rs b/crates/web-sys/src/features/gen_GpuRenderPipeline.rs new file mode 100644 index 00000000000..8752f9ce053 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPipeline.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPipeline , typescript_name = GPURenderPipeline ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPipeline` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline)\n\n*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + pub type GpuRenderPipeline; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline/label)\n\n*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuRenderPipeline) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline/label)\n\n*This API requires the following crate features to be activated: `GpuRenderPipeline`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs new file mode 100644 index 00000000000..a1b871fef21 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs @@ -0,0 +1,214 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURenderPipelineDescriptor ) ] + #[doc = "The `GpuRenderPipelineDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuPrimitiveTopology`, `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub type GpuRenderPipelineDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRenderPipelineDescriptor { + #[cfg(all( + feature = "GpuPipelineLayout", + feature = "GpuPrimitiveTopology", + feature = "GpuProgrammableStageDescriptor", + ))] + #[doc = "Construct a new `GpuRenderPipelineDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuPrimitiveTopology`, `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub fn new( + layout: &GpuPipelineLayout, + color_states: &::wasm_bindgen::JsValue, + primitive_topology: GpuPrimitiveTopology, + vertex_stage: &GpuProgrammableStageDescriptor, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.layout(layout); + ret.color_states(color_states); + ret.primitive_topology(primitive_topology); + ret.vertex_stage(vertex_stage); + ret + } + #[doc = "Change the `label` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + 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 + } + #[cfg(feature = "GpuPipelineLayout")] + #[doc = "Change the `layout` field of this object.\n\n*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`*"] + pub fn layout(&mut self, val: &GpuPipelineLayout) -> &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 `alphaToCoverageEnabled` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + 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 `colorStates` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + pub fn color_states(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("colorStates"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuDepthStencilStateDescriptor")] + #[doc = "Change the `depthStencilState` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub fn depth_stencil_state(&mut self, val: &GpuDepthStencilStateDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthStencilState"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuProgrammableStageDescriptor")] + #[doc = "Change the `fragmentStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub fn fragment_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("fragmentStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuPrimitiveTopology")] + #[doc = "Change the `primitiveTopology` field of this object.\n\n*This API requires the following crate features to be activated: `GpuPrimitiveTopology`, `GpuRenderPipelineDescriptor`*"] + pub fn primitive_topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("primitiveTopology"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuRasterizationStateDescriptor")] + #[doc = "Change the `rasterizationState` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub fn rasterization_state(&mut self, val: &GpuRasterizationStateDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("rasterizationState"), + &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.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + 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 `sampleMask` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + pub fn sample_mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampleMask"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuProgrammableStageDescriptor")] + #[doc = "Change the `vertexStage` field of this object.\n\n*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + pub fn vertex_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("vertexStage"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "GpuVertexStateDescriptor")] + #[doc = "Change the `vertexState` field of this object.\n\n*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexStateDescriptor`*"] + pub fn vertex_state(&mut self, val: &GpuVertexStateDescriptor) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("vertexState"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs new file mode 100644 index 00000000000..3d7ca42f692 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs @@ -0,0 +1,36 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPURequestAdapterOptions ) ] + #[doc = "The `GpuRequestAdapterOptions` dictionary.\n\n*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + pub type GpuRequestAdapterOptions; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuRequestAdapterOptions { + #[doc = "Construct a new `GpuRequestAdapterOptions`.\n\n*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "GpuPowerPreference")] + #[doc = "Change the `powerPreference` field of this object.\n\n*This API requires the following crate features to be activated: `GpuPowerPreference`, `GpuRequestAdapterOptions`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuSampler.rs b/crates/web-sys/src/features/gen_GpuSampler.rs new file mode 100644 index 00000000000..3406f038426 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuSampler.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUSampler , typescript_name = GPUSampler ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSampler` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler)\n\n*This API requires the following crate features to be activated: `GpuSampler`*"] + pub type GpuSampler; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler/label)\n\n*This API requires the following crate features to be activated: `GpuSampler`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuSampler) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler/label)\n\n*This API requires the following crate features to be activated: `GpuSampler`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs new file mode 100644 index 00000000000..0138c3ab621 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs @@ -0,0 +1,173 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUSamplerDescriptor ) ] + #[doc = "The `GpuSamplerDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + pub type GpuSamplerDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuSamplerDescriptor { + #[doc = "Construct a new `GpuSamplerDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuAddressMode")] + #[doc = "Change the `addressModeU` field of this object.\n\n*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuAddressMode")] + #[doc = "Change the `addressModeV` field of this object.\n\n*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuAddressMode")] + #[doc = "Change the `addressModeW` field of this object.\n\n*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Change the `compare` field of this object.\n\n*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuFilterMode")] + #[doc = "Change the `magFilter` field of this object.\n\n*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuFilterMode")] + #[doc = "Change the `minFilter` field of this object.\n\n*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + 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 + } + #[cfg(feature = "GpuFilterMode")] + #[doc = "Change the `mipmapFilter` field of this object.\n\n*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + pub fn mipmap_filter(&mut self, val: GpuFilterMode) -> &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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuShaderModule.rs b/crates/web-sys/src/features/gen_GpuShaderModule.rs new file mode 100644 index 00000000000..e89be89aa68 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuShaderModule.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUShaderModule , typescript_name = GPUShaderModule ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuShaderModule` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule)\n\n*This API requires the following crate features to be activated: `GpuShaderModule`*"] + pub type GpuShaderModule; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/label)\n\n*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuShaderModule) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/label)\n\n*This API requires the following crate features to be activated: `GpuShaderModule`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs new file mode 100644 index 00000000000..e0a41af628a --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs @@ -0,0 +1,43 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUShaderModuleDescriptor ) ] + #[doc = "The `GpuShaderModuleDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + pub type GpuShaderModuleDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuShaderModuleDescriptor { + #[doc = "Construct a new `GpuShaderModuleDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + pub fn new(code: &::wasm_bindgen::JsValue) -> 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.\n\n*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + pub fn code(&mut self, val: &::wasm_bindgen::JsValue) -> &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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuShaderStage.rs b/crates/web-sys/src/features/gen_GpuShaderStage.rs new file mode 100644 index 00000000000..f09acf7dd58 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuShaderStage.rs @@ -0,0 +1,24 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUShaderStage , typescript_name = GPUShaderStage ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuShaderStage` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderStage)\n\n*This API requires the following crate features to be activated: `GpuShaderStage`*"] + pub type GpuShaderStage; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuShaderStage { + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const VERTEX: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const FRAGMENT: u32 = 2u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COMPUTE: u32 = 4u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_GpuStencilOperation.rs b/crates/web-sys/src/features/gen_GpuStencilOperation.rs new file mode 100644 index 00000000000..cd7c82db8c8 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuStencilOperation.rs @@ -0,0 +1,16 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuStencilOperation` enum.\n\n*This API requires the following crate features to be activated: `GpuStencilOperation`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +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/crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs b/crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs new file mode 100644 index 00000000000..4d0fa47c49e --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs @@ -0,0 +1,78 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUStencilStateFaceDescriptor ) ] + #[doc = "The `GpuStencilStateFaceDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuStencilStateFaceDescriptor`*"] + pub type GpuStencilStateFaceDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuStencilStateFaceDescriptor { + #[doc = "Construct a new `GpuStencilStateFaceDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuStencilStateFaceDescriptor`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Change the `compare` field of this object.\n\n*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilStateFaceDescriptor`*"] + 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 + } + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Change the `depthFailOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + 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 + } + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Change the `failOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + 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 + } + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Change the `passOp` field of this object.\n\n*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuStoreOp.rs b/crates/web-sys/src/features/gen_GpuStoreOp.rs new file mode 100644 index 00000000000..53380efd316 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuStoreOp.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuStoreOp` enum.\n\n*This API requires the following crate features to be activated: `GpuStoreOp`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuStoreOp { + Store = "store", + Clear = "clear", +} diff --git a/crates/web-sys/src/features/gen_GpuSwapChain.rs b/crates/web-sys/src/features/gen_GpuSwapChain.rs new file mode 100644 index 00000000000..5befb06e385 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuSwapChain.rs @@ -0,0 +1,27 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUSwapChain , typescript_name = GPUSwapChain ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuSwapChain` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSwapChain)\n\n*This API requires the following crate features to be activated: `GpuSwapChain`*"] + pub type GpuSwapChain; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSwapChain/label)\n\n*This API requires the following crate features to be activated: `GpuSwapChain`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuSwapChain) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSwapChain/label)\n\n*This API requires the following crate features to be activated: `GpuSwapChain`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_label(this: &GpuSwapChain, value: Option<&str>); + #[cfg(feature = "GpuTexture")] + # [ wasm_bindgen ( method , structural , js_name = getCurrentTexture ) ] + #[doc = "The `getCurrentTexture()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSwapChain/getCurrentTexture)\n\n*This API requires the following crate features to be activated: `GpuSwapChain`, `GpuTexture`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_current_texture(this: &GpuSwapChain) -> GpuTexture; +} diff --git a/crates/web-sys/src/features/gen_GpuSwapChainDescriptor.rs b/crates/web-sys/src/features/gen_GpuSwapChainDescriptor.rs new file mode 100644 index 00000000000..7b9a2084933 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuSwapChainDescriptor.rs @@ -0,0 +1,71 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUSwapChainDescriptor ) ] + #[doc = "The `GpuSwapChainDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuSwapChainDescriptor`, `GpuTextureFormat`*"] + pub type GpuSwapChainDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuSwapChainDescriptor { + #[cfg(all(feature = "GpuDevice", feature = "GpuTextureFormat",))] + #[doc = "Construct a new `GpuSwapChainDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuSwapChainDescriptor`, `GpuTextureFormat`*"] + 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 `label` field of this object.\n\n*This API requires the following crate features to be activated: `GpuSwapChainDescriptor`*"] + 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 + } + #[cfg(feature = "GpuDevice")] + #[doc = "Change the `device` field of this object.\n\n*This API requires the following crate features to be activated: `GpuDevice`, `GpuSwapChainDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuSwapChainDescriptor`, `GpuTextureFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuSwapChainDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuTexture.rs b/crates/web-sys/src/features/gen_GpuTexture.rs new file mode 100644 index 00000000000..0236a71fa46 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTexture.rs @@ -0,0 +1,41 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTexture , typescript_name = GPUTexture ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTexture` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture)\n\n*This API requires the following crate features to be activated: `GpuTexture`*"] + pub type GpuTexture; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/label)\n\n*This API requires the following crate features to be activated: `GpuTexture`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuTexture) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/label)\n\n*This API requires the following crate features to be activated: `GpuTexture`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); + #[cfg(feature = "GpuTextureView")] + # [ wasm_bindgen ( method , structural , js_name = createView ) ] + #[doc = "The `createView()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)\n\n*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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; + #[cfg(all(feature = "GpuTextureView", feature = "GpuTextureViewDescriptor",))] + # [ wasm_bindgen ( method , structural , js_name = createView ) ] + #[doc = "The `createView()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)\n\n*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureView`, `GpuTextureViewDescriptor`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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_name = destroy ) ] + #[doc = "The `destroy()` method.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/destroy)\n\n*This API requires the following crate features to be activated: `GpuTexture`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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/crates/web-sys/src/features/gen_GpuTextureAspect.rs b/crates/web-sys/src/features/gen_GpuTextureAspect.rs new file mode 100644 index 00000000000..60edccdef5f --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureAspect.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuTextureAspect` enum.\n\n*This API requires the following crate features to be activated: `GpuTextureAspect`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuTextureAspect { + All = "all", + StencilOnly = "stencil-only", + DepthOnly = "depth-only", +} diff --git a/crates/web-sys/src/features/gen_GpuTextureComponentType.rs b/crates/web-sys/src/features/gen_GpuTextureComponentType.rs new file mode 100644 index 00000000000..19fb03a42d4 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureComponentType.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuTextureComponentType` enum.\n\n*This API requires the following crate features to be activated: `GpuTextureComponentType`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuTextureComponentType { + Float = "float", + Sint = "sint", + Uint = "uint", +} diff --git a/crates/web-sys/src/features/gen_GpuTextureCopyView.rs b/crates/web-sys/src/features/gen_GpuTextureCopyView.rs new file mode 100644 index 00000000000..08c3d06e7cc --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureCopyView.rs @@ -0,0 +1,80 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTextureCopyView ) ] + #[doc = "The `GpuTextureCopyView` dictionary.\n\n*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureCopyView`*"] + pub type GpuTextureCopyView; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuTextureCopyView { + #[cfg(feature = "GpuTexture")] + #[doc = "Construct a new `GpuTextureCopyView`.\n\n*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureCopyView`*"] + 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 `arrayLayer` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureCopyView`*"] + pub fn array_layer(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("arrayLayer"), + &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.\n\n*This API requires the following crate features to be activated: `GpuTextureCopyView`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureCopyView`*"] + 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 + } + #[cfg(feature = "GpuTexture")] + #[doc = "Change the `texture` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureCopyView`*"] + 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/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs new file mode 100644 index 00000000000..fa2dc128e7b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs @@ -0,0 +1,131 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTextureDescriptor ) ] + #[doc = "The `GpuTextureDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + pub type GpuTextureDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuTextureDescriptor { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuTextureDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureDimension")] + #[doc = "Change the `dimension` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"] + 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 + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuTextureDimension.rs b/crates/web-sys/src/features/gen_GpuTextureDimension.rs new file mode 100644 index 00000000000..7e559c1d07f --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureDimension.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuTextureDimension` enum.\n\n*This API requires the following crate features to be activated: `GpuTextureDimension`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuTextureDimension { + N1d = "1d", + N2d = "2d", + N3d = "3d", +} diff --git a/crates/web-sys/src/features/gen_GpuTextureFormat.rs b/crates/web-sys/src/features/gen_GpuTextureFormat.rs new file mode 100644 index 00000000000..23ae894e34e --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureFormat.rs @@ -0,0 +1,46 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuTextureFormat` enum.\n\n*This API requires the following crate features to be activated: `GpuTextureFormat`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +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", + Rgb10a2unorm = "rgb10a2unorm", + Rg11b10float = "rg11b10float", + Rg32uint = "rg32uint", + Rg32sint = "rg32sint", + Rg32float = "rg32float", + Rgba16uint = "rgba16uint", + Rgba16sint = "rgba16sint", + Rgba16float = "rgba16float", + Rgba32uint = "rgba32uint", + Rgba32sint = "rgba32sint", + Rgba32float = "rgba32float", + Depth32float = "depth32float", + Depth24plus = "depth24plus", + Depth24plusStencil8 = "depth24plus-stencil8", +} diff --git a/crates/web-sys/src/features/gen_GpuTextureUsage.rs b/crates/web-sys/src/features/gen_GpuTextureUsage.rs new file mode 100644 index 00000000000..fb7a324fcca --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureUsage.rs @@ -0,0 +1,30 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTextureUsage , typescript_name = GPUTextureUsage ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureUsage` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureUsage)\n\n*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + pub type GpuTextureUsage; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuTextureUsage { + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COPY_SRC: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COPY_DST: u32 = 2u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const SAMPLED: u32 = 4u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const STORAGE: u32 = 8u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const OUTPUT_ATTACHMENT: u32 = 16u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_GpuTextureView.rs b/crates/web-sys/src/features/gen_GpuTextureView.rs new file mode 100644 index 00000000000..59ead35e078 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureView.rs @@ -0,0 +1,21 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTextureView , typescript_name = GPUTextureView ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureView` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView)\n\n*This API requires the following crate features to be activated: `GpuTextureView`*"] + pub type GpuTextureView; + # [ wasm_bindgen ( structural , method , getter , js_name = label ) ] + #[doc = "Getter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView/label)\n\n*This API requires the following crate features to be activated: `GpuTextureView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn label(this: &GpuTextureView) -> Option; + # [ wasm_bindgen ( structural , method , setter , js_name = label ) ] + #[doc = "Setter for the `label` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView/label)\n\n*This API requires the following crate features to be activated: `GpuTextureView`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [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: Option<&str>); +} diff --git a/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs new file mode 100644 index 00000000000..d9a49e6175c --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs @@ -0,0 +1,133 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUTextureViewDescriptor ) ] + #[doc = "The `GpuTextureViewDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + pub type GpuTextureViewDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuTextureViewDescriptor { + #[doc = "Construct a new `GpuTextureViewDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureAspect")] + #[doc = "Change the `aspect` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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 + } + #[cfg(feature = "GpuTextureViewDimension")] + #[doc = "Change the `dimension` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"] + 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 + } + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + 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 + } +} diff --git a/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs b/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs new file mode 100644 index 00000000000..bdc46cd34fb --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs @@ -0,0 +1,14 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuTextureViewDimension` enum.\n\n*This API requires the following crate features to be activated: `GpuTextureViewDimension`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuTextureViewDimension { + N1d = "1d", + N2d = "2d", + N2dArray = "2d-array", + Cube = "cube", + CubeArray = "cube-array", + N3d = "3d", +} diff --git a/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs b/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs new file mode 100644 index 00000000000..0b5dcbb7d3b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs @@ -0,0 +1,16 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = GPUUncapturedErrorEvent , typescript_name = GPUUncapturedErrorEvent ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuUncapturedErrorEvent` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent)\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`*"] + pub type GpuUncapturedErrorEvent; + # [ wasm_bindgen ( structural , method , getter , js_name = error ) ] + #[doc = "Getter for the `error` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent/error)\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn error(this: &GpuUncapturedErrorEvent) -> ::js_sys::Object; +} diff --git a/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs new file mode 100644 index 00000000000..05da5ab5220 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs @@ -0,0 +1,77 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUUncapturedErrorEventInit ) ] + #[doc = "The `GpuUncapturedErrorEventInit` dictionary.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + pub type GpuUncapturedErrorEventInit; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuUncapturedErrorEventInit { + #[doc = "Construct a new `GpuUncapturedErrorEventInit`.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + pub fn new(error: &::js_sys::Object) -> 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.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + pub fn error(&mut self, val: &::js_sys::Object) -> &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/crates/web-sys/src/features/gen_GpuValidationError.rs b/crates/web-sys/src/features/gen_GpuValidationError.rs new file mode 100644 index 00000000000..29a3b2f827b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuValidationError.rs @@ -0,0 +1,16 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUValidationError , typescript_name = GPUValidationError ) ] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuValidationError` class.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError)\n\n*This API requires the following crate features to be activated: `GpuValidationError`*"] + pub type GpuValidationError; + # [ wasm_bindgen ( structural , method , getter , js_name = message ) ] + #[doc = "Getter for the `message` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError/message)\n\n*This API requires the following crate features to be activated: `GpuValidationError`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn message(this: &GpuValidationError) -> String; +} diff --git a/crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs b/crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs new file mode 100644 index 00000000000..a6c90d35041 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs @@ -0,0 +1,64 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUVertexAttributeDescriptor ) ] + #[doc = "The `GpuVertexAttributeDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`, `GpuVertexFormat`*"] + pub type GpuVertexAttributeDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuVertexAttributeDescriptor { + #[cfg(feature = "GpuVertexFormat")] + #[doc = "Construct a new `GpuVertexAttributeDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`, `GpuVertexFormat`*"] + 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 + } + #[cfg(feature = "GpuVertexFormat")] + #[doc = "Change the `format` field of this object.\n\n*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`, `GpuVertexFormat`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`*"] + 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/crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs new file mode 100644 index 00000000000..4868417e6bf --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs @@ -0,0 +1,68 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUVertexBufferLayoutDescriptor ) ] + #[doc = "The `GpuVertexBufferLayoutDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + pub type GpuVertexBufferLayoutDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuVertexBufferLayoutDescriptor { + #[doc = "Construct a new `GpuVertexBufferLayoutDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + 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.\n\n*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + 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 + } + #[cfg(feature = "GpuInputStepMode")] + #[doc = "Change the `stepMode` field of this object.\n\n*This API requires the following crate features to be activated: `GpuInputStepMode`, `GpuVertexBufferLayoutDescriptor`*"] + pub fn step_mode(&mut self, val: GpuInputStepMode) -> &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/crates/web-sys/src/features/gen_GpuVertexFormat.rs b/crates/web-sys/src/features/gen_GpuVertexFormat.rs new file mode 100644 index 00000000000..10725dcdf9b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuVertexFormat.rs @@ -0,0 +1,38 @@ +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `GpuVertexFormat` enum.\n\n*This API requires the following crate features to be activated: `GpuVertexFormat`*"] +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum GpuVertexFormat { + Uchar2 = "uchar2", + Uchar4 = "uchar4", + Char2 = "char2", + Char4 = "char4", + Uchar2norm = "uchar2norm", + Uchar4norm = "uchar4norm", + Char2norm = "char2norm", + Char4norm = "char4norm", + Ushort2 = "ushort2", + Ushort4 = "ushort4", + Short2 = "short2", + Short4 = "short4", + Ushort2norm = "ushort2norm", + Ushort4norm = "ushort4norm", + Short2norm = "short2norm", + Short4norm = "short4norm", + Half2 = "half2", + Half4 = "half4", + Float = "float", + Float2 = "float2", + Float3 = "float3", + Float4 = "float4", + Uint = "uint", + Uint2 = "uint2", + Uint3 = "uint3", + Uint4 = "uint4", + Int = "int", + Int2 = "int2", + Int3 = "int3", + Int4 = "int4", +} diff --git a/crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs new file mode 100644 index 00000000000..99f6fa73f6a --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs @@ -0,0 +1,51 @@ +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[wasm_bindgen] +extern "C" { + # [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUVertexStateDescriptor ) ] + #[doc = "The `GpuVertexStateDescriptor` dictionary.\n\n*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] + pub type GpuVertexStateDescriptor; +} +#[cfg(web_sys_unstable_apis)] +#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +impl GpuVertexStateDescriptor { + #[doc = "Construct a new `GpuVertexStateDescriptor`.\n\n*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "GpuIndexFormat")] + #[doc = "Change the `indexFormat` field of this object.\n\n*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuVertexStateDescriptor`*"] + pub fn index_format(&mut self, val: GpuIndexFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("indexFormat"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `vertexBuffers` field of this object.\n\n*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] + pub fn vertex_buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("vertexBuffers"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_Navigator.rs b/crates/web-sys/src/features/gen_Navigator.rs index 2cf3aad40ca..45d57256657 100644 --- a/crates/web-sys/src/features/gen_Navigator.rs +++ b/crates/web-sys/src/features/gen_Navigator.rs @@ -51,6 +51,12 @@ extern "C" { #[cfg(feature = "CredentialsContainer")] #[doc = "Getter for the `credentials` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/credentials)\n\n*This API requires the following crate features to be activated: `CredentialsContainer`, `Navigator`*"] pub fn credentials(this: &Navigator) -> CredentialsContainer; + # [ wasm_bindgen ( structural , method , getter , js_name = gpu ) ] + #[cfg(feature = "Gpu")] + #[doc = "Getter for the `gpu` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/gpu)\n\n*This API requires the following crate features to be activated: `Gpu`, `Navigator`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn gpu(this: &Navigator) -> Gpu; # [ wasm_bindgen ( structural , method , getter , js_name = hardwareConcurrency ) ] #[doc = "Getter for the `hardwareConcurrency` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency)\n\n*This API requires the following crate features to be activated: `Navigator`*"] pub fn hardware_concurrency(this: &Navigator) -> f64; diff --git a/crates/web-sys/src/features/gen_WorkerNavigator.rs b/crates/web-sys/src/features/gen_WorkerNavigator.rs index 6d773891cdc..e6fbf72349e 100644 --- a/crates/web-sys/src/features/gen_WorkerNavigator.rs +++ b/crates/web-sys/src/features/gen_WorkerNavigator.rs @@ -14,6 +14,12 @@ extern "C" { #[cfg(feature = "MediaCapabilities")] #[doc = "Getter for the `mediaCapabilities` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/mediaCapabilities)\n\n*This API requires the following crate features to be activated: `MediaCapabilities`, `WorkerNavigator`*"] pub fn media_capabilities(this: &WorkerNavigator) -> MediaCapabilities; + # [ wasm_bindgen ( structural , method , getter , js_name = gpu ) ] + #[cfg(feature = "Gpu")] + #[doc = "Getter for the `gpu` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/gpu)\n\n*This API requires the following crate features to be activated: `Gpu`, `WorkerNavigator`*"] + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn gpu(this: &WorkerNavigator) -> Gpu; # [ wasm_bindgen ( structural , method , getter , js_name = hardwareConcurrency ) ] #[doc = "Getter for the `hardwareConcurrency` field of this object.\n\n[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/hardwareConcurrency)\n\n*This API requires the following crate features to be activated: `WorkerNavigator`*"] pub fn hardware_concurrency(this: &WorkerNavigator) -> f64; diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 8aa9815f724..5f0553b8e7a 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -1041,6 +1041,303 @@ #[cfg(feature = "GetUserMediaRequest")] mod gen_GetUserMediaRequest; #[cfg(feature = "GetUserMediaRequest")] pub use gen_GetUserMediaRequest::*; +#[cfg(feature = "Gpu")] mod gen_Gpu; +#[cfg(feature = "Gpu")] pub use gen_Gpu::*; + +#[cfg(feature = "GpuAdapter")] mod gen_GpuAdapter; +#[cfg(feature = "GpuAdapter")] pub use gen_GpuAdapter::*; + +#[cfg(feature = "GpuAddressMode")] mod gen_GpuAddressMode; +#[cfg(feature = "GpuAddressMode")] pub use gen_GpuAddressMode::*; + +#[cfg(feature = "GpuBindGroup")] mod gen_GpuBindGroup; +#[cfg(feature = "GpuBindGroup")] pub use gen_GpuBindGroup::*; + +#[cfg(feature = "GpuBindGroupBinding")] mod gen_GpuBindGroupBinding; +#[cfg(feature = "GpuBindGroupBinding")] pub use gen_GpuBindGroupBinding::*; + +#[cfg(feature = "GpuBindGroupDescriptor")] mod gen_GpuBindGroupDescriptor; +#[cfg(feature = "GpuBindGroupDescriptor")] pub use gen_GpuBindGroupDescriptor::*; + +#[cfg(feature = "GpuBindGroupLayout")] mod gen_GpuBindGroupLayout; +#[cfg(feature = "GpuBindGroupLayout")] pub use gen_GpuBindGroupLayout::*; + +#[cfg(feature = "GpuBindGroupLayoutBinding")] mod gen_GpuBindGroupLayoutBinding; +#[cfg(feature = "GpuBindGroupLayoutBinding")] pub use gen_GpuBindGroupLayoutBinding::*; + +#[cfg(feature = "GpuBindGroupLayoutDescriptor")] mod gen_GpuBindGroupLayoutDescriptor; +#[cfg(feature = "GpuBindGroupLayoutDescriptor")] pub use gen_GpuBindGroupLayoutDescriptor::*; + +#[cfg(feature = "GpuBindingType")] mod gen_GpuBindingType; +#[cfg(feature = "GpuBindingType")] pub use gen_GpuBindingType::*; + +#[cfg(feature = "GpuBlendDescriptor")] mod gen_GpuBlendDescriptor; +#[cfg(feature = "GpuBlendDescriptor")] pub use gen_GpuBlendDescriptor::*; + +#[cfg(feature = "GpuBlendFactor")] mod gen_GpuBlendFactor; +#[cfg(feature = "GpuBlendFactor")] pub use gen_GpuBlendFactor::*; + +#[cfg(feature = "GpuBlendOperation")] mod gen_GpuBlendOperation; +#[cfg(feature = "GpuBlendOperation")] pub use gen_GpuBlendOperation::*; + +#[cfg(feature = "GpuBuffer")] mod gen_GpuBuffer; +#[cfg(feature = "GpuBuffer")] pub use gen_GpuBuffer::*; + +#[cfg(feature = "GpuBufferBinding")] mod gen_GpuBufferBinding; +#[cfg(feature = "GpuBufferBinding")] pub use gen_GpuBufferBinding::*; + +#[cfg(feature = "GpuBufferCopyView")] mod gen_GpuBufferCopyView; +#[cfg(feature = "GpuBufferCopyView")] pub use gen_GpuBufferCopyView::*; + +#[cfg(feature = "GpuBufferDescriptor")] mod gen_GpuBufferDescriptor; +#[cfg(feature = "GpuBufferDescriptor")] pub use gen_GpuBufferDescriptor::*; + +#[cfg(feature = "GpuBufferUsage")] mod gen_GpuBufferUsage; +#[cfg(feature = "GpuBufferUsage")] pub use gen_GpuBufferUsage::*; + +#[cfg(feature = "GpuCanvasContext")] mod gen_GpuCanvasContext; +#[cfg(feature = "GpuCanvasContext")] pub use gen_GpuCanvasContext::*; + +#[cfg(feature = "GpuColorDict")] mod gen_GpuColorDict; +#[cfg(feature = "GpuColorDict")] pub use gen_GpuColorDict::*; + +#[cfg(feature = "GpuColorStateDescriptor")] mod gen_GpuColorStateDescriptor; +#[cfg(feature = "GpuColorStateDescriptor")] pub use gen_GpuColorStateDescriptor::*; + +#[cfg(feature = "GpuColorWrite")] mod gen_GpuColorWrite; +#[cfg(feature = "GpuColorWrite")] pub use gen_GpuColorWrite::*; + +#[cfg(feature = "GpuCommandBuffer")] mod gen_GpuCommandBuffer; +#[cfg(feature = "GpuCommandBuffer")] pub use gen_GpuCommandBuffer::*; + +#[cfg(feature = "GpuCommandBufferDescriptor")] mod gen_GpuCommandBufferDescriptor; +#[cfg(feature = "GpuCommandBufferDescriptor")] pub use gen_GpuCommandBufferDescriptor::*; + +#[cfg(feature = "GpuCommandEncoder")] mod gen_GpuCommandEncoder; +#[cfg(feature = "GpuCommandEncoder")] pub use gen_GpuCommandEncoder::*; + +#[cfg(feature = "GpuCommandEncoderDescriptor")] mod gen_GpuCommandEncoderDescriptor; +#[cfg(feature = "GpuCommandEncoderDescriptor")] pub use gen_GpuCommandEncoderDescriptor::*; + +#[cfg(feature = "GpuCompareFunction")] mod gen_GpuCompareFunction; +#[cfg(feature = "GpuCompareFunction")] pub use gen_GpuCompareFunction::*; + +#[cfg(feature = "GpuComputePassDescriptor")] mod gen_GpuComputePassDescriptor; +#[cfg(feature = "GpuComputePassDescriptor")] pub use gen_GpuComputePassDescriptor::*; + +#[cfg(feature = "GpuComputePassEncoder")] mod gen_GpuComputePassEncoder; +#[cfg(feature = "GpuComputePassEncoder")] pub use gen_GpuComputePassEncoder::*; + +#[cfg(feature = "GpuComputePipeline")] mod gen_GpuComputePipeline; +#[cfg(feature = "GpuComputePipeline")] pub use gen_GpuComputePipeline::*; + +#[cfg(feature = "GpuComputePipelineDescriptor")] mod gen_GpuComputePipelineDescriptor; +#[cfg(feature = "GpuComputePipelineDescriptor")] pub use gen_GpuComputePipelineDescriptor::*; + +#[cfg(feature = "GpuCullMode")] mod gen_GpuCullMode; +#[cfg(feature = "GpuCullMode")] pub use gen_GpuCullMode::*; + +#[cfg(feature = "GpuDepthStencilStateDescriptor")] mod gen_GpuDepthStencilStateDescriptor; +#[cfg(feature = "GpuDepthStencilStateDescriptor")] pub use gen_GpuDepthStencilStateDescriptor::*; + +#[cfg(feature = "GpuDevice")] mod gen_GpuDevice; +#[cfg(feature = "GpuDevice")] pub use gen_GpuDevice::*; + +#[cfg(feature = "GpuDeviceDescriptor")] mod gen_GpuDeviceDescriptor; +#[cfg(feature = "GpuDeviceDescriptor")] pub use gen_GpuDeviceDescriptor::*; + +#[cfg(feature = "GpuDeviceLostInfo")] mod gen_GpuDeviceLostInfo; +#[cfg(feature = "GpuDeviceLostInfo")] pub use gen_GpuDeviceLostInfo::*; + +#[cfg(feature = "GpuErrorFilter")] mod gen_GpuErrorFilter; +#[cfg(feature = "GpuErrorFilter")] pub use gen_GpuErrorFilter::*; + +#[cfg(feature = "GpuExtensionName")] mod gen_GpuExtensionName; +#[cfg(feature = "GpuExtensionName")] pub use gen_GpuExtensionName::*; + +#[cfg(feature = "GpuExtent3dDict")] mod gen_GpuExtent3dDict; +#[cfg(feature = "GpuExtent3dDict")] pub use gen_GpuExtent3dDict::*; + +#[cfg(feature = "GpuFence")] mod gen_GpuFence; +#[cfg(feature = "GpuFence")] pub use gen_GpuFence::*; + +#[cfg(feature = "GpuFenceDescriptor")] mod gen_GpuFenceDescriptor; +#[cfg(feature = "GpuFenceDescriptor")] pub use gen_GpuFenceDescriptor::*; + +#[cfg(feature = "GpuFilterMode")] mod gen_GpuFilterMode; +#[cfg(feature = "GpuFilterMode")] pub use gen_GpuFilterMode::*; + +#[cfg(feature = "GpuFrontFace")] mod gen_GpuFrontFace; +#[cfg(feature = "GpuFrontFace")] pub use gen_GpuFrontFace::*; + +#[cfg(feature = "GpuImageBitmapCopyView")] mod gen_GpuImageBitmapCopyView; +#[cfg(feature = "GpuImageBitmapCopyView")] pub use gen_GpuImageBitmapCopyView::*; + +#[cfg(feature = "GpuIndexFormat")] mod gen_GpuIndexFormat; +#[cfg(feature = "GpuIndexFormat")] pub use gen_GpuIndexFormat::*; + +#[cfg(feature = "GpuInputStepMode")] mod gen_GpuInputStepMode; +#[cfg(feature = "GpuInputStepMode")] pub use gen_GpuInputStepMode::*; + +#[cfg(feature = "GpuLimits")] mod gen_GpuLimits; +#[cfg(feature = "GpuLimits")] pub use gen_GpuLimits::*; + +#[cfg(feature = "GpuLoadOp")] mod gen_GpuLoadOp; +#[cfg(feature = "GpuLoadOp")] pub use gen_GpuLoadOp::*; + +#[cfg(feature = "GpuObjectDescriptorBase")] mod gen_GpuObjectDescriptorBase; +#[cfg(feature = "GpuObjectDescriptorBase")] pub use gen_GpuObjectDescriptorBase::*; + +#[cfg(feature = "GpuOrigin2dDict")] mod gen_GpuOrigin2dDict; +#[cfg(feature = "GpuOrigin2dDict")] pub use gen_GpuOrigin2dDict::*; + +#[cfg(feature = "GpuOrigin3dDict")] mod gen_GpuOrigin3dDict; +#[cfg(feature = "GpuOrigin3dDict")] pub use gen_GpuOrigin3dDict::*; + +#[cfg(feature = "GpuOutOfMemoryError")] mod gen_GpuOutOfMemoryError; +#[cfg(feature = "GpuOutOfMemoryError")] pub use gen_GpuOutOfMemoryError::*; + +#[cfg(feature = "GpuPipelineDescriptorBase")] mod gen_GpuPipelineDescriptorBase; +#[cfg(feature = "GpuPipelineDescriptorBase")] pub use gen_GpuPipelineDescriptorBase::*; + +#[cfg(feature = "GpuPipelineLayout")] mod gen_GpuPipelineLayout; +#[cfg(feature = "GpuPipelineLayout")] pub use gen_GpuPipelineLayout::*; + +#[cfg(feature = "GpuPipelineLayoutDescriptor")] mod gen_GpuPipelineLayoutDescriptor; +#[cfg(feature = "GpuPipelineLayoutDescriptor")] pub use gen_GpuPipelineLayoutDescriptor::*; + +#[cfg(feature = "GpuPowerPreference")] mod gen_GpuPowerPreference; +#[cfg(feature = "GpuPowerPreference")] pub use gen_GpuPowerPreference::*; + +#[cfg(feature = "GpuPrimitiveTopology")] mod gen_GpuPrimitiveTopology; +#[cfg(feature = "GpuPrimitiveTopology")] pub use gen_GpuPrimitiveTopology::*; + +#[cfg(feature = "GpuProgrammableStageDescriptor")] mod gen_GpuProgrammableStageDescriptor; +#[cfg(feature = "GpuProgrammableStageDescriptor")] pub use gen_GpuProgrammableStageDescriptor::*; + +#[cfg(feature = "GpuQueue")] mod gen_GpuQueue; +#[cfg(feature = "GpuQueue")] pub use gen_GpuQueue::*; + +#[cfg(feature = "GpuRasterizationStateDescriptor")] mod gen_GpuRasterizationStateDescriptor; +#[cfg(feature = "GpuRasterizationStateDescriptor")] pub use gen_GpuRasterizationStateDescriptor::*; + +#[cfg(feature = "GpuRenderBundle")] mod gen_GpuRenderBundle; +#[cfg(feature = "GpuRenderBundle")] pub use gen_GpuRenderBundle::*; + +#[cfg(feature = "GpuRenderBundleDescriptor")] mod gen_GpuRenderBundleDescriptor; +#[cfg(feature = "GpuRenderBundleDescriptor")] pub use gen_GpuRenderBundleDescriptor::*; + +#[cfg(feature = "GpuRenderBundleEncoder")] mod gen_GpuRenderBundleEncoder; +#[cfg(feature = "GpuRenderBundleEncoder")] pub use gen_GpuRenderBundleEncoder::*; + +#[cfg(feature = "GpuRenderBundleEncoderDescriptor")] mod gen_GpuRenderBundleEncoderDescriptor; +#[cfg(feature = "GpuRenderBundleEncoderDescriptor")] pub use gen_GpuRenderBundleEncoderDescriptor::*; + +#[cfg(feature = "GpuRenderPassColorAttachmentDescriptor")] mod gen_GpuRenderPassColorAttachmentDescriptor; +#[cfg(feature = "GpuRenderPassColorAttachmentDescriptor")] pub use gen_GpuRenderPassColorAttachmentDescriptor::*; + +#[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] mod gen_GpuRenderPassDepthStencilAttachmentDescriptor; +#[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] pub use gen_GpuRenderPassDepthStencilAttachmentDescriptor::*; + +#[cfg(feature = "GpuRenderPassDescriptor")] mod gen_GpuRenderPassDescriptor; +#[cfg(feature = "GpuRenderPassDescriptor")] pub use gen_GpuRenderPassDescriptor::*; + +#[cfg(feature = "GpuRenderPassEncoder")] mod gen_GpuRenderPassEncoder; +#[cfg(feature = "GpuRenderPassEncoder")] pub use gen_GpuRenderPassEncoder::*; + +#[cfg(feature = "GpuRenderPipeline")] mod gen_GpuRenderPipeline; +#[cfg(feature = "GpuRenderPipeline")] pub use gen_GpuRenderPipeline::*; + +#[cfg(feature = "GpuRenderPipelineDescriptor")] mod gen_GpuRenderPipelineDescriptor; +#[cfg(feature = "GpuRenderPipelineDescriptor")] pub use gen_GpuRenderPipelineDescriptor::*; + +#[cfg(feature = "GpuRequestAdapterOptions")] mod gen_GpuRequestAdapterOptions; +#[cfg(feature = "GpuRequestAdapterOptions")] pub use gen_GpuRequestAdapterOptions::*; + +#[cfg(feature = "GpuSampler")] mod gen_GpuSampler; +#[cfg(feature = "GpuSampler")] pub use gen_GpuSampler::*; + +#[cfg(feature = "GpuSamplerDescriptor")] mod gen_GpuSamplerDescriptor; +#[cfg(feature = "GpuSamplerDescriptor")] pub use gen_GpuSamplerDescriptor::*; + +#[cfg(feature = "GpuShaderModule")] mod gen_GpuShaderModule; +#[cfg(feature = "GpuShaderModule")] pub use gen_GpuShaderModule::*; + +#[cfg(feature = "GpuShaderModuleDescriptor")] mod gen_GpuShaderModuleDescriptor; +#[cfg(feature = "GpuShaderModuleDescriptor")] pub use gen_GpuShaderModuleDescriptor::*; + +#[cfg(feature = "GpuShaderStage")] mod gen_GpuShaderStage; +#[cfg(feature = "GpuShaderStage")] pub use gen_GpuShaderStage::*; + +#[cfg(feature = "GpuStencilOperation")] mod gen_GpuStencilOperation; +#[cfg(feature = "GpuStencilOperation")] pub use gen_GpuStencilOperation::*; + +#[cfg(feature = "GpuStencilStateFaceDescriptor")] mod gen_GpuStencilStateFaceDescriptor; +#[cfg(feature = "GpuStencilStateFaceDescriptor")] pub use gen_GpuStencilStateFaceDescriptor::*; + +#[cfg(feature = "GpuStoreOp")] mod gen_GpuStoreOp; +#[cfg(feature = "GpuStoreOp")] pub use gen_GpuStoreOp::*; + +#[cfg(feature = "GpuSwapChain")] mod gen_GpuSwapChain; +#[cfg(feature = "GpuSwapChain")] pub use gen_GpuSwapChain::*; + +#[cfg(feature = "GpuSwapChainDescriptor")] mod gen_GpuSwapChainDescriptor; +#[cfg(feature = "GpuSwapChainDescriptor")] pub use gen_GpuSwapChainDescriptor::*; + +#[cfg(feature = "GpuTexture")] mod gen_GpuTexture; +#[cfg(feature = "GpuTexture")] pub use gen_GpuTexture::*; + +#[cfg(feature = "GpuTextureAspect")] mod gen_GpuTextureAspect; +#[cfg(feature = "GpuTextureAspect")] pub use gen_GpuTextureAspect::*; + +#[cfg(feature = "GpuTextureComponentType")] mod gen_GpuTextureComponentType; +#[cfg(feature = "GpuTextureComponentType")] pub use gen_GpuTextureComponentType::*; + +#[cfg(feature = "GpuTextureCopyView")] mod gen_GpuTextureCopyView; +#[cfg(feature = "GpuTextureCopyView")] pub use gen_GpuTextureCopyView::*; + +#[cfg(feature = "GpuTextureDescriptor")] mod gen_GpuTextureDescriptor; +#[cfg(feature = "GpuTextureDescriptor")] pub use gen_GpuTextureDescriptor::*; + +#[cfg(feature = "GpuTextureDimension")] mod gen_GpuTextureDimension; +#[cfg(feature = "GpuTextureDimension")] pub use gen_GpuTextureDimension::*; + +#[cfg(feature = "GpuTextureFormat")] mod gen_GpuTextureFormat; +#[cfg(feature = "GpuTextureFormat")] pub use gen_GpuTextureFormat::*; + +#[cfg(feature = "GpuTextureUsage")] mod gen_GpuTextureUsage; +#[cfg(feature = "GpuTextureUsage")] pub use gen_GpuTextureUsage::*; + +#[cfg(feature = "GpuTextureView")] mod gen_GpuTextureView; +#[cfg(feature = "GpuTextureView")] pub use gen_GpuTextureView::*; + +#[cfg(feature = "GpuTextureViewDescriptor")] mod gen_GpuTextureViewDescriptor; +#[cfg(feature = "GpuTextureViewDescriptor")] pub use gen_GpuTextureViewDescriptor::*; + +#[cfg(feature = "GpuTextureViewDimension")] mod gen_GpuTextureViewDimension; +#[cfg(feature = "GpuTextureViewDimension")] pub use gen_GpuTextureViewDimension::*; + +#[cfg(feature = "GpuUncapturedErrorEvent")] mod gen_GpuUncapturedErrorEvent; +#[cfg(feature = "GpuUncapturedErrorEvent")] pub use gen_GpuUncapturedErrorEvent::*; + +#[cfg(feature = "GpuUncapturedErrorEventInit")] mod gen_GpuUncapturedErrorEventInit; +#[cfg(feature = "GpuUncapturedErrorEventInit")] pub use gen_GpuUncapturedErrorEventInit::*; + +#[cfg(feature = "GpuValidationError")] mod gen_GpuValidationError; +#[cfg(feature = "GpuValidationError")] pub use gen_GpuValidationError::*; + +#[cfg(feature = "GpuVertexAttributeDescriptor")] mod gen_GpuVertexAttributeDescriptor; +#[cfg(feature = "GpuVertexAttributeDescriptor")] pub use gen_GpuVertexAttributeDescriptor::*; + +#[cfg(feature = "GpuVertexBufferLayoutDescriptor")] mod gen_GpuVertexBufferLayoutDescriptor; +#[cfg(feature = "GpuVertexBufferLayoutDescriptor")] pub use gen_GpuVertexBufferLayoutDescriptor::*; + +#[cfg(feature = "GpuVertexFormat")] mod gen_GpuVertexFormat; +#[cfg(feature = "GpuVertexFormat")] pub use gen_GpuVertexFormat::*; + +#[cfg(feature = "GpuVertexStateDescriptor")] mod gen_GpuVertexStateDescriptor; +#[cfg(feature = "GpuVertexStateDescriptor")] pub use gen_GpuVertexStateDescriptor::*; + #[cfg(feature = "GridDeclaration")] mod gen_GridDeclaration; #[cfg(feature = "GridDeclaration")] pub use gen_GridDeclaration::*; diff --git a/crates/webidl/src/generator.rs b/crates/webidl/src/generator.rs index 86899f70a4d..9e3cbc96611 100644 --- a/crates/webidl/src/generator.rs +++ b/crates/webidl/src/generator.rs @@ -44,6 +44,18 @@ fn comment(mut comment: String, features: &Option) -> String { } +fn maybe_unstable_attr(unstable: bool) -> Option { + if unstable { + Some(quote! { + #[cfg(web_sys_unstable_apis)] + #[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + }) + } else { + None + } +} + + pub struct EnumVariant { pub name: Ident, @@ -65,6 +77,7 @@ impl EnumVariant { pub struct Enum { pub name: Ident, pub variants: Vec, + pub unstable: bool, } impl Enum { @@ -72,8 +85,11 @@ impl Enum { let Enum { name, variants, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let doc_comment = comment(format!("The `{}` enum.", name), &get_features_doc(name.to_string())); let variants = variants.into_iter() @@ -85,6 +101,7 @@ impl Enum { #[wasm_bindgen] #[doc = #doc_comment] + #unstable_attr #[derive(Copy, Clone, PartialEq, Debug)] pub enum #name { #(#variants),* @@ -106,6 +123,7 @@ pub struct InterfaceAttribute { pub structural: bool, pub catch: bool, pub kind: InterfaceAttributeKind, + pub unstable: bool, } impl InterfaceAttribute { @@ -117,8 +135,11 @@ impl InterfaceAttribute { structural, catch, kind, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let static_method_of = raw_ident(&parent_js_name); let mdn_docs = mdn_doc(parent_js_name, Some(js_name)); @@ -203,6 +224,7 @@ impl InterfaceAttribute { )] #cfg_features #[doc = #doc_comment] + #unstable_attr #def } } @@ -228,6 +250,7 @@ pub struct InterfaceMethod { pub structural: bool, pub catch: bool, pub variadic: bool, + pub unstable: bool, } impl InterfaceMethod { @@ -242,8 +265,11 @@ impl InterfaceMethod { structural, catch, variadic, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let static_method_of = raw_ident(&parent_js_name); let mut is_constructor = false; @@ -370,6 +396,7 @@ impl InterfaceMethod { #(#extra_args),* )] #[doc = #doc_comment] + #unstable_attr pub fn #name(#this #(#arguments),*) #ret; } } @@ -418,6 +445,7 @@ pub struct InterfaceConst { pub name: Ident, pub ty: syn::Type, pub value: InterfaceConstValue, + pub unstable: bool, } impl InterfaceConst { @@ -425,8 +453,12 @@ impl InterfaceConst { let name = &self.name; let ty = &self.ty; let value = self.value.generate(); + let unstable = self.unstable; + + let unstable_attr = maybe_unstable_attr(unstable); quote! { + #unstable_attr pub const #name: #ty = #value as #ty; } } @@ -442,6 +474,7 @@ pub struct Interface { pub consts: Vec, pub attributes: Vec, pub methods: Vec, + pub unstable: bool, } impl Interface { @@ -455,8 +488,11 @@ impl Interface { consts, attributes, methods, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let doc_comment = comment( format!("The `{}` class.\n\n{}", name, mdn_doc(js_name, None)), &get_features_doc(name.to_string()), @@ -491,6 +527,7 @@ impl Interface { } else { Some(quote! { + #unstable_attr impl #name { #(#deprecated #consts)* } @@ -511,6 +548,7 @@ impl Interface { use super::*; use wasm_bindgen::prelude::*; + #unstable_attr #[wasm_bindgen] extern "C" { #[wasm_bindgen( @@ -579,6 +617,7 @@ pub struct Dictionary { pub name: Ident, pub js_name: String, pub fields: Vec, + pub unstable: bool, } impl Dictionary { @@ -587,8 +626,11 @@ impl Dictionary { name, js_name, fields, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let js_name = raw_ident(js_name); let mut required_features = BTreeSet::new(); @@ -622,6 +664,7 @@ impl Dictionary { use super::*; use wasm_bindgen::prelude::*; + #unstable_attr #[wasm_bindgen] extern "C" { #[wasm_bindgen(extends = ::js_sys::Object, js_name = #js_name)] @@ -629,6 +672,7 @@ impl Dictionary { pub type #name; } + #unstable_attr impl #name { #cfg_features #[doc = #ctor_doc_comment] @@ -653,6 +697,7 @@ pub struct Function { pub ret_ty: Option, pub catch: bool, pub variadic: bool, + pub unstable: bool, } impl Function { @@ -664,8 +709,11 @@ impl Function { ret_ty, catch, variadic, + unstable, } = self; + let unstable_attr = maybe_unstable_attr(*unstable); + let js_namespace = raw_ident(&parent_js_name); let doc_comment = format!( @@ -734,6 +782,7 @@ impl Function { js_name = #js_name )] #[doc = #doc_comment] + #unstable_attr pub fn #name(#(#arguments),*) #ret; } } diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 59230830ffa..56feba316e6 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -28,7 +28,7 @@ use crate::generator::{ Enum, EnumVariant, Dictionary, DictionaryField, Interface, InterfaceMethod, InterfaceAttribute, InterfaceConst, Function, Namespace, InterfaceAttributeKind, }; -use anyhow::{bail, Result}; +use anyhow::Result; use proc_macro2::{Ident, TokenStream}; use quote::ToTokens; use std::collections::{BTreeMap, BTreeSet}; @@ -177,10 +177,10 @@ pub fn compile(webidl_source: &str, experimental_source: &str) -> Result FirstPassRecord<'src> { fn append_enum(&self, program: &mut Program, name: Ident, js_name: &str, data: &first_pass::EnumData<'src>) { - assert_eq!(js_name, enum_.identifier.0); - let enum_ = data.definition; - let unstable_api = data.stability.is_unstable(); + let unstable = data.stability.is_unstable(); + + assert_eq!(js_name, enum_.identifier.0); let variants = enum_.values.body.list.iter() .map(|v| { @@ -196,7 +196,7 @@ impl<'src> FirstPassRecord<'src> { }) .collect::>(); - Enum { name, variants } + Enum { name, variants, unstable } .generate() .to_tokens(&mut program.tokens); } @@ -217,7 +217,7 @@ impl<'src> FirstPassRecord<'src> { assert_eq!(js_name, def.identifier.0); - let unstable_api = data.stability.is_unstable(); + let unstable = data.stability.is_unstable(); let mut fields = Vec::new(); @@ -225,7 +225,7 @@ impl<'src> FirstPassRecord<'src> { return; } - Dictionary { name, js_name, fields } + Dictionary { name, js_name, fields, unstable } .generate() .to_tokens(&mut program.tokens); } @@ -434,7 +434,8 @@ impl<'src> FirstPassRecord<'src> { } for member in data.attributes.iter() { - let member_def = member.definition; + let unstable = unstable || member.stability.is_unstable(); + let member = member.definition; self.member_attribute( &mut attributes, member.modifier, @@ -443,7 +444,7 @@ impl<'src> FirstPassRecord<'src> { member.identifier.0.to_string(), &member.attributes, data.definition_attributes, - unstable || member.stability.is_unstable(), + unstable, ); } @@ -457,7 +458,8 @@ impl<'src> FirstPassRecord<'src> { } for member in &mixin_data.attributes { - let member_def = member.definition; + let unstable = unstable || member.stability.is_unstable(); + let member = member.definition; self.member_attribute( &mut attributes, if let Some(s) = member.stringifier { @@ -470,7 +472,7 @@ impl<'src> FirstPassRecord<'src> { member.identifier.0.to_string(), &member.attributes, data.definition_attributes, - unstable || member.stability.is_unstable(), + unstable, ); } @@ -479,7 +481,7 @@ impl<'src> FirstPassRecord<'src> { } } - Interface { name, js_name, deprecated, has_interface, parents, consts, attributes, methods } + Interface { name, js_name, deprecated, has_interface, parents, consts, attributes, methods, unstable } .generate() .to_tokens(&mut program.tokens); } @@ -515,7 +517,7 @@ impl<'src> FirstPassRecord<'src> { // Skip types which can't be converted if let Some(ty) = ty { let kind = InterfaceAttributeKind::Getter; - attributes.push(InterfaceAttribute { is_static, structural, catch, ty, js_name: js_name.clone(), kind }); + attributes.push(InterfaceAttribute { is_static, structural, catch, ty, js_name: js_name.clone(), kind, unstable }); } if !readonly { diff --git a/crates/webidl/src/main.rs b/crates/webidl/src/main.rs index 5a14b359d28..326f1598319 100644 --- a/crates/webidl/src/main.rs +++ b/crates/webidl/src/main.rs @@ -15,6 +15,24 @@ fn unwrap_not_found(err: std::io::Result<()>) -> std::io::Result<()> { } } +/// Read all WebIDL files in a directory into a single `SourceFile` +fn read_source_from_path(dir: &path::Path) -> Result { + let entries = fs::read_dir(dir).context("reading webidls directory")?; + let mut source = SourceFile::default(); + for entry in entries { + let entry = entry.context(format!("getting {}/*.webidl entry", dir.display()))?; + let path = entry.path(); + if path.extension() != Some(OsStr::new("webidl")) { + continue; + } + source = source + .add_file(&path) + .with_context(|| format!("reading contents of file \"{}\"", path.display()))?; + } + + Ok(source) +} + fn main() -> Result<()> { #[cfg(feature = "env_logger")] env_logger::init(); @@ -24,22 +42,10 @@ fn main() -> Result<()> { let from = path::Path::new(from); let to = path::Path::new(to); - let entries = fs::read_dir(from.join("enabled")).context("reading enabled directory")?; - - let mut source = SourceFile::default(); - - for entry in entries { - let entry = entry.context("getting enabled/*.webidl entry")?; - let path = entry.path(); - if path.extension() != Some(OsStr::new("webidl")) { - continue; - } - source = source - .add_file(&path) - .with_context(|| format!("reading contents of file \"{}\"", path.display()))?; - } + let source = read_source_from_path(&from.join("enabled"))?; + let unstable_source = read_source_from_path(&from.join("unstable"))?; - let features = match wasm_bindgen_webidl::compile(&source.contents) { + let features = match wasm_bindgen_webidl::compile(&source.contents, &unstable_source.contents) { Ok(features) => features, Err(e) => { if let Some(err) = e.downcast_ref::() {