diff options
author | Leo K <crowlkats@toaxl.com> | 2021-08-24 13:29:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 13:29:42 +0200 |
commit | f4a9db350fbf00a6cb13a2c030b925cfd5218ed2 (patch) | |
tree | 3ab5cc4f4db7e4855df04fc792ee1e66e05a5d13 /ext/webgpu/webgpu.idl | |
parent | 50f69a6996ae4dcdfe53f15fc49949d3756c9787 (diff) |
chore(ext/webgpu): update wgpu to 0.10.0 (#11781)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'ext/webgpu/webgpu.idl')
-rw-r--r-- | ext/webgpu/webgpu.idl | 109 |
1 files changed, 57 insertions, 52 deletions
diff --git a/ext/webgpu/webgpu.idl b/ext/webgpu/webgpu.idl index b2a536f2f..026506996 100644 --- a/ext/webgpu/webgpu.idl +++ b/ext/webgpu/webgpu.idl @@ -6,7 +6,7 @@ dictionary GPUObjectDescriptorBase { USVString label; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUSupportedLimits { readonly attribute unsigned long maxTextureDimension1D; readonly attribute unsigned long maxTextureDimension2D; @@ -20,8 +20,8 @@ interface GPUSupportedLimits { 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 long maxUniformBufferBindingSize; + readonly attribute unsigned long long maxStorageBufferBindingSize; readonly attribute unsigned long minUniformBufferOffsetAlignment; readonly attribute unsigned long minStorageBufferOffsetAlignment; readonly attribute unsigned long maxVertexBuffers; @@ -29,11 +29,14 @@ interface GPUSupportedLimits { readonly attribute unsigned long maxVertexBufferArrayStride; readonly attribute unsigned long maxInterStageShaderComponents; readonly attribute unsigned long maxComputeWorkgroupStorageSize; - readonly attribute unsigned long maxComputeWorkgroupInvocations; - readonly attribute unsigned long maxComputePerDimensionDispatchSize; + readonly attribute unsigned long maxComputeInvocationsPerWorkgroup; + readonly attribute unsigned long maxComputeWorkgroupSizeX; + readonly attribute unsigned long maxComputeWorkgroupSizeY; + readonly attribute unsigned long maxComputeWorkgroupSizeZ; + readonly attribute unsigned long maxComputeWorkgroupsPerDimension; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUSupportedFeatures { readonly setlike<DOMString>; }; @@ -55,7 +58,7 @@ interface GPU { dictionary GPURequestAdapterOptions { GPUPowerPreference powerPreference; - boolean forceSoftware = false; + boolean forceFallbackAdapter = false; }; enum GPUPowerPreference { @@ -63,19 +66,19 @@ enum GPUPowerPreference { "high-performance" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUAdapter { readonly attribute DOMString name; [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; - readonly attribute boolean isSoftware; + readonly attribute boolean isFallbackAdapter; Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {}); }; dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { sequence<GPUFeatureName> requiredFeatures = []; - record<DOMString, GPUSize32> requiredLimits = {}; + record<DOMString, GPUSize64> requiredLimits = {}; }; enum GPUFeatureName { @@ -87,7 +90,7 @@ enum GPUFeatureName { "timestamp-query", }; -[Exposed=(Window, DedicatedWorker), Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; @@ -117,7 +120,7 @@ interface GPUDevice : EventTarget { }; GPUDevice includes GPUObjectBase; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUBuffer { Promise<undefined> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size); ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size); @@ -134,7 +137,7 @@ dictionary GPUBufferDescriptor : GPUObjectDescriptorBase { }; typedef [EnforceRange] unsigned long GPUBufferUsageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUBufferUsage { const GPUFlagsConstant MAP_READ = 0x0001; const GPUFlagsConstant MAP_WRITE = 0x0002; @@ -149,13 +152,13 @@ interface GPUBufferUsage { }; typedef [EnforceRange] unsigned long GPUMapModeFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUMapMode { const GPUFlagsConstant READ = 0x0001; const GPUFlagsConstant WRITE = 0x0002; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUTexture { GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {}); @@ -179,16 +182,16 @@ enum GPUTextureDimension { }; typedef [EnforceRange] unsigned long GPUTextureUsageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUTextureUsage { const GPUFlagsConstant COPY_SRC = 0x01; const GPUFlagsConstant COPY_DST = 0x02; - const GPUFlagsConstant SAMPLED = 0x04; - const GPUFlagsConstant STORAGE = 0x08; + const GPUFlagsConstant TEXTURE_BINDING = 0x04; + const GPUFlagsConstant STORAGE_BINDING = 0x08; const GPUFlagsConstant RENDER_ATTACHMENT = 0x10; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUTextureView { }; GPUTextureView includes GPUObjectBase; @@ -297,7 +300,7 @@ enum GPUTextureFormat { "depth32float-stencil8", }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUSampler { }; GPUSampler includes GPUObjectBase; @@ -310,7 +313,7 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase { GPUFilterMode minFilter = "nearest"; GPUFilterMode mipmapFilter = "nearest"; float lodMinClamp = 0; - float lodMaxClamp = 0xffffffff; // TODO: What should this be? Was Number.MAX_VALUE. + float lodMaxClamp = 32; GPUCompareFunction compare; [Clamp] unsigned short maxAnisotropy = 1; }; @@ -337,7 +340,7 @@ enum GPUCompareFunction { "always" }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroupLayout { }; GPUBindGroupLayout includes GPUObjectBase; @@ -347,7 +350,7 @@ dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { }; typedef [EnforceRange] unsigned long GPUShaderStageFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUShaderStage { const GPUFlagsConstant VERTEX = 0x1; const GPUFlagsConstant FRAGMENT = 0x2; @@ -401,17 +404,16 @@ dictionary GPUTextureBindingLayout { }; enum GPUStorageTextureAccess { - "read-only", "write-only", }; dictionary GPUStorageTextureBindingLayout { - required GPUStorageTextureAccess access; + GPUStorageTextureAccess access = "write-only"; required GPUTextureFormat format; GPUTextureViewDimension viewDimension = "2d"; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroup { }; GPUBindGroup includes GPUObjectBase; @@ -434,7 +436,7 @@ dictionary GPUBufferBinding { GPUSize64 size; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUPipelineLayout { }; GPUPipelineLayout includes GPUObjectBase; @@ -443,7 +445,7 @@ dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { required sequence<GPUBindGroupLayout> bindGroupLayouts; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUShaderModule { Promise<GPUCompilationInfo> compilationInfo(); }; @@ -460,7 +462,7 @@ enum GPUCompilationMessageType { "info" }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationMessage { readonly attribute DOMString message; readonly attribute GPUCompilationMessageType type; @@ -470,7 +472,7 @@ interface GPUCompilationMessage { readonly attribute unsigned long long length; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationInfo { readonly attribute FrozenArray<GPUCompilationMessage> messages; }; @@ -491,7 +493,7 @@ dictionary GPUProgrammableStage { typedef double GPUPipelineConstantValue; // May represent WGSL’s bool, f32, i32, u32. -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPUComputePipeline { }; GPUComputePipeline includes GPUObjectBase; @@ -501,7 +503,7 @@ dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { required GPUProgrammableStage compute; }; -[Exposed=Window, Serializable] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPipeline { }; GPURenderPipeline includes GPUObjectBase; @@ -567,7 +569,7 @@ dictionary GPUBlendState { }; typedef [EnforceRange] unsigned long GPUColorWriteFlags; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUColorWrite { const GPUFlagsConstant RED = 0x1; const GPUFlagsConstant GREEN = 0x2; @@ -679,7 +681,7 @@ enum GPUVertexFormat { "sint32x4", }; -enum GPUInputStepMode { +enum GPUVertexStepMode { "vertex", "instance" }; @@ -690,7 +692,7 @@ dictionary GPUVertexState: GPUProgrammableStage { dictionary GPUVertexBufferLayout { required GPUSize64 arrayStride; - GPUInputStepMode stepMode = "vertex"; + GPUVertexStepMode stepMode = "vertex"; required sequence<GPUVertexAttribute> attributes; }; @@ -701,7 +703,7 @@ dictionary GPUVertexAttribute { required GPUIndex32 shaderLocation; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandBuffer { readonly attribute Promise<double> executionTime; }; @@ -710,7 +712,7 @@ GPUCommandBuffer includes GPUObjectBase; dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandEncoder { GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {}); @@ -756,8 +758,6 @@ GPUCommandEncoder includes GPUObjectBase; dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase { boolean measureExecutionTime = false; - - // TODO: reusability flag? }; dictionary GPUImageDataLayout { @@ -791,7 +791,7 @@ interface mixin GPUProgrammablePassEncoder { undefined insertDebugMarker(USVString markerLabel); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUComputePassEncoder { undefined setPipeline(GPUComputePipeline pipeline); undefined dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1); @@ -827,7 +827,7 @@ interface mixin GPURenderEncoderBase { undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPassEncoder { undefined setViewport(float x, float y, float width, float height, @@ -889,7 +889,13 @@ enum GPUStoreOp { "discard" }; -[Exposed=Window] +dictionary GPURenderPassLayout: GPUObjectDescriptorBase { + required sequence<GPUTextureFormat> colorFormats; + GPUTextureFormat depthStencilFormat; + GPUSize32 sampleCount = 1; +}; + +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundle { }; GPURenderBundle includes GPUObjectBase; @@ -897,7 +903,7 @@ GPURenderBundle includes GPUObjectBase; dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase { }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundleEncoder { GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {}); }; @@ -905,13 +911,12 @@ GPURenderBundleEncoder includes GPUObjectBase; GPURenderBundleEncoder includes GPUProgrammablePassEncoder; GPURenderBundleEncoder includes GPURenderEncoderBase; -dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase { - required sequence<GPUTextureFormat> colorFormats; - GPUTextureFormat depthStencilFormat; - GPUSize32 sampleCount = 1; +dictionary GPURenderBundleEncoderDescriptor : GPURenderPassLayout { + boolean depthReadOnly = false; + boolean stencilReadOnly = false; }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUQueue { undefined submit(sequence<GPUCommandBuffer> commandBuffers); @@ -932,7 +937,7 @@ interface GPUQueue { }; GPUQueue includes GPUObjectBase; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUQuerySet { undefined destroy(); }; @@ -962,7 +967,7 @@ enum GPUDeviceLostReason { "destroyed", }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUDeviceLostInfo { readonly attribute (GPUDeviceLostReason or undefined) reason; readonly attribute DOMString message; @@ -977,12 +982,12 @@ enum GPUErrorFilter { "validation" }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUOutOfMemoryError { constructor(); }; -[Exposed=Window] +[Exposed=(Window, DedicatedWorker)] interface GPUValidationError { constructor(DOMString message); readonly attribute DOMString message; |