mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-19 07:51:26 +00:00
Update to latest WebGPU WebIDL (#2037)
This commit is contained in:
@ -4,21 +4,21 @@ use wasm_bindgen::prelude::*;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupBinding ) ]
|
||||
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupEntry ) ]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[doc = "The `GpuBindGroupBinding` dictionary."]
|
||||
#[doc = "The `GpuBindGroupEntry` dictionary."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub type GpuBindGroupBinding;
|
||||
pub type GpuBindGroupEntry;
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
impl GpuBindGroupBinding {
|
||||
#[doc = "Construct a new `GpuBindGroupBinding`."]
|
||||
impl GpuBindGroupEntry {
|
||||
#[doc = "Construct a new `GpuBindGroupEntry`."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -32,7 +32,7 @@ impl GpuBindGroupBinding {
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `binding` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -53,7 +53,7 @@ impl GpuBindGroupBinding {
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `resource` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
@ -4,22 +4,22 @@ use wasm_bindgen::prelude::*;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutBinding ) ]
|
||||
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = GPUBindGroupLayoutEntry ) ]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[doc = "The `GpuBindGroupLayoutBinding` dictionary."]
|
||||
#[doc = "The `GpuBindGroupLayoutEntry` dictionary."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub type GpuBindGroupLayoutBinding;
|
||||
pub type GpuBindGroupLayoutEntry;
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
impl GpuBindGroupLayoutBinding {
|
||||
impl GpuBindGroupLayoutEntry {
|
||||
#[cfg(feature = "GpuBindingType")]
|
||||
#[doc = "Construct a new `GpuBindGroupLayoutBinding`."]
|
||||
#[doc = "Construct a new `GpuBindGroupLayoutEntry`."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuBindingType`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBindingType`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -34,7 +34,7 @@ impl GpuBindGroupLayoutBinding {
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `binding` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -55,7 +55,7 @@ impl GpuBindGroupLayoutBinding {
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `hasDynamicOffset` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -76,7 +76,7 @@ impl GpuBindGroupLayoutBinding {
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `multisampled` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -95,10 +95,32 @@ impl GpuBindGroupLayoutBinding {
|
||||
self
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "GpuTextureFormat")]
|
||||
#[doc = "Change the `storageTextureFormat` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureFormat`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn storage_texture_format(&mut self, val: GpuTextureFormat) -> &mut Self {
|
||||
use wasm_bindgen::JsValue;
|
||||
let r = ::js_sys::Reflect::set(
|
||||
self.as_ref(),
|
||||
&JsValue::from("storageTextureFormat"),
|
||||
&JsValue::from(val),
|
||||
);
|
||||
debug_assert!(
|
||||
r.is_ok(),
|
||||
"setting properties should never fail on our dictionary objects"
|
||||
);
|
||||
let _ = r;
|
||||
self
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "GpuTextureComponentType")]
|
||||
#[doc = "Change the `textureComponentType` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuTextureComponentType`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureComponentType`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -117,32 +139,10 @@ impl GpuBindGroupLayoutBinding {
|
||||
self
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "GpuTextureViewDimension")]
|
||||
#[doc = "Change the `textureDimension` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuTextureViewDimension`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn 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(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "GpuBindingType")]
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`, `GpuBindingType`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBindingType`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
@ -157,9 +157,31 @@ impl GpuBindGroupLayoutBinding {
|
||||
self
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "GpuTextureViewDimension")]
|
||||
#[doc = "Change the `viewDimension` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureViewDimension`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self {
|
||||
use wasm_bindgen::JsValue;
|
||||
let r = ::js_sys::Reflect::set(
|
||||
self.as_ref(),
|
||||
&JsValue::from("viewDimension"),
|
||||
&JsValue::from(val),
|
||||
);
|
||||
debug_assert!(
|
||||
r.is_ok(),
|
||||
"setting properties should never fail on our dictionary objects"
|
||||
);
|
||||
let _ = r;
|
||||
self
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `visibility` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutBinding`*"]
|
||||
#[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
@ -14,6 +14,8 @@ pub enum GpuBindingType {
|
||||
StorageBuffer = "storage-buffer",
|
||||
ReadonlyStorageBuffer = "readonly-storage-buffer",
|
||||
Sampler = "sampler",
|
||||
ComparisonSampler = "comparison-sampler",
|
||||
SampledTexture = "sampled-texture",
|
||||
StorageTexture = "storage-texture",
|
||||
ReadonlyStorageTexture = "readonly-storage-texture",
|
||||
WriteonlyStorageTexture = "writeonly-storage-texture",
|
||||
}
|
||||
|
@ -23,11 +23,10 @@ impl GpuBufferCopyView {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn new(buffer: &GpuBuffer, image_height: u32, row_pitch: u32) -> Self {
|
||||
pub fn new(buffer: &GpuBuffer, 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
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ impl GpuShaderModuleDescriptor {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn new(code: &::wasm_bindgen::JsValue) -> Self {
|
||||
pub fn new(code: &str) -> Self {
|
||||
#[allow(unused_mut)]
|
||||
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
|
||||
ret.code(code);
|
||||
@ -52,7 +52,7 @@ impl GpuShaderModuleDescriptor {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn code(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
||||
pub fn code(&mut self, val: &str) -> &mut Self {
|
||||
use wasm_bindgen::JsValue;
|
||||
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val));
|
||||
debug_assert!(
|
||||
|
@ -2104,36 +2104,36 @@ mod gen_GpuBindGroup;
|
||||
#[cfg(feature = "GpuBindGroup")]
|
||||
pub use gen_GpuBindGroup::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupBinding")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupBinding;
|
||||
#[cfg(feature = "GpuBindGroupBinding")]
|
||||
pub use gen_GpuBindGroupBinding::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupDescriptor")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupDescriptor;
|
||||
#[cfg(feature = "GpuBindGroupDescriptor")]
|
||||
pub use gen_GpuBindGroupDescriptor::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupEntry")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupEntry;
|
||||
#[cfg(feature = "GpuBindGroupEntry")]
|
||||
pub use gen_GpuBindGroupEntry::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupLayout")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupLayout;
|
||||
#[cfg(feature = "GpuBindGroupLayout")]
|
||||
pub use gen_GpuBindGroupLayout::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupLayoutBinding")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupLayoutBinding;
|
||||
#[cfg(feature = "GpuBindGroupLayoutBinding")]
|
||||
pub use gen_GpuBindGroupLayoutBinding::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupLayoutDescriptor")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupLayoutDescriptor;
|
||||
#[cfg(feature = "GpuBindGroupLayoutDescriptor")]
|
||||
pub use gen_GpuBindGroupLayoutDescriptor::*;
|
||||
|
||||
#[cfg(feature = "GpuBindGroupLayoutEntry")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindGroupLayoutEntry;
|
||||
#[cfg(feature = "GpuBindGroupLayoutEntry")]
|
||||
pub use gen_GpuBindGroupLayoutEntry::*;
|
||||
|
||||
#[cfg(feature = "GpuBindingType")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_GpuBindingType;
|
||||
|
Reference in New Issue
Block a user