Skip to content

Commit

Permalink
Update to latest WebGPU WebIDL (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
grovesNL committed Mar 8, 2021
1 parent 1ca80e3 commit 1e4390f
Show file tree
Hide file tree
Showing 50 changed files with 1,856 additions and 1,453 deletions.
48 changes: 28 additions & 20 deletions crates/web-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -404,25 +404,27 @@ GetUserMediaRequest = []
Gpu = []
GpuAdapter = []
GpuAdapterFeatures = []
GpuAdapterLimits = []
GpuAddressMode = []
GpuBindGroup = []
GpuBindGroupDescriptor = []
GpuBindGroupEntry = []
GpuBindGroupLayout = []
GpuBindGroupLayoutDescriptor = []
GpuBindGroupLayoutEntry = []
GpuBindingType = []
GpuBlendDescriptor = []
GpuBlendComponent = []
GpuBlendFactor = []
GpuBlendOperation = []
GpuBlendState = []
GpuBuffer = []
GpuBufferBinding = []
GpuBufferCopyView = []
GpuBufferBindingLayout = []
GpuBufferBindingType = []
GpuBufferDescriptor = []
GpuBufferUsage = []
GpuCanvasContext = []
GpuColorDict = []
GpuColorStateDescriptor = []
GpuColorTargetState = []
GpuColorWrite = []
GpuCommandBuffer = []
GpuCommandBufferDescriptor = []
Expand All @@ -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 = []
Expand All @@ -463,53 +468,56 @@ 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 = []
GpuTextureViewDimension = []
GpuUncapturedErrorEvent = ["Event"]
GpuUncapturedErrorEventInit = []
GpuValidationError = []
GpuVertexAttributeDescriptor = []
GpuVertexBufferLayoutDescriptor = []
GpuVertexAttribute = []
GpuVertexBufferLayout = []
GpuVertexFormat = []
GpuVertexStateDescriptor = []
GpuVertexState = []
GridDeclaration = []
GridTrackState = []
GroupedHistoryEventInit = []
Expand Down
12 changes: 12 additions & 0 deletions crates/web-sys/src/features/gen_GpuAdapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""]
Expand Down
205 changes: 205 additions & 0 deletions crates/web-sys/src/features/gen_GpuAdapterLimits.rs
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit 1e4390f

Please sign in to comment.