diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index 2a1efa21577..32cb282e2cb 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -404,6 +404,7 @@ GetUserMediaRequest = [] Gpu = [] GpuAdapter = [] GpuAdapterFeatures = [] +GpuAdapterLimits = [] GpuAddressMode = [] GpuBindGroup = [] GpuBindGroupDescriptor = [] @@ -411,18 +412,19 @@ GpuBindGroupEntry = [] GpuBindGroupLayout = [] GpuBindGroupLayoutDescriptor = [] GpuBindGroupLayoutEntry = [] -GpuBindingType = [] -GpuBlendDescriptor = [] +GpuBlendComponent = [] GpuBlendFactor = [] GpuBlendOperation = [] +GpuBlendState = [] GpuBuffer = [] GpuBufferBinding = [] -GpuBufferCopyView = [] +GpuBufferBindingLayout = [] +GpuBufferBindingType = [] GpuBufferDescriptor = [] GpuBufferUsage = [] GpuCanvasContext = [] GpuColorDict = [] -GpuColorStateDescriptor = [] +GpuColorTargetState = [] GpuColorWrite = [] GpuCommandBuffer = [] GpuCommandBufferDescriptor = [] @@ -437,23 +439,26 @@ GpuComputePassEncoder = [] GpuComputePipeline = [] GpuComputePipelineDescriptor = [] GpuCullMode = [] -GpuDepthStencilStateDescriptor = [] +GpuDepthStencilState = [] GpuDevice = ["EventTarget"] GpuDeviceDescriptor = [] GpuDeviceLostInfo = [] +GpuDeviceLostReason = [] GpuErrorFilter = [] GpuExtent3dDict = [] GpuFeatureName = [] -GpuFence = [] -GpuFenceDescriptor = [] GpuFilterMode = [] +GpuFragmentState = [] GpuFrontFace = [] -GpuImageBitmapCopyView = [] +GpuImageCopyBuffer = [] +GpuImageCopyImageBitmap = [] +GpuImageCopyTexture = [] +GpuImageDataLayout = [] GpuIndexFormat = [] GpuInputStepMode = [] -GpuLimits = [] GpuLoadOp = [] GpuMapMode = [] +GpuMultisampleState = [] GpuObjectDescriptorBase = [] GpuOrigin2dDict = [] GpuOrigin3dDict = [] @@ -463,42 +468,45 @@ GpuPipelineLayout = [] GpuPipelineLayoutDescriptor = [] GpuPipelineStatisticName = [] GpuPowerPreference = [] +GpuPrimitiveState = [] GpuPrimitiveTopology = [] -GpuProgrammableStageDescriptor = [] +GpuProgrammableStage = [] GpuQuerySet = [] GpuQuerySetDescriptor = [] GpuQueryType = [] GpuQueue = [] -GpuRasterizationStateDescriptor = [] GpuRenderBundle = [] GpuRenderBundleDescriptor = [] GpuRenderBundleEncoder = [] GpuRenderBundleEncoderDescriptor = [] -GpuRenderPassColorAttachmentDescriptor = [] -GpuRenderPassDepthStencilAttachmentDescriptor = [] +GpuRenderPassColorAttachment = [] +GpuRenderPassDepthStencilAttachment = [] GpuRenderPassDescriptor = [] GpuRenderPassEncoder = [] GpuRenderPipeline = [] GpuRenderPipelineDescriptor = [] GpuRequestAdapterOptions = [] GpuSampler = [] +GpuSamplerBindingLayout = [] +GpuSamplerBindingType = [] GpuSamplerDescriptor = [] GpuShaderModule = [] GpuShaderModuleDescriptor = [] GpuShaderStage = [] +GpuStencilFaceState = [] GpuStencilOperation = [] -GpuStencilStateFaceDescriptor = [] +GpuStorageTextureAccess = [] +GpuStorageTextureBindingLayout = [] GpuStoreOp = [] GpuSwapChain = [] GpuSwapChainDescriptor = [] GpuTexture = [] GpuTextureAspect = [] -GpuTextureComponentType = [] -GpuTextureCopyView = [] -GpuTextureDataLayout = [] +GpuTextureBindingLayout = [] GpuTextureDescriptor = [] GpuTextureDimension = [] GpuTextureFormat = [] +GpuTextureSampleType = [] GpuTextureUsage = [] GpuTextureView = [] GpuTextureViewDescriptor = [] @@ -506,10 +514,10 @@ GpuTextureViewDimension = [] GpuUncapturedErrorEvent = ["Event"] GpuUncapturedErrorEventInit = [] GpuValidationError = [] -GpuVertexAttributeDescriptor = [] -GpuVertexBufferLayoutDescriptor = [] +GpuVertexAttribute = [] +GpuVertexBufferLayout = [] GpuVertexFormat = [] -GpuVertexStateDescriptor = [] +GpuVertexState = [] GridDeclaration = [] GridTrackState = [] GroupedHistoryEventInit = [] diff --git a/crates/web-sys/src/features/gen_GpuAdapter.rs b/crates/web-sys/src/features/gen_GpuAdapter.rs index e3121c882b7..70b2859dbac 100644 --- a/crates/web-sys/src/features/gen_GpuAdapter.rs +++ b/crates/web-sys/src/features/gen_GpuAdapter.rs @@ -39,6 +39,18 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn features(this: &GpuAdapter) -> GpuAdapterFeatures; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAdapterLimits")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = limits)] + #[doc = "Getter for the `limits` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/limits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn limits(this: &GpuAdapter) -> GpuAdapterLimits; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)] #[doc = "The `requestDevice()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuAdapterLimits.rs b/crates/web-sys/src/features/gen_GpuAdapterLimits.rs new file mode 100644 index 00000000000..6f8fd946dc5 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuAdapterLimits.rs @@ -0,0 +1,205 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUAdapterLimits , typescript_type = "GPUAdapterLimits")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuAdapterLimits` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` 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 GpuAdapterLimits; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxTextureDimension1D)] + #[doc = "Getter for the `maxTextureDimension1D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxTextureDimension1D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_1d(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxTextureDimension2D)] + #[doc = "Getter for the `maxTextureDimension2D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxTextureDimension2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_2d(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxTextureDimension3D)] + #[doc = "Getter for the `maxTextureDimension3D` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxTextureDimension3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_dimension_3d(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxTextureArrayLayers)] + #[doc = "Getter for the `maxTextureArrayLayers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxTextureArrayLayers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_texture_array_layers(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxBindGroups)] + #[doc = "Getter for the `maxBindGroups` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxBindGroups)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bind_groups(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxDynamicUniformBuffersPerPipelineLayout)] + #[doc = "Getter for the `maxDynamicUniformBuffersPerPipelineLayout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxDynamicUniformBuffersPerPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_dynamic_uniform_buffers_per_pipeline_layout(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxDynamicStorageBuffersPerPipelineLayout)] + #[doc = "Getter for the `maxDynamicStorageBuffersPerPipelineLayout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxDynamicStorageBuffersPerPipelineLayout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_dynamic_storage_buffers_per_pipeline_layout(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxSampledTexturesPerShaderStage)] + #[doc = "Getter for the `maxSampledTexturesPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxSampledTexturesPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_sampled_textures_per_shader_stage(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxSamplersPerShaderStage)] + #[doc = "Getter for the `maxSamplersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxSamplersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_samplers_per_shader_stage(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxStorageBuffersPerShaderStage)] + #[doc = "Getter for the `maxStorageBuffersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxStorageBuffersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_buffers_per_shader_stage(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxStorageTexturesPerShaderStage)] + #[doc = "Getter for the `maxStorageTexturesPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxStorageTexturesPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_textures_per_shader_stage(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxUniformBuffersPerShaderStage)] + #[doc = "Getter for the `maxUniformBuffersPerShaderStage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxUniformBuffersPerShaderStage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_uniform_buffers_per_shader_stage(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxUniformBufferBindingSize)] + #[doc = "Getter for the `maxUniformBufferBindingSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxUniformBufferBindingSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_uniform_buffer_binding_size(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxStorageBufferBindingSize)] + #[doc = "Getter for the `maxStorageBufferBindingSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxStorageBufferBindingSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_storage_buffer_binding_size(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxVertexBuffers)] + #[doc = "Getter for the `maxVertexBuffers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxVertexBuffers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_buffers(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxVertexAttributes)] + #[doc = "Getter for the `maxVertexAttributes` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxVertexAttributes)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_attributes(this: &GpuAdapterLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterLimits" , js_name = maxVertexBufferArrayStride)] + #[doc = "Getter for the `maxVertexBufferArrayStride` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterLimits/maxVertexBufferArrayStride)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_vertex_buffer_array_stride(this: &GpuAdapterLimits) -> u32; +} diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs index da0d529966a..4e9979995ce 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs @@ -16,18 +16,16 @@ extern "C" { } #[cfg(web_sys_unstable_apis)] impl GpuBindGroupLayoutEntry { - #[cfg(feature = "GpuBindingType")] #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBindingType`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(binding: u32, type_: GpuBindingType, visibility: u32) -> Self { + pub fn new(binding: u32, visibility: u32) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret.binding(binding); - ret.type_(type_); ret.visibility(visibility); ret } @@ -53,19 +51,17 @@ impl GpuBindGroupLayoutEntry { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `hasDynamicOffset` field of this object."] + #[cfg(feature = "GpuBufferBindingLayout")] + #[doc = "Change the `buffer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBufferBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { + pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasDynamicOffset"), - &JsValue::from(val), - ); + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" @@ -74,17 +70,18 @@ impl GpuBindGroupLayoutEntry { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `minBufferBindingSize` field of this object."] + #[cfg(feature = "GpuSamplerBindingLayout")] + #[doc = "Change the `sampler` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuSamplerBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn min_buffer_binding_size(&mut self, val: f64) -> &mut Self { + pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("minBufferBindingSize"), + &JsValue::from("sampler"), &JsValue::from(val), ); debug_assert!( @@ -95,18 +92,18 @@ impl GpuBindGroupLayoutEntry { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Change the `storageTextureFormat` field of this object."] + #[cfg(feature = "GpuStorageTextureBindingLayout")] + #[doc = "Change the `storageTexture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuStorageTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn storage_texture_format(&mut self, val: GpuTextureFormat) -> &mut Self { + pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("storageTextureFormat"), + &JsValue::from("storageTexture"), &JsValue::from(val), ); debug_assert!( @@ -117,58 +114,18 @@ impl GpuBindGroupLayoutEntry { 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: `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)*"] - pub fn texture_component_type(&mut self, val: GpuTextureComponentType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("textureComponentType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(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: `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)*"] - pub fn type_(&mut self, val: GpuBindingType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureViewDimension")] - #[doc = "Change the `viewDimension` field of this object."] + #[cfg(feature = "GpuTextureBindingLayout")] + #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureViewDimension`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("viewDimension"), + &JsValue::from("texture"), &JsValue::from(val), ); debug_assert!( diff --git a/crates/web-sys/src/features/gen_GpuBindingType.rs b/crates/web-sys/src/features/gen_GpuBindingType.rs deleted file mode 100644 index 93b0b7f4ac5..00000000000 --- a/crates/web-sys/src/features/gen_GpuBindingType.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![allow(unused_imports)] -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -#[doc = "The `GpuBindingType` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `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)*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GpuBindingType { - UniformBuffer = "uniform-buffer", - StorageBuffer = "storage-buffer", - ReadonlyStorageBuffer = "readonly-storage-buffer", - Sampler = "sampler", - ComparisonSampler = "comparison-sampler", - SampledTexture = "sampled-texture", - MultisampledTexture = "multisampled-texture", - ReadonlyStorageTexture = "readonly-storage-texture", - WriteonlyStorageTexture = "writeonly-storage-texture", -} diff --git a/crates/web-sys/src/features/gen_GpuBlendDescriptor.rs b/crates/web-sys/src/features/gen_GpuBlendComponent.rs similarity index 89% rename from crates/web-sys/src/features/gen_GpuBlendDescriptor.rs rename to crates/web-sys/src/features/gen_GpuBlendComponent.rs index 4514a656233..b1679cfca0e 100644 --- a/crates/web-sys/src/features/gen_GpuBlendDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBlendComponent.rs @@ -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 = GPUBlendDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBlendComponent)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuBlendDescriptor` dictionary."] + #[doc = "The `GpuBlendComponent` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuBlendDescriptor; + pub type GpuBlendComponent; } #[cfg(web_sys_unstable_apis)] -impl GpuBlendDescriptor { - #[doc = "Construct a new `GpuBlendDescriptor`."] +impl GpuBlendComponent { + #[doc = "Construct a new `GpuBlendComponent`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -31,7 +31,7 @@ impl GpuBlendDescriptor { #[cfg(feature = "GpuBlendFactor")] #[doc = "Change the `dstFactor` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendFactor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +53,7 @@ impl GpuBlendDescriptor { #[cfg(feature = "GpuBlendOperation")] #[doc = "Change the `operation` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendOperation`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendOperation`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -75,7 +75,7 @@ impl GpuBlendDescriptor { #[cfg(feature = "GpuBlendFactor")] #[doc = "Change the `srcFactor` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuBlendFactor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuFenceDescriptor.rs b/crates/web-sys/src/features/gen_GpuBlendState.rs similarity index 69% rename from crates/web-sys/src/features/gen_GpuFenceDescriptor.rs rename to crates/web-sys/src/features/gen_GpuBlendState.rs index 1bba7fd8875..3d9204ae7e0 100644 --- a/crates/web-sys/src/features/gen_GpuFenceDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBlendState.rs @@ -4,39 +4,43 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUFenceDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBlendState)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuFenceDescriptor` dictionary."] + #[doc = "The `GpuBlendState` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuFenceDescriptor; + pub type GpuBlendState; } #[cfg(web_sys_unstable_apis)] -impl GpuFenceDescriptor { - #[doc = "Construct a new `GpuFenceDescriptor`."] +impl GpuBlendState { + #[cfg(feature = "GpuBlendComponent")] + #[doc = "Construct a new `GpuBlendState`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { + pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.alpha(alpha); + ret.color(color); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `label` field of this object."] + #[cfg(feature = "GpuBlendComponent")] + #[doc = "Change the `alpha` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { + pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" @@ -45,19 +49,16 @@ impl GpuFenceDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `initialValue` field of this object."] + #[cfg(feature = "GpuBlendComponent")] + #[doc = "Change the `color` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFenceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn initial_value(&mut self, val: f64) -> &mut Self { + pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initialValue"), - &JsValue::from(val), - ); + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" diff --git a/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs new file mode 100644 index 00000000000..276c484bc3d --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs @@ -0,0 +1,90 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuBufferBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuBufferBindingLayout; +} +#[cfg(web_sys_unstable_apis)] +impl GpuBufferBindingLayout { + #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[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: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("hasDynamicOffset"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `minBindingSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn min_binding_size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("minBindingSize"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferBindingType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`, `GpuBufferBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(&mut self, val: GpuBufferBindingType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuBufferBindingType.rs b/crates/web-sys/src/features/gen_GpuBufferBindingType.rs new file mode 100644 index 00000000000..8be5d8fe774 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferBindingType.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuBufferBindingType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBufferBindingType { + Uniform = "uniform", + Storage = "storage", + ReadOnlyStorage = "read-only-storage", +} diff --git a/crates/web-sys/src/features/gen_GpuCanvasContext.rs b/crates/web-sys/src/features/gen_GpuCanvasContext.rs index 55e1a29f439..044819641cd 100644 --- a/crates/web-sys/src/features/gen_GpuCanvasContext.rs +++ b/crates/web-sys/src/features/gen_GpuCanvasContext.rs @@ -31,18 +31,18 @@ extern "C" { descriptor: &GpuSwapChainDescriptor, ) -> GpuSwapChain; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuDevice")] + #[cfg(all(feature = "GpuAdapter", feature = "GpuTextureFormat",))] # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getSwapChainPreferredFormat)] #[doc = "The `getSwapChainPreferredFormat()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getSwapChainPreferredFormat)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuDevice`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuCanvasContext`, `GpuTextureFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_swap_chain_preferred_format( this: &GpuCanvasContext, - device: &GpuDevice, - ) -> ::js_sys::Promise; + adapter: &GpuAdapter, + ) -> GpuTextureFormat; } diff --git a/crates/web-sys/src/features/gen_GpuColorTargetState.rs b/crates/web-sys/src/features/gen_GpuColorTargetState.rs new file mode 100644 index 00000000000..2e910d7b6cb --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuColorTargetState.rs @@ -0,0 +1,90 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorTargetState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuColorTargetState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuColorTargetState; +} +#[cfg(web_sys_unstable_apis)] +impl GpuColorTargetState { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuColorTargetState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendState")] + #[doc = "Change the `blend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `writeMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("writeMask"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs index 7dde1dd28e3..ac1e1b9959f 100644 --- a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs @@ -235,113 +235,113 @@ extern "C" { size: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuBufferCopyView", feature = "GpuTextureCopyView",))] + #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuBufferCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyBuffer, + destination: &GpuImageCopyTexture, copy_size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] #[cfg(all( - feature = "GpuBufferCopyView", feature = "GpuExtent3dDict", - feature = "GpuTextureCopyView", + feature = "GpuImageCopyBuffer", + feature = "GpuImageCopyTexture", ))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuBufferCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyBuffer, + destination: &GpuImageCopyTexture, copy_size: &GpuExtent3dDict, ); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuBufferCopyView", feature = "GpuTextureCopyView",))] + #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuTextureCopyView, - destination: &GpuBufferCopyView, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyBuffer, copy_size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] #[cfg(all( - feature = "GpuBufferCopyView", feature = "GpuExtent3dDict", - feature = "GpuTextureCopyView", + feature = "GpuImageCopyBuffer", + feature = "GpuImageCopyTexture", ))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`, `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuTextureCopyView, - destination: &GpuBufferCopyView, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyBuffer, copy_size: &GpuExtent3dDict, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureCopyView")] + #[cfg(feature = "GpuImageCopyTexture")] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuTextureCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyTexture, copy_size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuTextureCopyView",))] + #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuImageCopyTexture",))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuTextureCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyTexture, + destination: &GpuImageCopyTexture, copy_size: &GpuExtent3dDict, ); #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs index 023992855bb..1f8e089bbe9 100644 --- a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs @@ -16,17 +16,17 @@ extern "C" { } #[cfg(web_sys_unstable_apis)] impl GpuComputePipelineDescriptor { - #[cfg(feature = "GpuProgrammableStageDescriptor")] + #[cfg(feature = "GpuProgrammableStage")] #[doc = "Construct a new `GpuComputePipelineDescriptor`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStageDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(compute_stage: &GpuProgrammableStageDescriptor) -> Self { + pub fn new(compute: &GpuProgrammableStage) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.compute_stage(compute_stage); + ret.compute(compute); ret } #[cfg(web_sys_unstable_apis)] @@ -66,18 +66,18 @@ impl GpuComputePipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuProgrammableStageDescriptor")] - #[doc = "Change the `computeStage` field of this object."] + #[cfg(feature = "GpuProgrammableStage")] + #[doc = "Change the `compute` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStageDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compute_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { + pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("computeStage"), + &JsValue::from("compute"), &JsValue::from(val), ); debug_assert!( diff --git a/crates/web-sys/src/features/gen_GpuLimits.rs b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs similarity index 68% rename from crates/web-sys/src/features/gen_GpuLimits.rs rename to crates/web-sys/src/features/gen_GpuDepthStencilState.rs index 3327489a4f4..4070a4c87d3 100644 --- a/crates/web-sys/src/features/gen_GpuLimits.rs +++ b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs @@ -4,41 +4,43 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPULimits)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUDepthStencilState)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuLimits` dictionary."] + #[doc = "The `GpuDepthStencilState` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuLimits; + pub type GpuDepthStencilState; } #[cfg(web_sys_unstable_apis)] -impl GpuLimits { - #[doc = "Construct a new `GpuLimits`."] +impl GpuDepthStencilState { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuDepthStencilState`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { + pub fn new(format: GpuTextureFormat) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.format(format); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxBindGroups` field of this object."] + #[doc = "Change the `clampDepth` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_bind_groups(&mut self, val: u32) -> &mut Self { + pub fn clamp_depth(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxBindGroups"), + &JsValue::from("clampDepth"), &JsValue::from(val), ); debug_assert!( @@ -49,17 +51,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxDynamicStorageBuffersPerPipelineLayout` field of this object."] + #[doc = "Change the `depthBias` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_dynamic_storage_buffers_per_pipeline_layout(&mut self, val: u32) -> &mut Self { + pub fn depth_bias(&mut self, val: i32) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxDynamicStorageBuffersPerPipelineLayout"), + &JsValue::from("depthBias"), &JsValue::from(val), ); debug_assert!( @@ -70,17 +72,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxDynamicUniformBuffersPerPipelineLayout` field of this object."] + #[doc = "Change the `depthBiasClamp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_dynamic_uniform_buffers_per_pipeline_layout(&mut self, val: u32) -> &mut Self { + pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxDynamicUniformBuffersPerPipelineLayout"), + &JsValue::from("depthBiasClamp"), &JsValue::from(val), ); debug_assert!( @@ -91,17 +93,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxSampledTexturesPerShaderStage` field of this object."] + #[doc = "Change the `depthBiasSlopeScale` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_sampled_textures_per_shader_stage(&mut self, val: u32) -> &mut Self { + pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxSampledTexturesPerShaderStage"), + &JsValue::from("depthBiasSlopeScale"), &JsValue::from(val), ); debug_assert!( @@ -112,17 +114,18 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxSamplersPerShaderStage` field of this object."] + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Change the `depthCompare` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_samplers_per_shader_stage(&mut self, val: u32) -> &mut Self { + pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxSamplersPerShaderStage"), + &JsValue::from("depthCompare"), &JsValue::from(val), ); debug_assert!( @@ -133,17 +136,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxStorageBufferBindingSize` field of this object."] + #[doc = "Change the `depthWriteEnabled` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_storage_buffer_binding_size(&mut self, val: u32) -> &mut Self { + pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxStorageBufferBindingSize"), + &JsValue::from("depthWriteEnabled"), &JsValue::from(val), ); debug_assert!( @@ -154,17 +157,37 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxStorageBuffersPerShaderStage` field of this object."] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_storage_buffers_per_shader_stage(&mut self, val: u32) -> &mut Self { + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilFaceState")] + #[doc = "Change the `stencilBack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxStorageBuffersPerShaderStage"), + &JsValue::from("stencilBack"), &JsValue::from(val), ); debug_assert!( @@ -175,17 +198,18 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxStorageTexturesPerShaderStage` field of this object."] + #[cfg(feature = "GpuStencilFaceState")] + #[doc = "Change the `stencilFront` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_storage_textures_per_shader_stage(&mut self, val: u32) -> &mut Self { + pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxStorageTexturesPerShaderStage"), + &JsValue::from("stencilFront"), &JsValue::from(val), ); debug_assert!( @@ -196,17 +220,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxUniformBufferBindingSize` field of this object."] + #[doc = "Change the `stencilReadMask` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_uniform_buffer_binding_size(&mut self, val: u32) -> &mut Self { + pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxUniformBufferBindingSize"), + &JsValue::from("stencilReadMask"), &JsValue::from(val), ); debug_assert!( @@ -217,17 +241,17 @@ impl GpuLimits { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `maxUniformBuffersPerShaderStage` field of this object."] + #[doc = "Change the `stencilWriteMask` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuLimits`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_uniform_buffers_per_shader_stage(&mut self, val: u32) -> &mut Self { + pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("maxUniformBuffersPerShaderStage"), + &JsValue::from("stencilWriteMask"), &JsValue::from(val), ); debug_assert!( diff --git a/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs deleted file mode 100644 index e9e14ce45cd..00000000000 --- a/crates/web-sys/src/features/gen_GpuDepthStencilStateDescriptor.rs +++ /dev/null @@ -1,180 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUDepthStencilStateDescriptor)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuDepthStencilStateDescriptor` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` 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 GpuDepthStencilStateDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuDepthStencilStateDescriptor { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuDepthStencilStateDescriptor`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuTextureFormat`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuCompareFunction")] - #[doc = "Change the `depthCompare` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthCompare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depthWriteEnabled` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthWriteEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Change the `format` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuTextureFormat`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuStencilStateFaceDescriptor")] - #[doc = "Change the `stencilBack` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuStencilStateFaceDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_back(&mut self, val: &GpuStencilStateFaceDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilBack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuStencilStateFaceDescriptor")] - #[doc = "Change the `stencilFront` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuStencilStateFaceDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_front(&mut self, val: &GpuStencilStateFaceDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilFront"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `stencilReadMask` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `stencilWriteMask` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilWriteMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} diff --git a/crates/web-sys/src/features/gen_GpuDevice.rs b/crates/web-sys/src/features/gen_GpuDevice.rs index 2b2ce3b4065..744f3b9f068 100644 --- a/crates/web-sys/src/features/gen_GpuDevice.rs +++ b/crates/web-sys/src/features/gen_GpuDevice.rs @@ -51,16 +51,16 @@ extern "C" { pub fn limits(this: &GpuDevice) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuQueue")] - # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = defaultQueue)] - #[doc = "Getter for the `defaultQueue` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = queue)] + #[doc = "Getter for the `queue` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/defaultQueue)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/queue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn default_queue(this: &GpuDevice) -> GpuQueue; + pub fn queue(this: &GpuDevice) -> GpuQueue; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = lost)] #[doc = "Getter for the `lost` field of this object."] @@ -205,6 +205,21 @@ extern "C" { descriptor: &GpuComputePipelineDescriptor, ) -> GpuComputePipeline; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuComputePipelineDescriptor")] + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createComputePipelineAsync)] + #[doc = "The `createComputePipelineAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createComputePipelineAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_compute_pipeline_async( + this: &GpuDevice, + descriptor: &GpuComputePipelineDescriptor, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuPipelineLayout", feature = "GpuPipelineLayoutDescriptor",))] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createPipelineLayout)] #[doc = "The `createPipelineLayout()` method."] @@ -232,36 +247,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create_query_set(this: &GpuDevice, descriptor: &GpuQuerySetDescriptor) -> GpuQuerySet; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuComputePipelineDescriptor")] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createReadyComputePipeline)] - #[doc = "The `createReadyComputePipeline()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createReadyComputePipeline)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuDevice`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_ready_compute_pipeline( - this: &GpuDevice, - descriptor: &GpuComputePipelineDescriptor, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuRenderPipelineDescriptor")] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createReadyRenderPipeline)] - #[doc = "The `createReadyRenderPipeline()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createReadyRenderPipeline)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderPipelineDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_ready_render_pipeline( - this: &GpuDevice, - descriptor: &GpuRenderPipelineDescriptor, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuRenderBundleEncoder", feature = "GpuRenderBundleEncoderDescriptor", @@ -295,6 +280,21 @@ extern "C" { descriptor: &GpuRenderPipelineDescriptor, ) -> GpuRenderPipeline; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPipelineDescriptor")] + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipelineAsync)] + #[doc = "The `createRenderPipelineAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipelineAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_render_pipeline_async( + this: &GpuDevice, + descriptor: &GpuRenderPipelineDescriptor, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuSampler")] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createSampler)] #[doc = "The `createSampler()` method."] @@ -349,6 +349,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create_texture(this: &GpuDevice, descriptor: &GpuTextureDescriptor) -> GpuTexture; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = destroy)] + #[doc = "The `destroy()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/destroy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn destroy(this: &GpuDevice); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = popErrorScope)] #[doc = "The `popErrorScope()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs index d4535cfb179..776afd458b9 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs @@ -45,17 +45,17 @@ impl GpuDeviceDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `features` field of this object."] + #[doc = "Change the `nonGuaranteedFeatures` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + pub fn non_guaranteed_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("features"), + &JsValue::from("nonGuaranteedFeatures"), &JsValue::from(val), ); debug_assert!( @@ -65,23 +65,4 @@ impl GpuDeviceDescriptor { let _ = r; self } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuLimits")] - #[doc = "Change the `limits` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuLimits`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn limits(&mut self, val: &GpuLimits) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("limits"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } } diff --git a/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs index dc75a603440..bcc59f58ebc 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs @@ -16,6 +16,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDeviceLostInfo; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = reason)] + #[doc = "Getter for the `reason` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo/reason)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reason(this: &GpuDeviceLostInfo) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs b/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs new file mode 100644 index 00000000000..1317793dc5f --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuDeviceLostReason` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostReason`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuDeviceLostReason { + Destroyed = "destroyed", +} diff --git a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs index 773a4128139..5d0c8aafa0c 100644 --- a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs +++ b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs @@ -22,21 +22,26 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { + pub fn new(width: u32) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.width(width); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depth` field of this object."] + #[doc = "Change the `depthOrArrayLayers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth(&mut self, val: u32) -> &mut Self { + pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &JsValue::from(val)); + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("depthOrArrayLayers"), + &JsValue::from(val), + ); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" diff --git a/crates/web-sys/src/features/gen_GpuFence.rs b/crates/web-sys/src/features/gen_GpuFence.rs deleted file mode 100644 index 1c25e189506..00000000000 --- a/crates/web-sys/src/features/gen_GpuFence.rs +++ /dev/null @@ -1,73 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUFence , typescript_type = "GPUFence")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuFence` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` 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 GpuFence; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUFence" , js_name = label)] - #[doc = "Getter for the `label` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/label)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuFence) -> Option; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , setter , js_class = "GPUFence" , js_name = label)] - #[doc = "Setter for the `label` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/label)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuFence, value: Option<&str>); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUFence" , js_name = getCompletedValue)] - #[doc = "The `getCompletedValue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/getCompletedValue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_completed_value(this: &GpuFence) -> f64; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUFence" , js_name = onCompletion)] - #[doc = "The `onCompletion()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/onCompletion)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn on_completion_with_u32(this: &GpuFence, completion_value: u32) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUFence" , js_name = onCompletion)] - #[doc = "The `onCompletion()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUFence/onCompletion)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn on_completion_with_f64(this: &GpuFence, completion_value: f64) -> ::js_sys::Promise; -} diff --git a/crates/web-sys/src/features/gen_GpuFragmentState.rs b/crates/web-sys/src/features/gen_GpuFragmentState.rs new file mode 100644 index 00000000000..395df4ffdd3 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuFragmentState.rs @@ -0,0 +1,99 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUFragmentState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuFragmentState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuFragmentState; +} +#[cfg(web_sys_unstable_apis)] +impl GpuFragmentState { + #[cfg(feature = "GpuShaderModule")] + #[doc = "Construct a new `GpuFragmentState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + entry_point: &str, + module: &GpuShaderModule, + targets: &::wasm_bindgen::JsValue, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entry_point(entry_point); + ret.module(module); + ret.targets(targets); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entryPoint"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `targets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("targets"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuBufferCopyView.rs b/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs similarity index 91% rename from crates/web-sys/src/features/gen_GpuBufferCopyView.rs rename to crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs index d1f1afdf381..150bc9dcd39 100644 --- a/crates/web-sys/src/features/gen_GpuBufferCopyView.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs @@ -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 = GPUBufferCopyView)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuBufferCopyView` dictionary."] + #[doc = "The `GpuImageCopyBuffer` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuBufferCopyView; + pub type GpuImageCopyBuffer; } #[cfg(web_sys_unstable_apis)] -impl GpuBufferCopyView { +impl GpuImageCopyBuffer { #[cfg(feature = "GpuBuffer")] - #[doc = "Construct a new `GpuBufferCopyView`."] + #[doc = "Construct a new `GpuImageCopyBuffer`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -32,7 +32,7 @@ impl GpuBufferCopyView { #[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: `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +53,7 @@ impl GpuBufferCopyView { #[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: `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -71,7 +71,7 @@ impl GpuBufferCopyView { #[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: `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -93,7 +93,7 @@ impl GpuBufferCopyView { #[cfg(feature = "GpuBuffer")] #[doc = "Change the `buffer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs b/crates/web-sys/src/features/gen_GpuImageCopyImageBitmap.rs similarity index 87% rename from crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs rename to crates/web-sys/src/features/gen_GpuImageCopyImageBitmap.rs index 3d73d4ff9be..2d25bccb11a 100644 --- a/crates/web-sys/src/features/gen_GpuImageBitmapCopyView.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyImageBitmap.rs @@ -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 = GPUImageBitmapCopyView)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyImageBitmap)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageBitmapCopyView` dictionary."] + #[doc = "The `GpuImageCopyImageBitmap` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyImageBitmap`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` 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 GpuImageBitmapCopyView; + pub type GpuImageCopyImageBitmap; } #[cfg(web_sys_unstable_apis)] -impl GpuImageBitmapCopyView { +impl GpuImageCopyImageBitmap { #[cfg(feature = "ImageBitmap")] - #[doc = "Construct a new `GpuImageBitmapCopyView`."] + #[doc = "Construct a new `GpuImageCopyImageBitmap`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `ImageBitmap`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyImageBitmap`, `ImageBitmap`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -33,7 +33,7 @@ impl GpuImageBitmapCopyView { #[cfg(feature = "ImageBitmap")] #[doc = "Change the `imageBitmap` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `ImageBitmap`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyImageBitmap`, `ImageBitmap`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -54,7 +54,7 @@ impl GpuImageBitmapCopyView { #[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: `GpuImageBitmapCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyImageBitmap`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_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_GpuTextureCopyView.rs b/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs similarity index 90% rename from crates/web-sys/src/features/gen_GpuTextureCopyView.rs rename to crates/web-sys/src/features/gen_GpuImageCopyTexture.rs index 362de62595a..0e55fc2ccd1 100644 --- a/crates/web-sys/src/features/gen_GpuTextureCopyView.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs @@ -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 = GPUTextureCopyView)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTexture)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuTextureCopyView` dictionary."] + #[doc = "The `GpuImageCopyTexture` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuTextureCopyView; + pub type GpuImageCopyTexture; } #[cfg(web_sys_unstable_apis)] -impl GpuTextureCopyView { +impl GpuImageCopyTexture { #[cfg(feature = "GpuTexture")] - #[doc = "Construct a new `GpuTextureCopyView`."] + #[doc = "Construct a new `GpuImageCopyTexture`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -33,7 +33,7 @@ impl GpuTextureCopyView { #[cfg(feature = "GpuTextureAspect")] #[doc = "Change the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -51,7 +51,7 @@ impl GpuTextureCopyView { #[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: `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -72,7 +72,7 @@ impl GpuTextureCopyView { #[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: `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -91,7 +91,7 @@ impl GpuTextureCopyView { #[cfg(feature = "GpuTexture")] #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuTextureDataLayout.rs b/crates/web-sys/src/features/gen_GpuImageDataLayout.rs similarity index 90% rename from crates/web-sys/src/features/gen_GpuTextureDataLayout.rs rename to crates/web-sys/src/features/gen_GpuImageDataLayout.rs index fb4f2cfc3ad..9693f22c982 100644 --- a/crates/web-sys/src/features/gen_GpuTextureDataLayout.rs +++ b/crates/web-sys/src/features/gen_GpuImageDataLayout.rs @@ -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 = GPUTextureDataLayout)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageDataLayout)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuTextureDataLayout` dictionary."] + #[doc = "The `GpuImageDataLayout` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuTextureDataLayout; + pub type GpuImageDataLayout; } #[cfg(web_sys_unstable_apis)] -impl GpuTextureDataLayout { - #[doc = "Construct a new `GpuTextureDataLayout`."] +impl GpuImageDataLayout { + #[doc = "Construct a new `GpuImageDataLayout`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -30,7 +30,7 @@ impl GpuTextureDataLayout { #[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: `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -51,7 +51,7 @@ impl GpuTextureDataLayout { #[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: `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -69,7 +69,7 @@ impl GpuTextureDataLayout { #[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: `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuMultisampleState.rs b/crates/web-sys/src/features/gen_GpuMultisampleState.rs new file mode 100644 index 00000000000..c8cd0ec338b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuMultisampleState.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUMultisampleState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuMultisampleState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuMultisampleState; +} +#[cfg(web_sys_unstable_apis)] +impl GpuMultisampleState { + #[doc = "Construct a new `GpuMultisampleState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `alphaToCoverageEnabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("alphaToCoverageEnabled"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn count(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mask(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs similarity index 70% rename from crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs rename to crates/web-sys/src/features/gen_GpuPrimitiveState.rs index d8ad3b9911a..91f617d2941 100644 --- a/crates/web-sys/src/features/gen_GpuColorStateDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs @@ -4,44 +4,42 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorStateDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPrimitiveState)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuColorStateDescriptor` dictionary."] + #[doc = "The `GpuPrimitiveState` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuColorStateDescriptor; + pub type GpuPrimitiveState; } #[cfg(web_sys_unstable_apis)] -impl GpuColorStateDescriptor { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuColorStateDescriptor`."] +impl GpuPrimitiveState { + #[doc = "Construct a new `GpuPrimitiveState`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorStateDescriptor`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { + pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); ret } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBlendDescriptor")] - #[doc = "Change the `alphaBlend` field of this object."] + #[cfg(feature = "GpuCullMode")] + #[doc = "Change the `cullMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuColorStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_blend(&mut self, val: &GpuBlendDescriptor) -> &mut Self { + pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("alphaBlend"), + &JsValue::from("cullMode"), &JsValue::from(val), ); debug_assert!( @@ -52,18 +50,18 @@ impl GpuColorStateDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBlendDescriptor")] - #[doc = "Change the `colorBlend` field of this object."] + #[cfg(feature = "GpuFrontFace")] + #[doc = "Change the `frontFace` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendDescriptor`, `GpuColorStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_blend(&mut self, val: &GpuBlendDescriptor) -> &mut Self { + pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("colorBlend"), + &JsValue::from("frontFace"), &JsValue::from(val), ); debug_assert!( @@ -74,17 +72,20 @@ impl GpuColorStateDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Change the `format` field of this object."] + #[cfg(feature = "GpuIndexFormat")] + #[doc = "Change the `stripIndexFormat` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorStateDescriptor`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("stripIndexFormat"), + &JsValue::from(val), + ); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" @@ -93,17 +94,18 @@ impl GpuColorStateDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `writeMask` field of this object."] + #[cfg(feature = "GpuPrimitiveTopology")] + #[doc = "Change the `topology` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuPrimitiveTopology`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_mask(&mut self, val: u32) -> &mut Self { + pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("writeMask"), + &JsValue::from("topology"), &JsValue::from(val), ); debug_assert!( diff --git a/crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs similarity index 85% rename from crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs rename to crates/web-sys/src/features/gen_GpuProgrammableStage.rs index 91e1e2e6288..cf569c1e4ea 100644 --- a/crates/web-sys/src/features/gen_GpuProgrammableStageDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs @@ -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 = GPUProgrammableStageDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUProgrammableStage)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuProgrammableStageDescriptor` dictionary."] + #[doc = "The `GpuProgrammableStage` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuProgrammableStageDescriptor; + pub type GpuProgrammableStage; } #[cfg(web_sys_unstable_apis)] -impl GpuProgrammableStageDescriptor { +impl GpuProgrammableStage { #[cfg(feature = "GpuShaderModule")] - #[doc = "Construct a new `GpuProgrammableStageDescriptor`."] + #[doc = "Construct a new `GpuProgrammableStage`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuShaderModule`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -33,7 +33,7 @@ impl GpuProgrammableStageDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -55,7 +55,7 @@ impl GpuProgrammableStageDescriptor { #[cfg(feature = "GpuShaderModule")] #[doc = "Change the `module` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuShaderModule`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuQueue.rs b/crates/web-sys/src/features/gen_GpuQueue.rs index def12b22fcc..d5eb9e7b573 100644 --- a/crates/web-sys/src/features/gen_GpuQueue.rs +++ b/crates/web-sys/src/features/gen_GpuQueue.rs @@ -38,94 +38,54 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_label(this: &GpuQueue, value: Option<&str>); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageBitmapCopyView", feature = "GpuTextureCopyView",))] + #[cfg(all(feature = "GpuImageCopyImageBitmap", feature = "GpuImageCopyTexture",))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyImageBitmapToTexture)] #[doc = "The `copyImageBitmapToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyImageBitmapToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageBitmapCopyView`, `GpuQueue`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyImageBitmap`, `GpuImageCopyTexture`, `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_image_bitmap_to_texture_with_u32_sequence( this: &GpuQueue, - source: &GpuImageBitmapCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyImageBitmap, + destination: &GpuImageCopyTexture, copy_size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageBitmapCopyView", - feature = "GpuTextureCopyView", + feature = "GpuImageCopyImageBitmap", + feature = "GpuImageCopyTexture", ))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyImageBitmapToTexture)] #[doc = "The `copyImageBitmapToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyImageBitmapToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageBitmapCopyView`, `GpuQueue`, `GpuTextureCopyView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyImageBitmap`, `GpuImageCopyTexture`, `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_image_bitmap_to_texture_with_gpu_extent_3d_dict( this: &GpuQueue, - source: &GpuImageBitmapCopyView, - destination: &GpuTextureCopyView, + source: &GpuImageCopyImageBitmap, + destination: &GpuImageCopyTexture, copy_size: &GpuExtent3dDict, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuFence")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = createFence)] - #[doc = "The `createFence()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = onSubmittedWorkDone)] + #[doc = "The `onSubmittedWorkDone()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/createFence)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/onSubmittedWorkDone)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`, `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 create_fence(this: &GpuQueue) -> GpuFence; - #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuFence", feature = "GpuFenceDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = createFence)] - #[doc = "The `createFence()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/createFence)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`, `GpuFenceDescriptor`, `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 create_fence_with_descriptor( - this: &GpuQueue, - descriptor: &GpuFenceDescriptor, - ) -> GpuFence; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuFence")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = signal)] - #[doc = "The `signal()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/signal)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`, `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 signal_with_u32(this: &GpuQueue, fence: &GpuFence, signal_value: u32); - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuFence")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = signal)] - #[doc = "The `signal()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/signal)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFence`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn signal_with_f64(this: &GpuQueue, fence: &GpuFence, signal_value: f64); + pub fn on_submitted_work_done(this: &GpuQueue) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = submit)] #[doc = "The `submit()` method."] @@ -654,83 +614,83 @@ extern "C" { size: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuTextureCopyView", feature = "GpuTextureDataLayout",))] + #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTextureCopyView`, `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_u32_sequence( this: &GpuQueue, - destination: &GpuTextureCopyView, + destination: &GpuImageCopyTexture, data: &::js_sys::Object, - data_layout: &GpuTextureDataLayout, + data_layout: &GpuImageDataLayout, size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuTextureCopyView", feature = "GpuTextureDataLayout",))] + #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTextureCopyView`, `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_array_and_u32_sequence( this: &GpuQueue, - destination: &GpuTextureCopyView, + destination: &GpuImageCopyTexture, data: &[u8], - data_layout: &GpuTextureDataLayout, + data_layout: &GpuImageDataLayout, size: &::wasm_bindgen::JsValue, ); #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuTextureCopyView", - feature = "GpuTextureDataLayout", + feature = "GpuImageCopyTexture", + feature = "GpuImageDataLayout", ))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTextureCopyView`, `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuTextureCopyView, + destination: &GpuImageCopyTexture, data: &::js_sys::Object, - data_layout: &GpuTextureDataLayout, + data_layout: &GpuImageDataLayout, size: &GpuExtent3dDict, ); #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuTextureCopyView", - feature = "GpuTextureDataLayout", + feature = "GpuImageCopyTexture", + feature = "GpuImageDataLayout", ))] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTextureCopyView`, `GpuTextureDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuTextureCopyView, + destination: &GpuImageCopyTexture, data: &[u8], - data_layout: &GpuTextureDataLayout, + data_layout: &GpuImageDataLayout, size: &GpuExtent3dDict, ); } diff --git a/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs deleted file mode 100644 index 9095c3f3e89..00000000000 --- a/crates/web-sys/src/features/gen_GpuRasterizationStateDescriptor.rs +++ /dev/null @@ -1,158 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURasterizationStateDescriptor)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuRasterizationStateDescriptor` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` 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 GpuRasterizationStateDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRasterizationStateDescriptor { - #[doc = "Construct a new `GpuRasterizationStateDescriptor`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `clampDepth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clamp_depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clampDepth"), - &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 = "GpuCullMode")] - #[doc = "Change the `cullMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cullMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depthBias` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depthBiasClamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depthBiasSlopeScale` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasSlopeScale"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuFrontFace")] - #[doc = "Change the `frontFace` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuRasterizationStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frontFace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs index af5cc66b688..7eba9a2fb39 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs @@ -365,114 +365,124 @@ extern "C" { indirect_offset: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_index_buffer(this: &GpuRenderBundleEncoder, buffer: &GpuBuffer); + pub fn set_index_buffer( + this: &GpuRenderBundleEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_u32( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: u32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_f64( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_u32_and_u32( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: u32, size: u32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_f64_and_u32( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: f64, size: u32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_u32_and_f64( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: u32, size: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_f64_and_f64( this: &GpuRenderBundleEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: f64, size: f64, ); diff --git a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs similarity index 79% rename from crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs rename to crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs index 53cb885c3e3..caa1b2227d7 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachmentDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs @@ -4,45 +4,44 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassColorAttachmentDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassColorAttachment)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuRenderPassColorAttachmentDescriptor` dictionary."] + #[doc = "The `GpuRenderPassColorAttachment` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuRenderPassColorAttachmentDescriptor; + pub type GpuRenderPassColorAttachment; } #[cfg(web_sys_unstable_apis)] -impl GpuRenderPassColorAttachmentDescriptor { +impl GpuRenderPassColorAttachment { #[cfg(feature = "GpuTextureView")] - #[doc = "Construct a new `GpuRenderPassColorAttachmentDescriptor`."] + #[doc = "Construct a new `GpuRenderPassColorAttachment`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(attachment: &GpuTextureView, load_value: &::wasm_bindgen::JsValue) -> Self { + pub fn new(load_value: &::wasm_bindgen::JsValue, view: &GpuTextureView) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.attachment(attachment); ret.load_value(load_value); + ret.view(view); ret } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureView")] - #[doc = "Change the `attachment` field of this object."] + #[doc = "Change the `loadValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn attachment(&mut self, val: &GpuTextureView) -> &mut Self { + pub fn load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("attachment"), + &JsValue::from("loadValue"), &JsValue::from(val), ); debug_assert!( @@ -53,17 +52,18 @@ impl GpuRenderPassColorAttachmentDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `loadValue` field of this object."] + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `resolveTarget` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("loadValue"), + &JsValue::from("resolveTarget"), &JsValue::from(val), ); debug_assert!( @@ -74,18 +74,18 @@ impl GpuRenderPassColorAttachmentDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureView")] - #[doc = "Change the `resolveTarget` field of this object."] + #[cfg(feature = "GpuStoreOp")] + #[doc = "Change the `storeOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { + pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("resolveTarget"), + &JsValue::from("storeOp"), &JsValue::from(val), ); debug_assert!( @@ -96,20 +96,16 @@ impl GpuRenderPassColorAttachmentDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuStoreOp")] - #[doc = "Change the `storeOp` field of this object."] + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `view` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachmentDescriptor`, `GpuStoreOp`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { + pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storeOp"), - &JsValue::from(val), - ); + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs similarity index 85% rename from crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs rename to crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs index eb65c44a20f..83fbe10bc90 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachmentDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs @@ -4,67 +4,45 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassDepthStencilAttachmentDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassDepthStencilAttachment)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuRenderPassDepthStencilAttachmentDescriptor` dictionary."] + #[doc = "The `GpuRenderPassDepthStencilAttachment` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuRenderPassDepthStencilAttachmentDescriptor; + pub type GpuRenderPassDepthStencilAttachment; } #[cfg(web_sys_unstable_apis)] -impl GpuRenderPassDepthStencilAttachmentDescriptor { +impl GpuRenderPassDepthStencilAttachment { #[cfg(all(feature = "GpuStoreOp", feature = "GpuTextureView",))] - #[doc = "Construct a new `GpuRenderPassDepthStencilAttachmentDescriptor`."] + #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`, `GpuTextureView`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new( - attachment: &GpuTextureView, depth_load_value: &::wasm_bindgen::JsValue, depth_store_op: GpuStoreOp, stencil_load_value: &::wasm_bindgen::JsValue, stencil_store_op: GpuStoreOp, + view: &GpuTextureView, ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.attachment(attachment); ret.depth_load_value(depth_load_value); ret.depth_store_op(depth_store_op); ret.stencil_load_value(stencil_load_value); ret.stencil_store_op(stencil_store_op); + ret.view(view); ret } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureView")] - #[doc = "Change the `attachment` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuTextureView`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn attachment(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attachment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthLoadValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -85,7 +63,7 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthReadOnly` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -107,7 +85,7 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { #[cfg(feature = "GpuStoreOp")] #[doc = "Change the `depthStoreOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -128,7 +106,7 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilLoadValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -149,7 +127,7 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilReadOnly` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -171,7 +149,7 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { #[cfg(feature = "GpuStoreOp")] #[doc = "Change the `stencilStoreOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuStoreOp`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -189,4 +167,22 @@ impl GpuRenderPassDepthStencilAttachmentDescriptor { let _ = r; self } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs index 3ffcb6d6e00..1228090a1ba 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs @@ -67,16 +67,16 @@ impl GpuRenderPassDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] + #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] #[doc = "Change the `depthStencilAttachment` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachmentDescriptor`, `GpuRenderPassDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuRenderPassDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn depth_stencil_attachment( &mut self, - val: &GpuRenderPassDepthStencilAttachmentDescriptor, + val: &GpuRenderPassDepthStencilAttachment, ) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( diff --git a/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs index a1a56330c05..b32f38eb7f0 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs @@ -488,106 +488,124 @@ extern "C" { indirect_offset: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_index_buffer(this: &GpuRenderPassEncoder, buffer: &GpuBuffer); + pub fn set_index_buffer( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_index_buffer_with_u32(this: &GpuRenderPassEncoder, buffer: &GpuBuffer, offset: u32); + pub fn set_index_buffer_with_u32( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: u32, + ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_index_buffer_with_f64(this: &GpuRenderPassEncoder, buffer: &GpuBuffer, offset: f64); + pub fn set_index_buffer_with_f64( + this: &GpuRenderPassEncoder, + buffer: &GpuBuffer, + index_format: GpuIndexFormat, + offset: f64, + ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_u32_and_u32( this: &GpuRenderPassEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: u32, size: u32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_f64_and_u32( this: &GpuRenderPassEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: f64, size: u32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_u32_and_f64( this: &GpuRenderPassEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: u32, size: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] + #[cfg(all(feature = "GpuBuffer", feature = "GpuIndexFormat",))] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setIndexBuffer)] #[doc = "The `setIndexBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setIndexBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuIndexFormat`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_index_buffer_with_f64_and_f64( this: &GpuRenderPassEncoder, buffer: &GpuBuffer, + index_format: GpuIndexFormat, offset: f64, size: f64, ); diff --git a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs index 51bddb58fdf..fcd35bbc57d 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs @@ -16,26 +16,17 @@ extern "C" { } #[cfg(web_sys_unstable_apis)] impl GpuRenderPipelineDescriptor { - #[cfg(all( - feature = "GpuPrimitiveTopology", - feature = "GpuProgrammableStageDescriptor", - ))] + #[cfg(feature = "GpuVertexState")] #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveTopology`, `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - color_states: &::wasm_bindgen::JsValue, - primitive_topology: GpuPrimitiveTopology, - vertex_stage: &GpuProgrammableStageDescriptor, - ) -> Self { + pub fn new(vertex: &GpuVertexState) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_states(color_states); - ret.primitive_topology(primitive_topology); - ret.vertex_stage(vertex_stage); + ret.vertex(vertex); ret } #[cfg(web_sys_unstable_apis)] @@ -75,82 +66,18 @@ impl GpuRenderPipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `alphaToCoverageEnabled` field of this object."] + #[cfg(feature = "GpuDepthStencilState")] + #[doc = "Change the `depthStencil` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaToCoverageEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `colorStates` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_states(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorStates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuDepthStencilStateDescriptor")] - #[doc = "Change the `depthStencilState` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilStateDescriptor`, `GpuRenderPipelineDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_state(&mut self, val: &GpuDepthStencilStateDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilState"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuProgrammableStageDescriptor")] - #[doc = "Change the `fragmentStage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn fragment_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { + pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("fragmentStage"), + &JsValue::from("depthStencil"), &JsValue::from(val), ); debug_assert!( @@ -161,18 +88,18 @@ impl GpuRenderPipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPrimitiveTopology")] - #[doc = "Change the `primitiveTopology` field of this object."] + #[cfg(feature = "GpuFragmentState")] + #[doc = "Change the `fragment` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveTopology`, `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn primitive_topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { + pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("primitiveTopology"), + &JsValue::from("fragment"), &JsValue::from(val), ); debug_assert!( @@ -183,18 +110,18 @@ impl GpuRenderPipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuRasterizationStateDescriptor")] - #[doc = "Change the `rasterizationState` field of this object."] + #[cfg(feature = "GpuMultisampleState")] + #[doc = "Change the `multisample` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRasterizationStateDescriptor`, `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rasterization_state(&mut self, val: &GpuRasterizationStateDescriptor) -> &mut Self { + pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("rasterizationState"), + &JsValue::from("multisample"), &JsValue::from(val), ); debug_assert!( @@ -205,17 +132,18 @@ impl GpuRenderPipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `sampleCount` field of this object."] + #[cfg(feature = "GpuPrimitiveState")] + #[doc = "Change the `primitive` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_count(&mut self, val: u32) -> &mut Self { + pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( self.as_ref(), - &JsValue::from("sampleCount"), + &JsValue::from("primitive"), &JsValue::from(val), ); debug_assert!( @@ -226,63 +154,17 @@ impl GpuRenderPipelineDescriptor { self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `sampleMask` field of this object."] + #[cfg(feature = "GpuVertexState")] + #[doc = "Change the `vertex` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_mask(&mut self, val: u32) -> &mut Self { + pub fn vertex(&mut self, val: &GpuVertexState) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuProgrammableStageDescriptor")] - #[doc = "Change the `vertexStage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStageDescriptor`, `GpuRenderPipelineDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn vertex_stage(&mut self, val: &GpuProgrammableStageDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vertexStage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuVertexStateDescriptor")] - #[doc = "Change the `vertexState` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn vertex_state(&mut self, val: &GpuVertexStateDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vertexState"), - &JsValue::from(val), - ); + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("vertex"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" diff --git a/crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs similarity index 50% rename from crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs rename to crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs index c8d0665ed38..896f89f2daa 100644 --- a/crates/web-sys/src/features/gen_GpuVertexStateDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs @@ -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 = GPUVertexStateDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUSamplerBindingLayout)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuVertexStateDescriptor` dictionary."] + #[doc = "The `GpuSamplerBindingLayout` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuVertexStateDescriptor; + pub type GpuSamplerBindingLayout; } #[cfg(web_sys_unstable_apis)] -impl GpuVertexStateDescriptor { - #[doc = "Construct a new `GpuVertexStateDescriptor`."] +impl GpuSamplerBindingLayout { + #[doc = "Construct a new `GpuSamplerBindingLayout`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -28,41 +28,16 @@ impl GpuVertexStateDescriptor { ret } #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuIndexFormat")] - #[doc = "Change the `indexFormat` field of this object."] + #[cfg(feature = "GpuSamplerBindingType")] + #[doc = "Change the `type` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuVertexStateDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn index_format(&mut self, val: GpuIndexFormat) -> &mut Self { + pub fn type_(&mut self, val: GpuSamplerBindingType) -> &mut Self { use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("indexFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `vertexBuffers` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexStateDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn vertex_buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vertexBuffers"), - &JsValue::from(val), - ); + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); debug_assert!( r.is_ok(), "setting properties should never fail on our dictionary objects" diff --git a/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs b/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs new file mode 100644 index 00000000000..ea4a3c446dd --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuSamplerBindingType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuSamplerBindingType { + Filtering = "filtering", + NonFiltering = "non-filtering", + Comparison = "comparison", +} diff --git a/crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs similarity index 88% rename from crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs rename to crates/web-sys/src/features/gen_GpuStencilFaceState.rs index aba779d35df..107f18fdc8c 100644 --- a/crates/web-sys/src/features/gen_GpuStencilStateFaceDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs @@ -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 = GPUStencilStateFaceDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUStencilFaceState)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuStencilStateFaceDescriptor` dictionary."] + #[doc = "The `GpuStencilFaceState` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuStencilStateFaceDescriptor; + pub type GpuStencilFaceState; } #[cfg(web_sys_unstable_apis)] -impl GpuStencilStateFaceDescriptor { - #[doc = "Construct a new `GpuStencilStateFaceDescriptor`."] +impl GpuStencilFaceState { + #[doc = "Construct a new `GpuStencilFaceState`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -31,7 +31,7 @@ impl GpuStencilStateFaceDescriptor { #[cfg(feature = "GpuCompareFunction")] #[doc = "Change the `compare` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +53,7 @@ impl GpuStencilStateFaceDescriptor { #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `depthFailOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -75,7 +75,7 @@ impl GpuStencilStateFaceDescriptor { #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `failOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -94,7 +94,7 @@ impl GpuStencilStateFaceDescriptor { #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `passOp` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilOperation`, `GpuStencilStateFaceDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs b/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs new file mode 100644 index 00000000000..e612241a8ad --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuStorageTextureAccess` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuStorageTextureAccess { + ReadOnly = "read-only", + WriteOnly = "write-only", +} diff --git a/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs new file mode 100644 index 00000000000..37cdefa6c55 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs @@ -0,0 +1,93 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUStorageTextureBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuStorageTextureBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuStorageTextureBindingLayout; +} +#[cfg(web_sys_unstable_apis)] +impl GpuStorageTextureBindingLayout { + #[cfg(all(feature = "GpuStorageTextureAccess", feature = "GpuTextureFormat",))] + #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(access: GpuStorageTextureAccess, format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.access(access); + ret.format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStorageTextureAccess")] + #[doc = "Change the `access` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Change the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[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: `GpuStorageTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewDimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs new file mode 100644 index 00000000000..d4f6a942585 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs @@ -0,0 +1,95 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureBindingLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTextureBindingLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTextureBindingLayout; +} +#[cfg(web_sys_unstable_apis)] +impl GpuTextureBindingLayout { + #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[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: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn multisampled(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("multisampled"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureSampleType")] + #[doc = "Change the `sampleType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureSampleType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sampleType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[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: `GpuTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("viewDimension"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuTextureComponentType.rs b/crates/web-sys/src/features/gen_GpuTextureSampleType.rs similarity index 74% rename from crates/web-sys/src/features/gen_GpuTextureComponentType.rs rename to crates/web-sys/src/features/gen_GpuTextureSampleType.rs index 1f3f3841322..6007e61c1ba 100644 --- a/crates/web-sys/src/features/gen_GpuTextureComponentType.rs +++ b/crates/web-sys/src/features/gen_GpuTextureSampleType.rs @@ -2,16 +2,17 @@ use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] -#[doc = "The `GpuTextureComponentType` enum."] +#[doc = "The `GpuTextureSampleType` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GpuTextureComponentType`*"] +#[doc = "*This API requires the following crate features to be activated: `GpuTextureSampleType`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GpuTextureComponentType { +pub enum GpuTextureSampleType { Float = "float", + UnfilterableFloat = "unfilterable-float", + Depth = "depth", Sint = "sint", Uint = "uint", - DepthComparison = "depth-comparison", } diff --git a/crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs similarity index 88% rename from crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs rename to crates/web-sys/src/features/gen_GpuVertexAttribute.rs index 29601b63b17..2fde6d181dd 100644 --- a/crates/web-sys/src/features/gen_GpuVertexAttributeDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs @@ -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 = GPUVertexAttributeDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexAttribute)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuVertexAttributeDescriptor` dictionary."] + #[doc = "The `GpuVertexAttribute` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuVertexAttributeDescriptor; + pub type GpuVertexAttribute; } #[cfg(web_sys_unstable_apis)] -impl GpuVertexAttributeDescriptor { +impl GpuVertexAttribute { #[cfg(feature = "GpuVertexFormat")] - #[doc = "Construct a new `GpuVertexAttributeDescriptor`."] + #[doc = "Construct a new `GpuVertexAttribute`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`, `GpuVertexFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -35,7 +35,7 @@ impl GpuVertexAttributeDescriptor { #[cfg(feature = "GpuVertexFormat")] #[doc = "Change the `format` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`, `GpuVertexFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +53,7 @@ impl GpuVertexAttributeDescriptor { #[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: `GpuVertexAttributeDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -71,7 +71,7 @@ impl GpuVertexAttributeDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `shaderLocation` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttributeDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs similarity index 87% rename from crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs rename to crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs index f03e3a53844..cf489298cb2 100644 --- a/crates/web-sys/src/features/gen_GpuVertexBufferLayoutDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs @@ -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 = GPUVertexBufferLayoutDescriptor)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexBufferLayout)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuVertexBufferLayoutDescriptor` dictionary."] + #[doc = "The `GpuVertexBufferLayout` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuVertexBufferLayoutDescriptor; + pub type GpuVertexBufferLayout; } #[cfg(web_sys_unstable_apis)] -impl GpuVertexBufferLayoutDescriptor { - #[doc = "Construct a new `GpuVertexBufferLayoutDescriptor`."] +impl GpuVertexBufferLayout { + #[doc = "Construct a new `GpuVertexBufferLayout`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -32,7 +32,7 @@ impl GpuVertexBufferLayoutDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `arrayStride` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +53,7 @@ impl GpuVertexBufferLayoutDescriptor { #[cfg(web_sys_unstable_apis)] #[doc = "Change the `attributes` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayoutDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -75,7 +75,7 @@ impl GpuVertexBufferLayoutDescriptor { #[cfg(feature = "GpuInputStepMode")] #[doc = "Change the `stepMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuInputStepMode`, `GpuVertexBufferLayoutDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuInputStepMode`, `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuVertexFormat.rs b/crates/web-sys/src/features/gen_GpuVertexFormat.rs index c48aaa20d0e..07e4d22b587 100644 --- a/crates/web-sys/src/features/gen_GpuVertexFormat.rs +++ b/crates/web-sys/src/features/gen_GpuVertexFormat.rs @@ -10,34 +10,34 @@ 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 { - Uchar2 = "uchar2", - Uchar4 = "uchar4", - Char2 = "char2", - Char4 = "char4", - Uchar2norm = "uchar2norm", - Uchar4norm = "uchar4norm", - Char2norm = "char2norm", - Char4norm = "char4norm", - Ushort2 = "ushort2", - Ushort4 = "ushort4", - Short2 = "short2", - Short4 = "short4", - Ushort2norm = "ushort2norm", - Ushort4norm = "ushort4norm", - Short2norm = "short2norm", - Short4norm = "short4norm", - Half2 = "half2", - Half4 = "half4", - Float = "float", - Float2 = "float2", - Float3 = "float3", - Float4 = "float4", - Uint = "uint", - Uint2 = "uint2", - Uint3 = "uint3", - Uint4 = "uint4", - Int = "int", - Int2 = "int2", - Int3 = "int3", - Int4 = "int4", + Uint8x2 = "uint8x2", + Uint8x4 = "uint8x4", + Sint8x2 = "sint8x2", + Sint8x4 = "sint8x4", + Unorm8x2 = "unorm8x2", + Unorm8x4 = "unorm8x4", + Snorm8x2 = "snorm8x2", + Snorm8x4 = "snorm8x4", + Uint16x2 = "uint16x2", + Uint16x4 = "uint16x4", + Sint16x2 = "sint16x2", + Sint16x4 = "sint16x4", + Unorm16x2 = "unorm16x2", + Unorm16x4 = "unorm16x4", + Snorm16x2 = "snorm16x2", + Snorm16x4 = "snorm16x4", + Float16x2 = "float16x2", + Float16x4 = "float16x4", + Float32 = "float32", + Float32x2 = "float32x2", + Float32x3 = "float32x3", + Float32x4 = "float32x4", + Uint32 = "uint32", + Uint32x2 = "uint32x2", + Uint32x3 = "uint32x3", + Uint32x4 = "uint32x4", + Sint32 = "sint32", + Sint32x2 = "sint32x2", + Sint32x3 = "sint32x3", + Sint32x4 = "sint32x4", } diff --git a/crates/web-sys/src/features/gen_GpuVertexState.rs b/crates/web-sys/src/features/gen_GpuVertexState.rs new file mode 100644 index 00000000000..4086fe436a4 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuVertexState.rs @@ -0,0 +1,94 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuVertexState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuVertexState; +} +#[cfg(web_sys_unstable_apis)] +impl GpuVertexState { + #[cfg(feature = "GpuShaderModule")] + #[doc = "Construct a new `GpuVertexState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.entry_point(entry_point); + ret.module(module); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("entryPoint"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `buffers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("buffers"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index f7e2fd20cf8..c796fd9f0e5 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -2242,6 +2242,12 @@ mod gen_GpuAdapterFeatures; #[cfg(feature = "GpuAdapterFeatures")] pub use gen_GpuAdapterFeatures::*; +#[cfg(feature = "GpuAdapterLimits")] +#[allow(non_snake_case)] +mod gen_GpuAdapterLimits; +#[cfg(feature = "GpuAdapterLimits")] +pub use gen_GpuAdapterLimits::*; + #[cfg(feature = "GpuAddressMode")] #[allow(non_snake_case)] mod gen_GpuAddressMode; @@ -2284,17 +2290,11 @@ mod gen_GpuBindGroupLayoutEntry; #[cfg(feature = "GpuBindGroupLayoutEntry")] pub use gen_GpuBindGroupLayoutEntry::*; -#[cfg(feature = "GpuBindingType")] -#[allow(non_snake_case)] -mod gen_GpuBindingType; -#[cfg(feature = "GpuBindingType")] -pub use gen_GpuBindingType::*; - -#[cfg(feature = "GpuBlendDescriptor")] +#[cfg(feature = "GpuBlendComponent")] #[allow(non_snake_case)] -mod gen_GpuBlendDescriptor; -#[cfg(feature = "GpuBlendDescriptor")] -pub use gen_GpuBlendDescriptor::*; +mod gen_GpuBlendComponent; +#[cfg(feature = "GpuBlendComponent")] +pub use gen_GpuBlendComponent::*; #[cfg(feature = "GpuBlendFactor")] #[allow(non_snake_case)] @@ -2308,6 +2308,12 @@ mod gen_GpuBlendOperation; #[cfg(feature = "GpuBlendOperation")] pub use gen_GpuBlendOperation::*; +#[cfg(feature = "GpuBlendState")] +#[allow(non_snake_case)] +mod gen_GpuBlendState; +#[cfg(feature = "GpuBlendState")] +pub use gen_GpuBlendState::*; + #[cfg(feature = "GpuBuffer")] #[allow(non_snake_case)] mod gen_GpuBuffer; @@ -2320,11 +2326,17 @@ mod gen_GpuBufferBinding; #[cfg(feature = "GpuBufferBinding")] pub use gen_GpuBufferBinding::*; -#[cfg(feature = "GpuBufferCopyView")] +#[cfg(feature = "GpuBufferBindingLayout")] #[allow(non_snake_case)] -mod gen_GpuBufferCopyView; -#[cfg(feature = "GpuBufferCopyView")] -pub use gen_GpuBufferCopyView::*; +mod gen_GpuBufferBindingLayout; +#[cfg(feature = "GpuBufferBindingLayout")] +pub use gen_GpuBufferBindingLayout::*; + +#[cfg(feature = "GpuBufferBindingType")] +#[allow(non_snake_case)] +mod gen_GpuBufferBindingType; +#[cfg(feature = "GpuBufferBindingType")] +pub use gen_GpuBufferBindingType::*; #[cfg(feature = "GpuBufferDescriptor")] #[allow(non_snake_case)] @@ -2350,11 +2362,11 @@ mod gen_GpuColorDict; #[cfg(feature = "GpuColorDict")] pub use gen_GpuColorDict::*; -#[cfg(feature = "GpuColorStateDescriptor")] +#[cfg(feature = "GpuColorTargetState")] #[allow(non_snake_case)] -mod gen_GpuColorStateDescriptor; -#[cfg(feature = "GpuColorStateDescriptor")] -pub use gen_GpuColorStateDescriptor::*; +mod gen_GpuColorTargetState; +#[cfg(feature = "GpuColorTargetState")] +pub use gen_GpuColorTargetState::*; #[cfg(feature = "GpuColorWrite")] #[allow(non_snake_case)] @@ -2440,11 +2452,11 @@ mod gen_GpuCullMode; #[cfg(feature = "GpuCullMode")] pub use gen_GpuCullMode::*; -#[cfg(feature = "GpuDepthStencilStateDescriptor")] +#[cfg(feature = "GpuDepthStencilState")] #[allow(non_snake_case)] -mod gen_GpuDepthStencilStateDescriptor; -#[cfg(feature = "GpuDepthStencilStateDescriptor")] -pub use gen_GpuDepthStencilStateDescriptor::*; +mod gen_GpuDepthStencilState; +#[cfg(feature = "GpuDepthStencilState")] +pub use gen_GpuDepthStencilState::*; #[cfg(feature = "GpuDevice")] #[allow(non_snake_case)] @@ -2464,6 +2476,12 @@ mod gen_GpuDeviceLostInfo; #[cfg(feature = "GpuDeviceLostInfo")] pub use gen_GpuDeviceLostInfo::*; +#[cfg(feature = "GpuDeviceLostReason")] +#[allow(non_snake_case)] +mod gen_GpuDeviceLostReason; +#[cfg(feature = "GpuDeviceLostReason")] +pub use gen_GpuDeviceLostReason::*; + #[cfg(feature = "GpuErrorFilter")] #[allow(non_snake_case)] mod gen_GpuErrorFilter; @@ -2482,35 +2500,47 @@ mod gen_GpuFeatureName; #[cfg(feature = "GpuFeatureName")] pub use gen_GpuFeatureName::*; -#[cfg(feature = "GpuFence")] -#[allow(non_snake_case)] -mod gen_GpuFence; -#[cfg(feature = "GpuFence")] -pub use gen_GpuFence::*; - -#[cfg(feature = "GpuFenceDescriptor")] -#[allow(non_snake_case)] -mod gen_GpuFenceDescriptor; -#[cfg(feature = "GpuFenceDescriptor")] -pub use gen_GpuFenceDescriptor::*; - #[cfg(feature = "GpuFilterMode")] #[allow(non_snake_case)] mod gen_GpuFilterMode; #[cfg(feature = "GpuFilterMode")] pub use gen_GpuFilterMode::*; +#[cfg(feature = "GpuFragmentState")] +#[allow(non_snake_case)] +mod gen_GpuFragmentState; +#[cfg(feature = "GpuFragmentState")] +pub use gen_GpuFragmentState::*; + #[cfg(feature = "GpuFrontFace")] #[allow(non_snake_case)] mod gen_GpuFrontFace; #[cfg(feature = "GpuFrontFace")] pub use gen_GpuFrontFace::*; -#[cfg(feature = "GpuImageBitmapCopyView")] +#[cfg(feature = "GpuImageCopyBuffer")] +#[allow(non_snake_case)] +mod gen_GpuImageCopyBuffer; +#[cfg(feature = "GpuImageCopyBuffer")] +pub use gen_GpuImageCopyBuffer::*; + +#[cfg(feature = "GpuImageCopyImageBitmap")] +#[allow(non_snake_case)] +mod gen_GpuImageCopyImageBitmap; +#[cfg(feature = "GpuImageCopyImageBitmap")] +pub use gen_GpuImageCopyImageBitmap::*; + +#[cfg(feature = "GpuImageCopyTexture")] +#[allow(non_snake_case)] +mod gen_GpuImageCopyTexture; +#[cfg(feature = "GpuImageCopyTexture")] +pub use gen_GpuImageCopyTexture::*; + +#[cfg(feature = "GpuImageDataLayout")] #[allow(non_snake_case)] -mod gen_GpuImageBitmapCopyView; -#[cfg(feature = "GpuImageBitmapCopyView")] -pub use gen_GpuImageBitmapCopyView::*; +mod gen_GpuImageDataLayout; +#[cfg(feature = "GpuImageDataLayout")] +pub use gen_GpuImageDataLayout::*; #[cfg(feature = "GpuIndexFormat")] #[allow(non_snake_case)] @@ -2524,12 +2554,6 @@ mod gen_GpuInputStepMode; #[cfg(feature = "GpuInputStepMode")] pub use gen_GpuInputStepMode::*; -#[cfg(feature = "GpuLimits")] -#[allow(non_snake_case)] -mod gen_GpuLimits; -#[cfg(feature = "GpuLimits")] -pub use gen_GpuLimits::*; - #[cfg(feature = "GpuLoadOp")] #[allow(non_snake_case)] mod gen_GpuLoadOp; @@ -2542,6 +2566,12 @@ mod gen_GpuMapMode; #[cfg(feature = "GpuMapMode")] pub use gen_GpuMapMode::*; +#[cfg(feature = "GpuMultisampleState")] +#[allow(non_snake_case)] +mod gen_GpuMultisampleState; +#[cfg(feature = "GpuMultisampleState")] +pub use gen_GpuMultisampleState::*; + #[cfg(feature = "GpuObjectDescriptorBase")] #[allow(non_snake_case)] mod gen_GpuObjectDescriptorBase; @@ -2596,17 +2626,23 @@ mod gen_GpuPowerPreference; #[cfg(feature = "GpuPowerPreference")] pub use gen_GpuPowerPreference::*; +#[cfg(feature = "GpuPrimitiveState")] +#[allow(non_snake_case)] +mod gen_GpuPrimitiveState; +#[cfg(feature = "GpuPrimitiveState")] +pub use gen_GpuPrimitiveState::*; + #[cfg(feature = "GpuPrimitiveTopology")] #[allow(non_snake_case)] mod gen_GpuPrimitiveTopology; #[cfg(feature = "GpuPrimitiveTopology")] pub use gen_GpuPrimitiveTopology::*; -#[cfg(feature = "GpuProgrammableStageDescriptor")] +#[cfg(feature = "GpuProgrammableStage")] #[allow(non_snake_case)] -mod gen_GpuProgrammableStageDescriptor; -#[cfg(feature = "GpuProgrammableStageDescriptor")] -pub use gen_GpuProgrammableStageDescriptor::*; +mod gen_GpuProgrammableStage; +#[cfg(feature = "GpuProgrammableStage")] +pub use gen_GpuProgrammableStage::*; #[cfg(feature = "GpuQuerySet")] #[allow(non_snake_case)] @@ -2632,12 +2668,6 @@ mod gen_GpuQueue; #[cfg(feature = "GpuQueue")] pub use gen_GpuQueue::*; -#[cfg(feature = "GpuRasterizationStateDescriptor")] -#[allow(non_snake_case)] -mod gen_GpuRasterizationStateDescriptor; -#[cfg(feature = "GpuRasterizationStateDescriptor")] -pub use gen_GpuRasterizationStateDescriptor::*; - #[cfg(feature = "GpuRenderBundle")] #[allow(non_snake_case)] mod gen_GpuRenderBundle; @@ -2662,17 +2692,17 @@ mod gen_GpuRenderBundleEncoderDescriptor; #[cfg(feature = "GpuRenderBundleEncoderDescriptor")] pub use gen_GpuRenderBundleEncoderDescriptor::*; -#[cfg(feature = "GpuRenderPassColorAttachmentDescriptor")] +#[cfg(feature = "GpuRenderPassColorAttachment")] #[allow(non_snake_case)] -mod gen_GpuRenderPassColorAttachmentDescriptor; -#[cfg(feature = "GpuRenderPassColorAttachmentDescriptor")] -pub use gen_GpuRenderPassColorAttachmentDescriptor::*; +mod gen_GpuRenderPassColorAttachment; +#[cfg(feature = "GpuRenderPassColorAttachment")] +pub use gen_GpuRenderPassColorAttachment::*; -#[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] +#[cfg(feature = "GpuRenderPassDepthStencilAttachment")] #[allow(non_snake_case)] -mod gen_GpuRenderPassDepthStencilAttachmentDescriptor; -#[cfg(feature = "GpuRenderPassDepthStencilAttachmentDescriptor")] -pub use gen_GpuRenderPassDepthStencilAttachmentDescriptor::*; +mod gen_GpuRenderPassDepthStencilAttachment; +#[cfg(feature = "GpuRenderPassDepthStencilAttachment")] +pub use gen_GpuRenderPassDepthStencilAttachment::*; #[cfg(feature = "GpuRenderPassDescriptor")] #[allow(non_snake_case)] @@ -2710,6 +2740,18 @@ mod gen_GpuSampler; #[cfg(feature = "GpuSampler")] pub use gen_GpuSampler::*; +#[cfg(feature = "GpuSamplerBindingLayout")] +#[allow(non_snake_case)] +mod gen_GpuSamplerBindingLayout; +#[cfg(feature = "GpuSamplerBindingLayout")] +pub use gen_GpuSamplerBindingLayout::*; + +#[cfg(feature = "GpuSamplerBindingType")] +#[allow(non_snake_case)] +mod gen_GpuSamplerBindingType; +#[cfg(feature = "GpuSamplerBindingType")] +pub use gen_GpuSamplerBindingType::*; + #[cfg(feature = "GpuSamplerDescriptor")] #[allow(non_snake_case)] mod gen_GpuSamplerDescriptor; @@ -2734,17 +2776,29 @@ mod gen_GpuShaderStage; #[cfg(feature = "GpuShaderStage")] pub use gen_GpuShaderStage::*; +#[cfg(feature = "GpuStencilFaceState")] +#[allow(non_snake_case)] +mod gen_GpuStencilFaceState; +#[cfg(feature = "GpuStencilFaceState")] +pub use gen_GpuStencilFaceState::*; + #[cfg(feature = "GpuStencilOperation")] #[allow(non_snake_case)] mod gen_GpuStencilOperation; #[cfg(feature = "GpuStencilOperation")] pub use gen_GpuStencilOperation::*; -#[cfg(feature = "GpuStencilStateFaceDescriptor")] +#[cfg(feature = "GpuStorageTextureAccess")] #[allow(non_snake_case)] -mod gen_GpuStencilStateFaceDescriptor; -#[cfg(feature = "GpuStencilStateFaceDescriptor")] -pub use gen_GpuStencilStateFaceDescriptor::*; +mod gen_GpuStorageTextureAccess; +#[cfg(feature = "GpuStorageTextureAccess")] +pub use gen_GpuStorageTextureAccess::*; + +#[cfg(feature = "GpuStorageTextureBindingLayout")] +#[allow(non_snake_case)] +mod gen_GpuStorageTextureBindingLayout; +#[cfg(feature = "GpuStorageTextureBindingLayout")] +pub use gen_GpuStorageTextureBindingLayout::*; #[cfg(feature = "GpuStoreOp")] #[allow(non_snake_case)] @@ -2776,23 +2830,11 @@ mod gen_GpuTextureAspect; #[cfg(feature = "GpuTextureAspect")] pub use gen_GpuTextureAspect::*; -#[cfg(feature = "GpuTextureComponentType")] +#[cfg(feature = "GpuTextureBindingLayout")] #[allow(non_snake_case)] -mod gen_GpuTextureComponentType; -#[cfg(feature = "GpuTextureComponentType")] -pub use gen_GpuTextureComponentType::*; - -#[cfg(feature = "GpuTextureCopyView")] -#[allow(non_snake_case)] -mod gen_GpuTextureCopyView; -#[cfg(feature = "GpuTextureCopyView")] -pub use gen_GpuTextureCopyView::*; - -#[cfg(feature = "GpuTextureDataLayout")] -#[allow(non_snake_case)] -mod gen_GpuTextureDataLayout; -#[cfg(feature = "GpuTextureDataLayout")] -pub use gen_GpuTextureDataLayout::*; +mod gen_GpuTextureBindingLayout; +#[cfg(feature = "GpuTextureBindingLayout")] +pub use gen_GpuTextureBindingLayout::*; #[cfg(feature = "GpuTextureDescriptor")] #[allow(non_snake_case)] @@ -2812,6 +2854,12 @@ mod gen_GpuTextureFormat; #[cfg(feature = "GpuTextureFormat")] pub use gen_GpuTextureFormat::*; +#[cfg(feature = "GpuTextureSampleType")] +#[allow(non_snake_case)] +mod gen_GpuTextureSampleType; +#[cfg(feature = "GpuTextureSampleType")] +pub use gen_GpuTextureSampleType::*; + #[cfg(feature = "GpuTextureUsage")] #[allow(non_snake_case)] mod gen_GpuTextureUsage; @@ -2854,17 +2902,17 @@ mod gen_GpuValidationError; #[cfg(feature = "GpuValidationError")] pub use gen_GpuValidationError::*; -#[cfg(feature = "GpuVertexAttributeDescriptor")] +#[cfg(feature = "GpuVertexAttribute")] #[allow(non_snake_case)] -mod gen_GpuVertexAttributeDescriptor; -#[cfg(feature = "GpuVertexAttributeDescriptor")] -pub use gen_GpuVertexAttributeDescriptor::*; +mod gen_GpuVertexAttribute; +#[cfg(feature = "GpuVertexAttribute")] +pub use gen_GpuVertexAttribute::*; -#[cfg(feature = "GpuVertexBufferLayoutDescriptor")] +#[cfg(feature = "GpuVertexBufferLayout")] #[allow(non_snake_case)] -mod gen_GpuVertexBufferLayoutDescriptor; -#[cfg(feature = "GpuVertexBufferLayoutDescriptor")] -pub use gen_GpuVertexBufferLayoutDescriptor::*; +mod gen_GpuVertexBufferLayout; +#[cfg(feature = "GpuVertexBufferLayout")] +pub use gen_GpuVertexBufferLayout::*; #[cfg(feature = "GpuVertexFormat")] #[allow(non_snake_case)] @@ -2872,11 +2920,11 @@ mod gen_GpuVertexFormat; #[cfg(feature = "GpuVertexFormat")] pub use gen_GpuVertexFormat::*; -#[cfg(feature = "GpuVertexStateDescriptor")] +#[cfg(feature = "GpuVertexState")] #[allow(non_snake_case)] -mod gen_GpuVertexStateDescriptor; -#[cfg(feature = "GpuVertexStateDescriptor")] -pub use gen_GpuVertexStateDescriptor::*; +mod gen_GpuVertexState; +#[cfg(feature = "GpuVertexState")] +pub use gen_GpuVertexState::*; #[cfg(feature = "GridDeclaration")] #[allow(non_snake_case)] diff --git a/crates/web-sys/webidls/unstable/WebGPU.webidl b/crates/web-sys/webidls/unstable/WebGPU.webidl index 49ac93bb24d..2188aed7b39 100644 --- a/crates/web-sys/webidls/unstable/WebGPU.webidl +++ b/crates/web-sys/webidls/unstable/WebGPU.webidl @@ -6,17 +6,24 @@ dictionary GPUObjectDescriptorBase { USVString label; }; -dictionary GPULimits { - GPUSize32 maxBindGroups = 4; - GPUSize32 maxDynamicUniformBuffersPerPipelineLayout = 8; - GPUSize32 maxDynamicStorageBuffersPerPipelineLayout = 4; - GPUSize32 maxSampledTexturesPerShaderStage = 16; - GPUSize32 maxSamplersPerShaderStage = 16; - GPUSize32 maxStorageBuffersPerShaderStage = 4; - GPUSize32 maxStorageTexturesPerShaderStage = 4; - GPUSize32 maxUniformBuffersPerShaderStage = 12; - GPUSize32 maxUniformBufferBindingSize = 16384; - GPUSize32 maxStorageBufferBindingSize = 134217728; +interface GPUAdapterLimits { + readonly attribute unsigned long maxTextureDimension1D; + readonly attribute unsigned long maxTextureDimension2D; + readonly attribute unsigned long maxTextureDimension3D; + readonly attribute unsigned long maxTextureArrayLayers; + readonly attribute unsigned long maxBindGroups; + readonly attribute unsigned long maxDynamicUniformBuffersPerPipelineLayout; + readonly attribute unsigned long maxDynamicStorageBuffersPerPipelineLayout; + readonly attribute unsigned long maxSampledTexturesPerShaderStage; + readonly attribute unsigned long maxSamplersPerShaderStage; + readonly attribute unsigned long maxStorageBuffersPerShaderStage; + readonly attribute unsigned long maxStorageTexturesPerShaderStage; + readonly attribute unsigned long maxUniformBuffersPerShaderStage; + readonly attribute unsigned long maxUniformBufferBindingSize; + readonly attribute unsigned long maxStorageBufferBindingSize; + readonly attribute unsigned long maxVertexBuffers; + readonly attribute unsigned long maxVertexAttributes; + readonly attribute unsigned long maxVertexBufferArrayStride; }; interface GPUAdapterFeatures { @@ -50,14 +57,14 @@ enum GPUPowerPreference { interface GPUAdapter { readonly attribute DOMString name; [SameObject] readonly attribute GPUAdapterFeatures features; - //readonly attribute GPULimits limits; Don’t expose higher limits for now. + [SameObject] readonly attribute GPUAdapterLimits limits; - Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); + Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); }; dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { - sequence features = []; - GPULimits limits = {}; + sequence nonGuaranteedFeatures = []; + record nonGuaranteedLimits = {}; }; enum GPUFeatureName { @@ -75,7 +82,9 @@ interface GPUDevice : EventTarget { readonly attribute FrozenArray features; readonly attribute object limits; - [SameObject] readonly attribute GPUQueue defaultQueue; + [SameObject] readonly attribute GPUQueue queue; + + undefined destroy(); GPUBuffer createBuffer(GPUBufferDescriptor descriptor); GPUTexture createTexture(GPUTextureDescriptor descriptor); @@ -88,8 +97,8 @@ interface GPUDevice : EventTarget { GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor); GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor); GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor); - Promise createReadyComputePipeline(GPUComputePipelineDescriptor descriptor); - Promise createReadyRenderPipeline(GPURenderPipelineDescriptor descriptor); + Promise createComputePipelineAsync(GPUComputePipelineDescriptor descriptor); + Promise createRenderPipelineAsync(GPURenderPipelineDescriptor descriptor); GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {}); GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor); @@ -154,7 +163,7 @@ dictionary GPUTextureDescriptor : GPUObjectDescriptorBase { enum GPUTextureDimension { "1d", "2d", - "3d" + "3d", }; typedef [EnforceRange] unsigned long GPUTextureUsageFlags; @@ -274,14 +283,6 @@ enum GPUTextureFormat { "depth32float-stencil8", }; -enum GPUTextureComponentType { - "float", - "sint", - "uint", - // Texture is used with comparison sampling only. - "depth-comparison" -}; - interface GPUSampler { }; GPUSampler includes GPUObjectBase; @@ -296,7 +297,7 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase { float lodMinClamp = 0; float lodMaxClamp = 0xffffffff; // TODO: What should this be? Was Number.MAX_VALUE. GPUCompareFunction compare; - unsigned short maxAnisotropy = 1; + [Clamp] unsigned short maxAnisotropy = 1; }; enum GPUAddressMode { @@ -330,44 +331,68 @@ dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { required sequence entries; }; +typedef [EnforceRange] unsigned long GPUShaderStageFlags; +interface GPUShaderStage { + const GPUFlagsConstant VERTEX = 0x1; + const GPUFlagsConstant FRAGMENT = 0x2; + const GPUFlagsConstant COMPUTE = 0x4; +}; + dictionary GPUBindGroupLayoutEntry { required GPUIndex32 binding; required GPUShaderStageFlags visibility; - required GPUBindingType type; - // Used for uniform buffer and storage buffer bindings. Must be undefined for other binding types. - boolean hasDynamicOffset; + GPUBufferBindingLayout buffer; + GPUSamplerBindingLayout sampler; + GPUTextureBindingLayout texture; + GPUStorageTextureBindingLayout storageTexture; +}; - // Used for uniform buffer and storage buffer bindings. Must be undefined for other binding types. - GPUSize64 minBufferBindingSize; +enum GPUBufferBindingType { + "uniform", + "storage", + "read-only-storage", +}; - // Used for sampled texture and storage texture bindings. Must be undefined for other binding types. - GPUTextureViewDimension viewDimension; +dictionary GPUBufferBindingLayout { + GPUBufferBindingType type = "uniform"; + boolean hasDynamicOffset = false; + GPUSize64 minBindingSize = 0; +}; - // Used for sampled texture bindings. Must be undefined for other binding types. - GPUTextureComponentType textureComponentType; +enum GPUSamplerBindingType { + "filtering", + "non-filtering", + "comparison", +}; - // Used for storage texture bindings. Must be undefined for other binding types. - GPUTextureFormat storageTextureFormat; +dictionary GPUSamplerBindingLayout { + GPUSamplerBindingType type = "filtering"; }; -typedef [EnforceRange] unsigned long GPUShaderStageFlags; -interface GPUShaderStage { - const GPUFlagsConstant VERTEX = 0x1; - const GPUFlagsConstant FRAGMENT = 0x2; - const GPUFlagsConstant COMPUTE = 0x4; +enum GPUTextureSampleType { + "float", + "unfilterable-float", + "depth", + "sint", + "uint", +}; + +dictionary GPUTextureBindingLayout { + GPUTextureSampleType sampleType = "float"; + GPUTextureViewDimension viewDimension = "2d"; + boolean multisampled = false; +}; + +enum GPUStorageTextureAccess { + "read-only", + "write-only", }; -enum GPUBindingType { - "uniform-buffer", - "storage-buffer", - "readonly-storage-buffer", - "sampler", - "comparison-sampler", - "sampled-texture", - "multisampled-texture", - "readonly-storage-texture", - "writeonly-storage-texture" +dictionary GPUStorageTextureBindingLayout { + required GPUStorageTextureAccess access; + required GPUTextureFormat format; + GPUTextureViewDimension viewDimension = "2d"; }; interface GPUBindGroup { @@ -428,7 +453,6 @@ GPUShaderModule includes GPUObjectBase; typedef (USVString or Uint32Array) GPUCode; - dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase { required GPUCode code; object sourceMap; @@ -442,7 +466,7 @@ interface mixin GPUPipelineBase { GPUBindGroupLayout getBindGroupLayout(unsigned long index); }; -dictionary GPUProgrammableStageDescriptor { +dictionary GPUProgrammableStage { required GPUShaderModule module; required USVString entryPoint; }; @@ -454,7 +478,7 @@ GPUComputePipeline includes GPUObjectBase; GPUComputePipeline includes GPUPipelineBase; dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { - required GPUProgrammableStageDescriptor computeStage; + required GPUProgrammableStage compute; }; [Serializable] @@ -464,18 +488,11 @@ GPURenderPipeline includes GPUObjectBase; GPURenderPipeline includes GPUPipelineBase; dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { - required GPUProgrammableStageDescriptor vertexStage; - GPUProgrammableStageDescriptor fragmentStage; - - required GPUPrimitiveTopology primitiveTopology; - GPURasterizationStateDescriptor rasterizationState = {}; - required sequence colorStates; - GPUDepthStencilStateDescriptor depthStencilState; - GPUVertexStateDescriptor vertexState = {}; - - GPUSize32 sampleCount = 1; - GPUSampleMask sampleMask = 0xFFFFFFFF; - boolean alphaToCoverageEnabled = false; + required GPUVertexState vertex; + GPUPrimitiveState primitive = {}; + GPUDepthStencilState depthStencil; + GPUMultisampleState multisample = {}; + GPUFragmentState fragment; }; enum GPUPrimitiveTopology { @@ -486,15 +503,11 @@ enum GPUPrimitiveTopology { "triangle-strip" }; -dictionary GPURasterizationStateDescriptor { +dictionary GPUPrimitiveState { + GPUPrimitiveTopology topology = "triangle-list"; + GPUIndexFormat stripIndexFormat; GPUFrontFace frontFace = "ccw"; GPUCullMode cullMode = "none"; - // Enable depth clamping (requires "depth-clamping" feature) - boolean clampDepth = false; - - GPUDepthBias depthBias = 0; - float depthBiasSlopeScale = 0; - float depthBiasClamp = 0; }; enum GPUFrontFace { @@ -508,14 +521,28 @@ enum GPUCullMode { "back" }; -dictionary GPUColorStateDescriptor { +dictionary GPUMultisampleState { + GPUSize32 count = 1; + GPUSampleMask mask = 0xFFFFFFFF; + boolean alphaToCoverageEnabled = false; +}; + +dictionary GPUFragmentState: GPUProgrammableStage { + required sequence targets; +}; + +dictionary GPUColorTargetState { required GPUTextureFormat format; - GPUBlendDescriptor alphaBlend = {}; - GPUBlendDescriptor colorBlend = {}; + GPUBlendState blend; GPUColorWriteFlags writeMask = 0xF; // GPUColorWrite.ALL }; +dictionary GPUBlendState { + required GPUBlendComponent color; + required GPUBlendComponent alpha; +}; + typedef [EnforceRange] unsigned long GPUColorWriteFlags; interface GPUColorWrite { const GPUFlagsConstant RED = 0x1; @@ -525,7 +552,7 @@ interface GPUColorWrite { const GPUFlagsConstant ALL = 0xF; }; -dictionary GPUBlendDescriptor { +dictionary GPUBlendComponent { GPUBlendFactor srcFactor = "one"; GPUBlendFactor dstFactor = "zero"; GPUBlendOperation operation = "add"; @@ -555,20 +582,27 @@ enum GPUBlendOperation { "max" }; -dictionary GPUDepthStencilStateDescriptor { +dictionary GPUDepthStencilState { required GPUTextureFormat format; boolean depthWriteEnabled = false; GPUCompareFunction depthCompare = "always"; - GPUStencilStateFaceDescriptor stencilFront = {}; - GPUStencilStateFaceDescriptor stencilBack = {}; + GPUStencilFaceState stencilFront = {}; + GPUStencilFaceState stencilBack = {}; GPUStencilValue stencilReadMask = 0xFFFFFFFF; GPUStencilValue stencilWriteMask = 0xFFFFFFFF; + + GPUDepthBias depthBias = 0; + float depthBiasSlopeScale = 0; + float depthBiasClamp = 0; + + // Enable depth clamping (requires "depth-clamping" feature) + boolean clampDepth = false; }; -dictionary GPUStencilStateFaceDescriptor { +dictionary GPUStencilFaceState { GPUCompareFunction compare = "always"; GPUStencilOperation failOp = "keep"; GPUStencilOperation depthFailOp = "keep"; @@ -592,36 +626,36 @@ enum GPUIndexFormat { }; enum GPUVertexFormat { - "uchar2", - "uchar4", - "char2", - "char4", - "uchar2norm", - "uchar4norm", - "char2norm", - "char4norm", - "ushort2", - "ushort4", - "short2", - "short4", - "ushort2norm", - "ushort4norm", - "short2norm", - "short4norm", - "half2", - "half4", - "float", - "float2", - "float3", - "float4", - "uint", - "uint2", - "uint3", - "uint4", - "int", - "int2", - "int3", - "int4" + "uint8x2", + "uint8x4", + "sint8x2", + "sint8x4", + "unorm8x2", + "unorm8x4", + "snorm8x2", + "snorm8x4", + "uint16x2", + "uint16x4", + "sint16x2", + "sint16x4", + "unorm16x2", + "unorm16x4", + "snorm16x2", + "snorm16x4", + "float16x2", + "float16x4", + "float32", + "float32x2", + "float32x3", + "float32x4", + "uint32", + "uint32x2", + "uint32x3", + "uint32x4", + "sint32", + "sint32x2", + "sint32x3", + "sint32x4", }; enum GPUInputStepMode { @@ -629,18 +663,17 @@ enum GPUInputStepMode { "instance" }; -dictionary GPUVertexStateDescriptor { - GPUIndexFormat indexFormat; - sequence vertexBuffers = []; +dictionary GPUVertexState: GPUProgrammableStage { + sequence buffers = []; }; -dictionary GPUVertexBufferLayoutDescriptor { +dictionary GPUVertexBufferLayout { required GPUSize64 arrayStride; GPUInputStepMode stepMode = "vertex"; - required sequence attributes; + required sequence attributes; }; -dictionary GPUVertexAttributeDescriptor { +dictionary GPUVertexAttribute { required GPUVertexFormat format; required GPUSize64 offset; @@ -667,18 +700,18 @@ interface GPUCommandEncoder { GPUSize64 size); undefined copyBufferToTexture( - GPUBufferCopyView source, - GPUTextureCopyView destination, + GPUImageCopyBuffer source, + GPUImageCopyTexture destination, GPUExtent3D copySize); undefined copyTextureToBuffer( - GPUTextureCopyView source, - GPUBufferCopyView destination, + GPUImageCopyTexture source, + GPUImageCopyBuffer destination, GPUExtent3D copySize); undefined copyTextureToTexture( - GPUTextureCopyView source, - GPUTextureCopyView destination, + GPUImageCopyTexture source, + GPUImageCopyTexture destination, GPUExtent3D copySize); undefined pushDebugGroup(USVString groupLabel); @@ -704,24 +737,24 @@ dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase { // TODO: reusability flag? }; -dictionary GPUTextureDataLayout { +dictionary GPUImageDataLayout { GPUSize64 offset = 0; GPUSize32 bytesPerRow; GPUSize32 rowsPerImage; }; -dictionary GPUBufferCopyView : GPUTextureDataLayout { +dictionary GPUImageCopyBuffer : GPUImageDataLayout { required GPUBuffer buffer; }; -dictionary GPUTextureCopyView { +dictionary GPUImageCopyTexture { required GPUTexture texture; GPUIntegerCoordinate mipLevel = 0; GPUOrigin3D origin = {}; GPUTextureAspect aspect = "all"; }; -dictionary GPUImageBitmapCopyView { +dictionary GPUImageCopyImageBitmap { required ImageBitmap imageBitmap; GPUOrigin2D origin = {}; }; @@ -761,7 +794,7 @@ dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase { interface mixin GPURenderEncoderBase { undefined setPipeline(GPURenderPipeline pipeline); - undefined setIndexBuffer(GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); + undefined setIndexBuffer(GPUBuffer buffer, GPUIndexFormat indexFormat, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); undefined draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1, @@ -802,21 +835,21 @@ GPURenderPassEncoder includes GPUProgrammablePassEncoder; GPURenderPassEncoder includes GPURenderEncoderBase; dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase { - required sequence colorAttachments; - GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment; + required sequence colorAttachments; + GPURenderPassDepthStencilAttachment depthStencilAttachment; GPUQuerySet occlusionQuerySet; }; -dictionary GPURenderPassColorAttachmentDescriptor { - required GPUTextureView attachment; +dictionary GPURenderPassColorAttachment { + required GPUTextureView view; GPUTextureView resolveTarget; required (GPULoadOp or GPUColor) loadValue; GPUStoreOp storeOp = "store"; }; -dictionary GPURenderPassDepthStencilAttachmentDescriptor { - required GPUTextureView attachment; +dictionary GPURenderPassDepthStencilAttachment { + required GPUTextureView view; required (GPULoadOp or float) depthLoadValue; required GPUStoreOp depthStoreOp; @@ -859,8 +892,7 @@ dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase { interface GPUQueue { undefined submit(sequence commandBuffers); - GPUFence createFence(optional GPUFenceDescriptor descriptor = {}); - undefined signal(GPUFence fence, GPUFenceValue signalValue); + Promise onSubmittedWorkDone(); undefined writeBuffer( GPUBuffer buffer, @@ -870,28 +902,18 @@ interface GPUQueue { optional GPUSize64 size); undefined writeTexture( - GPUTextureCopyView destination, + GPUImageCopyTexture destination, [AllowShared] BufferSource data, - GPUTextureDataLayout dataLayout, + GPUImageDataLayout dataLayout, GPUExtent3D size); undefined copyImageBitmapToTexture( - GPUImageBitmapCopyView source, - GPUTextureCopyView destination, + GPUImageCopyImageBitmap source, + GPUImageCopyTexture destination, GPUExtent3D copySize); }; GPUQueue includes GPUObjectBase; -interface GPUFence { - GPUFenceValue getCompletedValue(); - Promise onCompletion(GPUFenceValue completionValue); -}; -GPUFence includes GPUObjectBase; - -dictionary GPUFenceDescriptor : GPUObjectDescriptorBase { - GPUFenceValue initialValue = 0; -}; - interface GPUQuerySet { undefined destroy(); }; @@ -920,7 +942,7 @@ enum GPUPipelineStatisticName { interface GPUCanvasContext { GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor); - Promise getSwapChainPreferredFormat(GPUDevice device); + GPUTextureFormat getSwapChainPreferredFormat(GPUAdapter adapter); }; dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase { @@ -934,7 +956,12 @@ interface GPUSwapChain { }; GPUSwapChain includes GPUObjectBase; +enum GPUDeviceLostReason { + "destroyed", +}; + interface GPUDeviceLostInfo { + readonly attribute (GPUDeviceLostReason or undefined) reason; readonly attribute DOMString message; }; @@ -984,7 +1011,6 @@ partial interface GPUDevice { }; typedef [EnforceRange] unsigned long GPUBufferDynamicOffset; -typedef [EnforceRange] unsigned long long GPUFenceValue; typedef [EnforceRange] unsigned long GPUStencilValue; typedef [EnforceRange] unsigned long GPUSampleMask; typedef [EnforceRange] long GPUDepthBias; @@ -1019,8 +1045,8 @@ dictionary GPUOrigin3DDict { typedef (sequence or GPUOrigin3DDict) GPUOrigin3D; dictionary GPUExtent3DDict { - GPUIntegerCoordinate width = 1; + required GPUIntegerCoordinate width; GPUIntegerCoordinate height = 1; - GPUIntegerCoordinate depth = 1; + GPUIntegerCoordinate depthOrArrayLayers = 1; }; typedef (sequence or GPUExtent3DDict) GPUExtent3D;