diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-01-20 15:23:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 15:23:53 +0100 |
commit | 3ab68bd0a2aff6df12388f2c3b5ed7ae3333a6ca (patch) | |
tree | 9a81824deb4e5a2b29c3eeb5a2adaa3e00720c45 /ext/webgpu/webgpu.idl | |
parent | 1cc38f5155bdc5605d74cd959660fa04f782ac63 (diff) |
revert(#13402): experiment: wgpu sync (#13439)
Diffstat (limited to 'ext/webgpu/webgpu.idl')
-rw-r--r-- | ext/webgpu/webgpu.idl | 187 |
1 files changed, 69 insertions, 118 deletions
diff --git a/ext/webgpu/webgpu.idl b/ext/webgpu/webgpu.idl index 79d65791d..026506996 100644 --- a/ext/webgpu/webgpu.idl +++ b/ext/webgpu/webgpu.idl @@ -6,7 +6,7 @@ dictionary GPUObjectDescriptorBase { USVString label; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUSupportedLimits { readonly attribute unsigned long maxTextureDimension1D; readonly attribute unsigned long maxTextureDimension2D; @@ -36,7 +36,7 @@ interface GPUSupportedLimits { readonly attribute unsigned long maxComputeWorkgroupsPerDimension; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUSupportedFeatures { readonly setlike<DOMString>; }; @@ -46,12 +46,12 @@ enum GPUPredefinedColorSpace { }; interface mixin NavigatorGPU { - [SameObject, SecureContext] readonly attribute GPU gpu; + [SameObject] readonly attribute GPU gpu; }; Navigator includes NavigatorGPU; WorkerNavigator includes NavigatorGPU; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPU { Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {}); }; @@ -63,10 +63,10 @@ dictionary GPURequestAdapterOptions { enum GPUPowerPreference { "low-power", - "high-performance", + "high-performance" }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUAdapter { readonly attribute DOMString name; [SameObject] readonly attribute GPUSupportedFeatures features; @@ -82,18 +82,15 @@ dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { }; enum GPUFeatureName { - "depth-clip-control", + "depth-clamping", "depth24unorm-stencil8", "depth32float-stencil8", "pipeline-statistics-query", "texture-compression-bc", - "texture-compression-etc2", - "texture-compression-astc", "timestamp-query", - "indirect-first-instance", }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; @@ -123,7 +120,7 @@ interface GPUDevice : EventTarget { }; GPUDevice includes GPUObjectBase; -[Exposed=(Window, DedicatedWorker), SecureContext] +[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); @@ -161,7 +158,7 @@ interface GPUMapMode { const GPUFlagsConstant WRITE = 0x0002; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUTexture { GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {}); @@ -194,7 +191,7 @@ interface GPUTextureUsage { const GPUFlagsConstant RENDER_ATTACHMENT = 0x10; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUTextureView { }; GPUTextureView includes GPUObjectBase; @@ -215,13 +212,13 @@ enum GPUTextureViewDimension { "2d-array", "cube", "cube-array", - "3d", + "3d" }; enum GPUTextureAspect { "all", "stencil-only", - "depth-only", + "depth-only" }; enum GPUTextureFormat { @@ -296,50 +293,6 @@ enum GPUTextureFormat { "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", - // ETC2 compressed formats usable if "texture-compression-etc2" is both - // supported by the device/user agent and enabled in requestDevice. - "etc2-rgb8unorm", - "etc2-rgb8unorm-srgb", - "etc2-rgb8a1unorm", - "etc2-rgb8a1unorm-srgb", - "etc2-rgba8unorm", - "etc2-rgba8unorm-srgb", - "eac-r11unorm", - "eac-r11snorm", - "eac-rg11unorm", - "eac-rg11snorm", - - // ASTC compressed formats usable if "texture-compression-astc" is both - // supported by the device/user agent and enabled in requestDevice. - "astc-4x4-unorm", - "astc-4x4-unorm-srgb", - "astc-5x4-unorm", - "astc-5x4-unorm-srgb", - "astc-5x5-unorm", - "astc-5x5-unorm-srgb", - "astc-6x5-unorm", - "astc-6x5-unorm-srgb", - "astc-6x6-unorm", - "astc-6x6-unorm-srgb", - "astc-8x5-unorm", - "astc-8x5-unorm-srgb", - "astc-8x6-unorm", - "astc-8x6-unorm-srgb", - "astc-8x8-unorm", - "astc-8x8-unorm-srgb", - "astc-10x5-unorm", - "astc-10x5-unorm-srgb", - "astc-10x6-unorm", - "astc-10x6-unorm-srgb", - "astc-10x8-unorm", - "astc-10x8-unorm-srgb", - "astc-10x10-unorm", - "astc-10x10-unorm-srgb", - "astc-12x10-unorm", - "astc-12x10-unorm-srgb", - "astc-12x12-unorm", - "astc-12x12-unorm-srgb", - // "depth24unorm-stencil8" feature "depth24unorm-stencil8", @@ -347,7 +300,7 @@ enum GPUTextureFormat { "depth32float-stencil8", }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUSampler { }; GPUSampler includes GPUObjectBase; @@ -368,12 +321,12 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase { enum GPUAddressMode { "clamp-to-edge", "repeat", - "mirror-repeat", + "mirror-repeat" }; enum GPUFilterMode { "nearest", - "linear", + "linear" }; enum GPUCompareFunction { @@ -384,10 +337,10 @@ enum GPUCompareFunction { "greater", "not-equal", "greater-equal", - "always", + "always" }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroupLayout { }; GPUBindGroupLayout includes GPUObjectBase; @@ -437,11 +390,11 @@ dictionary GPUSamplerBindingLayout { }; enum GPUTextureSampleType { - "float", - "unfilterable-float", - "depth", - "sint", - "uint", + "float", + "unfilterable-float", + "depth", + "sint", + "uint", }; dictionary GPUTextureBindingLayout { @@ -460,7 +413,7 @@ dictionary GPUStorageTextureBindingLayout { GPUTextureViewDimension viewDimension = "2d"; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUBindGroup { }; GPUBindGroup includes GPUObjectBase; @@ -483,7 +436,7 @@ dictionary GPUBufferBinding { GPUSize64 size; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUPipelineLayout { }; GPUPipelineLayout includes GPUObjectBase; @@ -492,7 +445,7 @@ dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { required sequence<GPUBindGroupLayout> bindGroupLayouts; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUShaderModule { Promise<GPUCompilationInfo> compilationInfo(); }; @@ -506,10 +459,10 @@ dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase { enum GPUCompilationMessageType { "error", "warning", - "info", + "info" }; -[Exposed=(Window, DedicatedWorker), Serializable, SecureContext] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationMessage { readonly attribute DOMString message; readonly attribute GPUCompilationMessageType type; @@ -519,7 +472,7 @@ interface GPUCompilationMessage { readonly attribute unsigned long long length; }; -[Exposed=(Window, DedicatedWorker), Serializable, SecureContext] +[Exposed=(Window, DedicatedWorker), Serializable] interface GPUCompilationInfo { readonly attribute FrozenArray<GPUCompilationMessage> messages; }; @@ -540,7 +493,7 @@ dictionary GPUProgrammableStage { typedef double GPUPipelineConstantValue; // May represent WGSL’s bool, f32, i32, u32. -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUComputePipeline { }; GPUComputePipeline includes GPUObjectBase; @@ -550,7 +503,7 @@ dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { required GPUProgrammableStage compute; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPipeline { }; GPURenderPipeline includes GPUObjectBase; @@ -569,7 +522,7 @@ enum GPUPrimitiveTopology { "line-list", "line-strip", "triangle-list", - "triangle-strip", + "triangle-strip" }; dictionary GPUPrimitiveState { @@ -578,19 +531,19 @@ dictionary GPUPrimitiveState { GPUFrontFace frontFace = "ccw"; GPUCullMode cullMode = "none"; - // Requires "depth-clip-control" feature. - boolean unclippedDepth = false; + // Enable depth clamping (requires "depth-clamping" feature) + boolean clampDepth = false; }; enum GPUFrontFace { "ccw", - "cw", + "cw" }; enum GPUCullMode { "none", "front", - "back", + "back" }; dictionary GPUMultisampleState { @@ -599,7 +552,7 @@ dictionary GPUMultisampleState { boolean alphaToCoverageEnabled = false; }; -dictionary GPUFragmentState : GPUProgrammableStage { +dictionary GPUFragmentState: GPUProgrammableStage { required sequence<GPUColorTargetState> targets; }; @@ -626,9 +579,9 @@ interface GPUColorWrite { }; dictionary GPUBlendComponent { - GPUBlendOperation operation = "add"; GPUBlendFactor srcFactor = "one"; GPUBlendFactor dstFactor = "zero"; + GPUBlendOperation operation = "add"; }; enum GPUBlendFactor { @@ -644,7 +597,7 @@ enum GPUBlendFactor { "one-minus-dst-alpha", "src-alpha-saturated", "constant", - "one-minus-constant", + "one-minus-constant" }; enum GPUBlendOperation { @@ -652,7 +605,7 @@ enum GPUBlendOperation { "subtract", "reverse-subtract", "min", - "max", + "max" }; dictionary GPUDepthStencilState { @@ -687,12 +640,12 @@ enum GPUStencilOperation { "increment-clamp", "decrement-clamp", "increment-wrap", - "decrement-wrap", + "decrement-wrap" }; enum GPUIndexFormat { "uint16", - "uint32", + "uint32" }; enum GPUVertexFormat { @@ -730,10 +683,10 @@ enum GPUVertexFormat { enum GPUVertexStepMode { "vertex", - "instance", + "instance" }; -dictionary GPUVertexState : GPUProgrammableStage { +dictionary GPUVertexState: GPUProgrammableStage { sequence<GPUVertexBufferLayout?> buffers = []; }; @@ -750,15 +703,16 @@ dictionary GPUVertexAttribute { required GPUIndex32 shaderLocation; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandBuffer { + readonly attribute Promise<double> executionTime; }; GPUCommandBuffer includes GPUObjectBase; dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUCommandEncoder { GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {}); @@ -785,11 +739,6 @@ interface GPUCommandEncoder { GPUImageCopyTexture destination, GPUExtent3D copySize); - undefined clearBuffer( - GPUBuffer destination, - GPUSize64 destinationOffset, - GPUSize64 size); - undefined pushDebugGroup(USVString groupLabel); undefined popDebugGroup(); undefined insertDebugMarker(USVString markerLabel); @@ -808,6 +757,7 @@ interface GPUCommandEncoder { GPUCommandEncoder includes GPUObjectBase; dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase { + boolean measureExecutionTime = false; }; dictionary GPUImageDataLayout { @@ -841,7 +791,7 @@ interface mixin GPUProgrammablePassEncoder { undefined insertDebugMarker(USVString markerLabel); }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUComputePassEncoder { undefined setPipeline(GPUComputePipeline pipeline); undefined dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1); @@ -877,7 +827,7 @@ interface mixin GPURenderEncoderBase { undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPURenderPassEncoder { undefined setViewport(float x, float y, float width, float height, @@ -931,12 +881,12 @@ dictionary GPURenderPassDepthStencilAttachment { }; enum GPULoadOp { - "load", + "load" }; enum GPUStoreOp { "store", - "discard", + "discard" }; dictionary GPURenderPassLayout: GPUObjectDescriptorBase { @@ -945,7 +895,7 @@ dictionary GPURenderPassLayout: GPUObjectDescriptorBase { GPUSize32 sampleCount = 1; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundle { }; GPURenderBundle includes GPUObjectBase; @@ -953,7 +903,7 @@ GPURenderBundle includes GPUObjectBase; dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase { }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPURenderBundleEncoder { GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {}); }; @@ -966,7 +916,7 @@ dictionary GPURenderBundleEncoderDescriptor : GPURenderPassLayout { boolean stencilReadOnly = false; }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUQueue { undefined submit(sequence<GPUCommandBuffer> commandBuffers); @@ -980,14 +930,14 @@ interface GPUQueue { optional GPUSize64 size); undefined writeTexture( - GPUImageCopyTexture destination, - [AllowShared] BufferSource data, - GPUImageDataLayout dataLayout, - GPUExtent3D size); + GPUImageCopyTexture destination, + [AllowShared] BufferSource data, + GPUImageDataLayout dataLayout, + GPUExtent3D size); }; GPUQueue includes GPUObjectBase; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUQuerySet { undefined destroy(); }; @@ -1002,7 +952,7 @@ dictionary GPUQuerySetDescriptor : GPUObjectDescriptorBase { enum GPUQueryType { "occlusion", "pipeline-statistics", - "timestamp", + "timestamp" }; enum GPUPipelineStatisticName { @@ -1010,14 +960,14 @@ enum GPUPipelineStatisticName { "clipper-invocations", "clipper-primitives-out", "fragment-shader-invocations", - "compute-shader-invocations", + "compute-shader-invocations" }; enum GPUDeviceLostReason { "destroyed", }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUDeviceLostInfo { readonly attribute (GPUDeviceLostReason or undefined) reason; readonly attribute DOMString message; @@ -1029,15 +979,15 @@ partial interface GPUDevice { enum GPUErrorFilter { "out-of-memory", - "validation", + "validation" }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUOutOfMemoryError { constructor(); }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[Exposed=(Window, DedicatedWorker)] interface GPUValidationError { constructor(DOMString message); readonly attribute DOMString message; @@ -1050,7 +1000,9 @@ partial interface GPUDevice { Promise<GPUError?> popErrorScope(); }; -[Exposed=(Window, DedicatedWorker), SecureContext] +[ + Exposed=(Window, DedicatedWorker) +] interface GPUUncapturedErrorEvent : Event { constructor( DOMString type, @@ -1108,4 +1060,3 @@ dictionary GPUExtent3DDict { GPUIntegerCoordinate depthOrArrayLayers = 1; }; typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D; - |