From f16e3bbb5cda7663e07c1b441dba5b49c204438f Mon Sep 17 00:00:00 2001 From: Christofer Nolander Date: Wed, 27 Nov 2024 23:19:51 +0100 Subject: [PATCH] Update WebGPU API to draft 2024-11-22 --- CHANGELOG.md | 3 + crates/web-sys/Cargo.toml | 10 +-- .../src/features/gen_GpuCommandEncoder.rs | 90 ++++++++++--------- ...rs => gen_GpuCopyExternalImageDestInfo.rs} | 54 +++++------ ... => gen_GpuCopyExternalImageSourceInfo.rs} | 38 ++++---- crates/web-sys/src/features/gen_GpuDevice.rs | 12 +++ .../src/features/gen_GpuFeatureName.rs | 1 + crates/web-sys/src/features/gen_GpuQueue.rs | 83 +++++++++-------- .../features/gen_GpuRequestAdapterOptions.rs | 24 +++++ ...uffer.rs => gen_GpuTexelCopyBufferInfo.rs} | 46 +++++----- ...out.rs => gen_GpuTexelCopyBufferLayout.rs} | 40 ++++----- ...ture.rs => gen_GpuTexelCopyTextureInfo.rs} | 46 +++++----- .../src/features/gen_GpuVertexFormat.rs | 10 +++ crates/web-sys/src/features/mod.rs | 70 +++++++-------- crates/web-sys/webidls/unstable/WebGPU.webidl | 59 +++++++----- crates/webidl/src/generator.rs | 4 +- 16 files changed, 335 insertions(+), 255 deletions(-) rename crates/web-sys/src/features/{gen_GpuImageCopyTextureTagged.rs => gen_GpuCopyExternalImageDestInfo.rs} (80%) rename crates/web-sys/src/features/{gen_GpuImageCopyExternalImage.rs => gen_GpuCopyExternalImageSourceInfo.rs} (79%) rename crates/web-sys/src/features/{gen_GpuImageCopyBuffer.rs => gen_GpuTexelCopyBufferInfo.rs} (82%) rename crates/web-sys/src/features/{gen_GpuImageDataLayout.rs => gen_GpuTexelCopyBufferLayout.rs} (81%) rename crates/web-sys/src/features/{gen_GpuImageCopyTexture.rs => gen_GpuTexelCopyTextureInfo.rs} (81%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e2dbfd2d3..20f068f9e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ * Added support for `no_std` to `link_to!`, `static_string` (via `thread_local_v2`) and `throw`. [#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277) +* Updated the WebGPU API to the current draft as of 2024-11-22. + [#4290](https://github.com/rustwasm/wasm-bindgen/pull/4290) + ### Changed * String enums now generate private TypeScript types but only if used. diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index e3ddae0c305..ec4a073996b 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -513,6 +513,8 @@ GpuComputePassEncoder = [] GpuComputePassTimestampWrites = [] GpuComputePipeline = [] GpuComputePipelineDescriptor = [] +GpuCopyExternalImageDestInfo = [] +GpuCopyExternalImageSourceInfo = [] GpuCullMode = [] GpuDepthStencilState = [] GpuDevice = ["EventTarget"] @@ -529,11 +531,6 @@ GpuFeatureName = [] GpuFilterMode = [] GpuFragmentState = [] GpuFrontFace = [] -GpuImageCopyBuffer = [] -GpuImageCopyExternalImage = [] -GpuImageCopyTexture = [] -GpuImageCopyTextureTagged = [] -GpuImageDataLayout = [] GpuIndexFormat = [] GpuInternalError = ["GpuError"] GpuLoadOp = [] @@ -585,6 +582,9 @@ GpuStorageTextureBindingLayout = [] GpuStoreOp = [] GpuSupportedFeatures = [] GpuSupportedLimits = [] +GpuTexelCopyBufferInfo = [] +GpuTexelCopyBufferLayout = [] +GpuTexelCopyTextureInfo = [] GpuTexture = [] GpuTextureAspect = [] GpuTextureBindingLayout = [] diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs index 7fb2fb756a2..426b59447fc 100644 --- a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs @@ -189,7 +189,7 @@ extern "C" { ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -205,10 +205,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -224,10 +224,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -243,10 +243,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -262,10 +262,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -281,10 +281,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -300,10 +300,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -319,10 +319,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -338,115 +338,121 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] + #[cfg(all( + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", + ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyBuffer", - feature = "GpuImageCopyTexture", + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] + #[cfg(all( + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", + ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyBuffer", - feature = "GpuImageCopyTexture", + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuImageCopyTexture")] + #[cfg(feature = "GpuTexelCopyTextureInfo")] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuImageCopyTexture",))] + #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuTexelCopyTextureInfo",))] # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs b/crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs similarity index 80% rename from crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs rename to crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs index d0cc4179b3b..8233e356331 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs +++ b/crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs @@ -5,116 +5,116 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTextureTagged)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageDestInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTextureTagged` dictionary."] + #[doc = "The `GpuCopyExternalImageDestInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTextureTagged; + pub type GpuCopyExternalImageDestInfo; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Get the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "aspect")] - pub fn get_aspect(this: &GpuImageCopyTextureTagged) -> Option; + pub fn get_aspect(this: &GpuCopyExternalImageDestInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Change the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "aspect")] - pub fn set_aspect(this: &GpuImageCopyTextureTagged, val: GpuTextureAspect); + pub fn set_aspect(this: &GpuCopyExternalImageDestInfo, val: GpuTextureAspect); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "mipLevel")] - pub fn get_mip_level(this: &GpuImageCopyTextureTagged) -> Option; + pub fn get_mip_level(this: &GpuCopyExternalImageDestInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "mipLevel")] - pub fn set_mip_level(this: &GpuImageCopyTextureTagged, val: u32); + pub fn set_mip_level(this: &GpuCopyExternalImageDestInfo, val: u32); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "origin")] - pub fn get_origin(this: &GpuImageCopyTextureTagged) -> ::wasm_bindgen::JsValue; + pub fn get_origin(this: &GpuCopyExternalImageDestInfo) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "origin")] - pub fn set_origin(this: &GpuImageCopyTextureTagged, val: &::wasm_bindgen::JsValue); + pub fn set_origin(this: &GpuCopyExternalImageDestInfo, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTexture")] #[doc = "Get the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "texture")] - pub fn get_texture(this: &GpuImageCopyTextureTagged) -> GpuTexture; + pub fn get_texture(this: &GpuCopyExternalImageDestInfo) -> GpuTexture; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTexture")] #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "texture")] - pub fn set_texture(this: &GpuImageCopyTextureTagged, val: &GpuTexture); + pub fn set_texture(this: &GpuCopyExternalImageDestInfo, val: &GpuTexture); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `premultipliedAlpha` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "premultipliedAlpha")] - pub fn get_premultiplied_alpha(this: &GpuImageCopyTextureTagged) -> Option; + pub fn get_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `premultipliedAlpha` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "premultipliedAlpha")] - pub fn set_premultiplied_alpha(this: &GpuImageCopyTextureTagged, val: bool); + pub fn set_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo, val: bool); } #[cfg(web_sys_unstable_apis)] -impl GpuImageCopyTextureTagged { +impl GpuCopyExternalImageDestInfo { #[cfg(feature = "GpuTexture")] - #[doc = "Construct a new `GpuImageCopyTextureTagged`."] + #[doc = "Construct a new `GpuCopyExternalImageDestInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs b/crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs similarity index 79% rename from crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs rename to crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs index c471c154757..6e1ed36f7aa 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs +++ b/crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs @@ -5,75 +5,75 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyExternalImage)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageSourceInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyExternalImage` dictionary."] + #[doc = "The `GpuCopyExternalImageSourceInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyExternalImage; + pub type GpuCopyExternalImageSourceInfo; #[cfg(web_sys_unstable_apis)] #[doc = "Get the `flipY` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "flipY")] - pub fn get_flip_y(this: &GpuImageCopyExternalImage) -> Option; + pub fn get_flip_y(this: &GpuCopyExternalImageSourceInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `flipY` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "flipY")] - pub fn set_flip_y(this: &GpuImageCopyExternalImage, val: bool); + pub fn set_flip_y(this: &GpuCopyExternalImageSourceInfo, val: bool); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "origin")] - pub fn get_origin(this: &GpuImageCopyExternalImage) -> ::wasm_bindgen::JsValue; + pub fn get_origin(this: &GpuCopyExternalImageSourceInfo) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "origin")] - pub fn set_origin(this: &GpuImageCopyExternalImage, val: &::wasm_bindgen::JsValue); + pub fn set_origin(this: &GpuCopyExternalImageSourceInfo, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `source` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "source")] - pub fn get_source(this: &GpuImageCopyExternalImage) -> ::js_sys::Object; + pub fn get_source(this: &GpuCopyExternalImageSourceInfo) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `source` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "source")] - pub fn set_source(this: &GpuImageCopyExternalImage, val: &::js_sys::Object); + pub fn set_source(this: &GpuCopyExternalImageSourceInfo, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] -impl GpuImageCopyExternalImage { - #[doc = "Construct a new `GpuImageCopyExternalImage`."] +impl GpuCopyExternalImageSourceInfo { + #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuDevice.rs b/crates/web-sys/src/features/gen_GpuDevice.rs index 5ad2483befc..eadade16939 100644 --- a/crates/web-sys/src/features/gen_GpuDevice.rs +++ b/crates/web-sys/src/features/gen_GpuDevice.rs @@ -41,6 +41,18 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn limits(this: &GpuDevice) -> GpuSupportedLimits; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAdapterInfo")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = adapterInfo)] + #[doc = "Getter for the `adapterInfo` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/adapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn adapter_info(this: &GpuDevice) -> GpuAdapterInfo; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuQueue")] # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = queue)] #[doc = "Getter for the `queue` field of this object."] diff --git a/crates/web-sys/src/features/gen_GpuFeatureName.rs b/crates/web-sys/src/features/gen_GpuFeatureName.rs index 4f30f43434c..b4bbf30a2b3 100644 --- a/crates/web-sys/src/features/gen_GpuFeatureName.rs +++ b/crates/web-sys/src/features/gen_GpuFeatureName.rs @@ -24,6 +24,7 @@ pub enum GpuFeatureName { Rg11b10ufloatRenderable = "rg11b10ufloat-renderable", Bgra8unormStorage = "bgra8unorm-storage", Float32Filterable = "float32-filterable", + Float32Blendable = "float32-blendable", ClipDistances = "clip-distances", DualSourceBlending = "dual-source-blending", } diff --git a/crates/web-sys/src/features/gen_GpuQueue.rs b/crates/web-sys/src/features/gen_GpuQueue.rs index e33c2394648..70087a2f665 100644 --- a/crates/web-sys/src/features/gen_GpuQueue.rs +++ b/crates/web-sys/src/features/gen_GpuQueue.rs @@ -40,43 +40,43 @@ extern "C" { pub fn set_label(this: &GpuQueue, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(all( - feature = "GpuImageCopyExternalImage", - feature = "GpuImageCopyTextureTagged", + feature = "GpuCopyExternalImageDestInfo", + feature = "GpuCopyExternalImageSourceInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_u32_sequence( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( + feature = "GpuCopyExternalImageDestInfo", + feature = "GpuCopyExternalImageSourceInfo", feature = "GpuExtent3dDict", - feature = "GpuImageCopyExternalImage", - feature = "GpuImageCopyTextureTagged", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuExtent3dDict`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_gpu_extent_3d_dict( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] @@ -876,123 +876,132 @@ extern "C" { size: f64, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_slice_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_array_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Uint8Array, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyTexture", - feature = "GpuImageDataLayout", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyTexture", - feature = "GpuImageDataLayout", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_slice_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyTexture", - feature = "GpuImageDataLayout", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", ))] # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Uint8Array, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs index cba26922c2b..9148d88bf0e 100644 --- a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs +++ b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs @@ -70,6 +70,24 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "powerPreference")] pub fn set_power_preference(this: &GpuRequestAdapterOptions, val: GpuPowerPreference); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "xrCompatible")] + pub fn get_xr_compatible(this: &GpuRequestAdapterOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "xrCompatible")] + pub fn set_xr_compatible(this: &GpuRequestAdapterOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl GpuRequestAdapterOptions { @@ -103,6 +121,12 @@ impl GpuRequestAdapterOptions { self.set_power_preference(val); self } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_xr_compatible()` instead."] + pub fn xr_compatible(&mut self, val: bool) -> &mut Self { + self.set_xr_compatible(val); + self + } } #[cfg(web_sys_unstable_apis)] impl Default for GpuRequestAdapterOptions { diff --git a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs b/crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs similarity index 82% rename from crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs rename to crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs index 153b4004980..a950be4a318 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs +++ b/crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs @@ -5,96 +5,96 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyBuffer` dictionary."] + #[doc = "The `GpuTexelCopyBufferInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyBuffer; + pub type GpuTexelCopyBufferInfo; #[cfg(web_sys_unstable_apis)] #[doc = "Get the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "bytesPerRow")] - pub fn get_bytes_per_row(this: &GpuImageCopyBuffer) -> Option; + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "bytesPerRow")] - pub fn set_bytes_per_row(this: &GpuImageCopyBuffer, val: u32); + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferInfo, val: u32); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `offset` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "offset")] - pub fn get_offset(this: &GpuImageCopyBuffer) -> Option; + pub fn get_offset(this: &GpuTexelCopyBufferInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `offset` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "offset")] - pub fn set_offset(this: &GpuImageCopyBuffer, val: f64); + pub fn set_offset(this: &GpuTexelCopyBufferInfo, val: f64); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `rowsPerImage` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "rowsPerImage")] - pub fn get_rows_per_image(this: &GpuImageCopyBuffer) -> Option; + pub fn get_rows_per_image(this: &GpuTexelCopyBufferInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `rowsPerImage` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "rowsPerImage")] - pub fn set_rows_per_image(this: &GpuImageCopyBuffer, val: u32); + pub fn set_rows_per_image(this: &GpuTexelCopyBufferInfo, val: u32); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] #[doc = "Get the `buffer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "buffer")] - pub fn get_buffer(this: &GpuImageCopyBuffer) -> GpuBuffer; + pub fn get_buffer(this: &GpuTexelCopyBufferInfo) -> GpuBuffer; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] #[doc = "Change the `buffer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "buffer")] - pub fn set_buffer(this: &GpuImageCopyBuffer, val: &GpuBuffer); + pub fn set_buffer(this: &GpuTexelCopyBufferInfo, val: &GpuBuffer); } #[cfg(web_sys_unstable_apis)] -impl GpuImageCopyBuffer { +impl GpuTexelCopyBufferInfo { #[cfg(feature = "GpuBuffer")] - #[doc = "Construct a new `GpuImageCopyBuffer`."] + #[doc = "Construct a new `GpuTexelCopyBufferInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs b/crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs similarity index 81% rename from crates/web-sys/src/features/gen_GpuImageDataLayout.rs rename to crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs index c0ecc701835..20d5229944f 100644 --- a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs +++ b/crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs @@ -5,75 +5,75 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageDataLayout)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferLayout)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageDataLayout` dictionary."] + #[doc = "The `GpuTexelCopyBufferLayout` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageDataLayout; + pub type GpuTexelCopyBufferLayout; #[cfg(web_sys_unstable_apis)] #[doc = "Get the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "bytesPerRow")] - pub fn get_bytes_per_row(this: &GpuImageDataLayout) -> Option; + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bytesPerRow` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "bytesPerRow")] - pub fn set_bytes_per_row(this: &GpuImageDataLayout, val: u32); + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferLayout, val: u32); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `offset` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "offset")] - pub fn get_offset(this: &GpuImageDataLayout) -> Option; + pub fn get_offset(this: &GpuTexelCopyBufferLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `offset` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "offset")] - pub fn set_offset(this: &GpuImageDataLayout, val: f64); + pub fn set_offset(this: &GpuTexelCopyBufferLayout, val: f64); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `rowsPerImage` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "rowsPerImage")] - pub fn get_rows_per_image(this: &GpuImageDataLayout) -> Option; + pub fn get_rows_per_image(this: &GpuTexelCopyBufferLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `rowsPerImage` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "rowsPerImage")] - pub fn set_rows_per_image(this: &GpuImageDataLayout, val: u32); + pub fn set_rows_per_image(this: &GpuTexelCopyBufferLayout, val: u32); } #[cfg(web_sys_unstable_apis)] -impl GpuImageDataLayout { - #[doc = "Construct a new `GpuImageDataLayout`."] +impl GpuTexelCopyBufferLayout { + #[doc = "Construct a new `GpuTexelCopyBufferLayout`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -102,7 +102,7 @@ impl GpuImageDataLayout { } } #[cfg(web_sys_unstable_apis)] -impl Default for GpuImageDataLayout { +impl Default for GpuTexelCopyBufferLayout { fn default() -> Self { Self::new() } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs b/crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs similarity index 81% rename from crates/web-sys/src/features/gen_GpuImageCopyTexture.rs rename to crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs index 96b81683bf3..b57011e67a5 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs +++ b/crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs @@ -5,98 +5,98 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTexture)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyTextureInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTexture` dictionary."] + #[doc = "The `GpuTexelCopyTextureInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTexture; + pub type GpuTexelCopyTextureInfo; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Get the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "aspect")] - pub fn get_aspect(this: &GpuImageCopyTexture) -> Option; + pub fn get_aspect(this: &GpuTexelCopyTextureInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Change the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "aspect")] - pub fn set_aspect(this: &GpuImageCopyTexture, val: GpuTextureAspect); + pub fn set_aspect(this: &GpuTexelCopyTextureInfo, val: GpuTextureAspect); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "mipLevel")] - pub fn get_mip_level(this: &GpuImageCopyTexture) -> Option; + pub fn get_mip_level(this: &GpuTexelCopyTextureInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "mipLevel")] - pub fn set_mip_level(this: &GpuImageCopyTexture, val: u32); + pub fn set_mip_level(this: &GpuTexelCopyTextureInfo, val: u32); #[cfg(web_sys_unstable_apis)] #[doc = "Get the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "origin")] - pub fn get_origin(this: &GpuImageCopyTexture) -> ::wasm_bindgen::JsValue; + pub fn get_origin(this: &GpuTexelCopyTextureInfo) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "origin")] - pub fn set_origin(this: &GpuImageCopyTexture, val: &::wasm_bindgen::JsValue); + pub fn set_origin(this: &GpuTexelCopyTextureInfo, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTexture")] #[doc = "Get the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, getter = "texture")] - pub fn get_texture(this: &GpuImageCopyTexture) -> GpuTexture; + pub fn get_texture(this: &GpuTexelCopyTextureInfo) -> GpuTexture; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTexture")] #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[wasm_bindgen(method, setter = "texture")] - pub fn set_texture(this: &GpuImageCopyTexture, val: &GpuTexture); + pub fn set_texture(this: &GpuTexelCopyTextureInfo, val: &GpuTexture); } #[cfg(web_sys_unstable_apis)] -impl GpuImageCopyTexture { +impl GpuTexelCopyTextureInfo { #[cfg(feature = "GpuTexture")] - #[doc = "Construct a new `GpuImageCopyTexture`."] + #[doc = "Construct a new `GpuTexelCopyTextureInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuVertexFormat.rs b/crates/web-sys/src/features/gen_GpuVertexFormat.rs index 783adc5387f..9c380d45895 100644 --- a/crates/web-sys/src/features/gen_GpuVertexFormat.rs +++ b/crates/web-sys/src/features/gen_GpuVertexFormat.rs @@ -11,22 +11,31 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuVertexFormat { + Uint8 = "uint8", Uint8x2 = "uint8x2", Uint8x4 = "uint8x4", + Sint8 = "sint8", Sint8x2 = "sint8x2", Sint8x4 = "sint8x4", + Unorm8 = "unorm8", Unorm8x2 = "unorm8x2", Unorm8x4 = "unorm8x4", + Snorm8 = "snorm8", Snorm8x2 = "snorm8x2", Snorm8x4 = "snorm8x4", + Uint16 = "uint16", Uint16x2 = "uint16x2", Uint16x4 = "uint16x4", + Sint16 = "sint16", Sint16x2 = "sint16x2", Sint16x4 = "sint16x4", + Unorm16 = "unorm16", Unorm16x2 = "unorm16x2", Unorm16x4 = "unorm16x4", + Snorm16 = "snorm16", Snorm16x2 = "snorm16x2", Snorm16x4 = "snorm16x4", + Float16 = "float16", Float16x2 = "float16x2", Float16x4 = "float16x4", Float32 = "float32", @@ -42,4 +51,5 @@ pub enum GpuVertexFormat { Sint32x3 = "sint32x3", Sint32x4 = "sint32x4", Unorm1010102 = "unorm10-10-10-2", + Unorm8x4Bgra = "unorm8x4-bgra", } diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index a22df0488a5..4ffc9995e6f 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -3323,6 +3323,20 @@ mod gen_GpuComputePipelineDescriptor; #[allow(unused_imports)] pub use gen_GpuComputePipelineDescriptor::*; +#[cfg(feature = "GpuCopyExternalImageDestInfo")] +#[allow(non_snake_case)] +mod gen_GpuCopyExternalImageDestInfo; +#[cfg(feature = "GpuCopyExternalImageDestInfo")] +#[allow(unused_imports)] +pub use gen_GpuCopyExternalImageDestInfo::*; + +#[cfg(feature = "GpuCopyExternalImageSourceInfo")] +#[allow(non_snake_case)] +mod gen_GpuCopyExternalImageSourceInfo; +#[cfg(feature = "GpuCopyExternalImageSourceInfo")] +#[allow(unused_imports)] +pub use gen_GpuCopyExternalImageSourceInfo::*; + #[cfg(feature = "GpuCullMode")] #[allow(non_snake_case)] mod gen_GpuCullMode; @@ -3435,41 +3449,6 @@ mod gen_GpuFrontFace; #[allow(unused_imports)] pub use gen_GpuFrontFace::*; -#[cfg(feature = "GpuImageCopyBuffer")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyBuffer; -#[cfg(feature = "GpuImageCopyBuffer")] -#[allow(unused_imports)] -pub use gen_GpuImageCopyBuffer::*; - -#[cfg(feature = "GpuImageCopyExternalImage")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyExternalImage; -#[cfg(feature = "GpuImageCopyExternalImage")] -#[allow(unused_imports)] -pub use gen_GpuImageCopyExternalImage::*; - -#[cfg(feature = "GpuImageCopyTexture")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyTexture; -#[cfg(feature = "GpuImageCopyTexture")] -#[allow(unused_imports)] -pub use gen_GpuImageCopyTexture::*; - -#[cfg(feature = "GpuImageCopyTextureTagged")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyTextureTagged; -#[cfg(feature = "GpuImageCopyTextureTagged")] -#[allow(unused_imports)] -pub use gen_GpuImageCopyTextureTagged::*; - -#[cfg(feature = "GpuImageDataLayout")] -#[allow(non_snake_case)] -mod gen_GpuImageDataLayout; -#[cfg(feature = "GpuImageDataLayout")] -#[allow(unused_imports)] -pub use gen_GpuImageDataLayout::*; - #[cfg(feature = "GpuIndexFormat")] #[allow(non_snake_case)] mod gen_GpuIndexFormat; @@ -3827,6 +3806,27 @@ mod gen_GpuSupportedLimits; #[allow(unused_imports)] pub use gen_GpuSupportedLimits::*; +#[cfg(feature = "GpuTexelCopyBufferInfo")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyBufferInfo; +#[cfg(feature = "GpuTexelCopyBufferInfo")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyBufferInfo::*; + +#[cfg(feature = "GpuTexelCopyBufferLayout")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyBufferLayout; +#[cfg(feature = "GpuTexelCopyBufferLayout")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyBufferLayout::*; + +#[cfg(feature = "GpuTexelCopyTextureInfo")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyTextureInfo; +#[cfg(feature = "GpuTexelCopyTextureInfo")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyTextureInfo::*; + #[cfg(feature = "GpuTexture")] #[allow(non_snake_case)] mod gen_GpuTexture; diff --git a/crates/web-sys/webidls/unstable/WebGPU.webidl b/crates/web-sys/webidls/unstable/WebGPU.webidl index c5b6912b231..56e8130ab1c 100644 --- a/crates/web-sys/webidls/unstable/WebGPU.webidl +++ b/crates/web-sys/webidls/unstable/WebGPU.webidl @@ -1,4 +1,4 @@ -// https://www.w3.org/TR/2024/WD-webgpu-20241007 +// https://www.w3.org/TR/2024/WD-webgpu-20241122/ interface mixin GPUObjectBase { attribute USVString label; @@ -75,9 +75,10 @@ interface GPU { }; dictionary GPURequestAdapterOptions { - DOMString featureLevel; + DOMString featureLevel = "core"; GPUPowerPreference powerPreference; boolean forceFallbackAdapter = false; + boolean xrCompatible = false; }; enum GPUPowerPreference { @@ -116,6 +117,7 @@ enum GPUFeatureName { "rg11b10ufloat-renderable", "bgra8unorm-storage", "float32-filterable", + "float32-blendable", "clip-distances", "dual-source-blending", }; @@ -124,6 +126,7 @@ enum GPUFeatureName { interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; + [SameObject] readonly attribute GPUAdapterInfo adapterInfo; [SameObject] readonly attribute GPUQueue queue; @@ -575,7 +578,7 @@ GPUPipelineLayout includes GPUObjectBase; dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { - required sequence bindGroupLayouts; + required sequence bindGroupLayouts; }; [Exposed=(Window, Worker), SecureContext] @@ -815,22 +818,31 @@ enum GPUIndexFormat { }; enum GPUVertexFormat { + "uint8", "uint8x2", "uint8x4", + "sint8", "sint8x2", "sint8x4", + "unorm8", "unorm8x2", "unorm8x4", + "snorm8", "snorm8x2", "snorm8x4", + "uint16", "uint16x2", "uint16x4", + "sint16", "sint16x2", "sint16x4", + "unorm16", "unorm16x2", "unorm16x4", + "snorm16", "snorm16x2", "snorm16x4", + "float16", "float16x2", "float16x4", "float32", @@ -846,6 +858,7 @@ enum GPUVertexFormat { "sint32x3", "sint32x4", "unorm10-10-10-2", + "unorm8x4-bgra", }; enum GPUVertexStepMode { @@ -871,26 +884,26 @@ dictionary GPUVertexAttribute { required GPUIndex32 shaderLocation; }; -dictionary GPUImageDataLayout { +dictionary GPUTexelCopyBufferLayout { GPUSize64 offset = 0; GPUSize32 bytesPerRow; GPUSize32 rowsPerImage; }; -dictionary GPUImageCopyBuffer - : GPUImageDataLayout { +dictionary GPUTexelCopyBufferInfo + : GPUTexelCopyBufferLayout { required GPUBuffer buffer; }; -dictionary GPUImageCopyTexture { +dictionary GPUTexelCopyTextureInfo { required GPUTexture texture; GPUIntegerCoordinate mipLevel = 0; GPUOrigin3D origin = {}; GPUTextureAspect aspect = "all"; }; -dictionary GPUImageCopyTextureTagged - : GPUImageCopyTexture { +dictionary GPUCopyExternalImageDestInfo + : GPUTexelCopyTextureInfo { PredefinedColorSpace colorSpace = "srgb"; boolean premultipliedAlpha = false; }; @@ -901,10 +914,10 @@ typedef (ImageBitmap or HTMLVideoElement or VideoFrame or HTMLCanvasElement or - OffscreenCanvas) GPUImageCopyExternalImageSource; + OffscreenCanvas) GPUCopyExternalImageSource; -dictionary GPUImageCopyExternalImage { - required GPUImageCopyExternalImageSource source; +dictionary GPUCopyExternalImageSourceInfo { + required GPUCopyExternalImageSource source; GPUOrigin2D origin = {}; boolean flipY = false; }; @@ -927,6 +940,7 @@ interface GPUCommandEncoder { GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {}); + [Throws] undefined copyBufferToBuffer( GPUBuffer source, GPUSize64 sourceOffset, @@ -936,20 +950,20 @@ interface GPUCommandEncoder { [Throws] undefined copyBufferToTexture( - GPUImageCopyBuffer source, - GPUImageCopyTexture destination, + GPUTexelCopyBufferInfo source, + GPUTexelCopyTextureInfo destination, GPUExtent3D copySize); [Throws] undefined copyTextureToBuffer( - GPUImageCopyTexture source, - GPUImageCopyBuffer destination, + GPUTexelCopyTextureInfo source, + GPUTexelCopyBufferInfo destination, GPUExtent3D copySize); [Throws] undefined copyTextureToTexture( - GPUImageCopyTexture source, - GPUImageCopyTexture destination, + GPUTexelCopyTextureInfo source, + GPUTexelCopyTextureInfo destination, GPUExtent3D copySize); undefined clearBuffer( @@ -1158,15 +1172,15 @@ interface GPUQueue { [Throws] undefined writeTexture( - GPUImageCopyTexture destination, + GPUTexelCopyTextureInfo destination, AllowSharedBufferSource data, - GPUImageDataLayout dataLayout, + GPUTexelCopyBufferLayout dataLayout, GPUExtent3D size); [Throws] undefined copyExternalImageToTexture( - GPUImageCopyExternalImage source, - GPUImageCopyTextureTagged destination, + GPUCopyExternalImageSourceInfo source, + GPUCopyExternalImageDestInfo destination, GPUExtent3D copySize); }; GPUQueue includes GPUObjectBase; @@ -1291,7 +1305,6 @@ dictionary GPUUncapturedErrorEventInit : EventInit { }; partial interface GPUDevice { - [Exposed=(Window, Worker)] attribute EventHandler onuncapturederror; }; diff --git a/crates/webidl/src/generator.rs b/crates/webidl/src/generator.rs index aa7b9e26bbb..5083f4fccdf 100644 --- a/crates/webidl/src/generator.rs +++ b/crates/webidl/src/generator.rs @@ -445,8 +445,10 @@ impl InterfaceMethod<'_> { let js_name = raw_ident(js_name); extra_args.push(quote!( js_name = #js_name )); } + let method_buffer; let method = if *is_static { - &format!("{js_name}_static") + method_buffer = format!("{js_name}_static"); + &method_buffer } else { js_name };