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