diff options
author | Dante Issaias <dante@issaias.com> | 2022-07-20 01:22:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 02:22:26 +0200 |
commit | 2b1f145c3e51cf9885c073b78bd5882e80d258e3 (patch) | |
tree | face88f9a6d6d109ebf8f659a59bc74e6f6ae8ee /cli/dts/lib.deno_webgpu.d.ts | |
parent | 649536e2669eb496fc2d4dacd92fd1d6dbed50a7 (diff) |
chore(ext): update webgpu (#15059)
Diffstat (limited to 'cli/dts/lib.deno_webgpu.d.ts')
-rw-r--r-- | cli/dts/lib.deno_webgpu.d.ts | 128 |
1 files changed, 71 insertions, 57 deletions
diff --git a/cli/dts/lib.deno_webgpu.d.ts b/cli/dts/lib.deno_webgpu.d.ts index 616df6bca..8d1c9919f 100644 --- a/cli/dts/lib.deno_webgpu.d.ts +++ b/cli/dts/lib.deno_webgpu.d.ts @@ -5,10 +5,8 @@ /// <reference no-default-lib="true" /> /// <reference lib="esnext" /> -// 8cc98b6f10b7f354473a08c3773bb1de839845b9 - interface GPUObjectBase { - label: string | null; + label: string; } declare interface GPUObjectDescriptorBase { @@ -64,6 +62,13 @@ declare class GPUSupportedFeatures { values(): IterableIterator<GPUFeatureName>; } +declare class GPUAdapterInfo { + readonly vendor: string; + readonly architecture: string; + readonly device: string; + readonly description: string; +} + declare class GPU { requestAdapter( options?: GPURequestAdapterOptions, @@ -78,12 +83,12 @@ declare interface GPURequestAdapterOptions { declare type GPUPowerPreference = "low-power" | "high-performance"; declare class GPUAdapter { - readonly name: string; readonly features: GPUSupportedFeatures; readonly limits: GPUSupportedLimits; readonly isFallbackAdapter: boolean; requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>; + requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>; } declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { @@ -101,6 +106,7 @@ declare type GPUFeatureName = | "texture-compression-astc" | "timestamp-query" | "indirect-first-instance" + | "shader-f16" // extended from spec | "mappable-primary-buffers" | "sampled-texture-binding-array" @@ -116,7 +122,7 @@ declare type GPUFeatureName = | "vertex-attribute-64bit"; declare class GPUDevice extends EventTarget implements GPUObjectBase { - label: string | null; + label: string; readonly lost: Promise<GPUDeviceLostInfo>; pushErrorScope(filter: GPUErrorFilter): undefined; @@ -168,7 +174,7 @@ declare class GPUDevice extends EventTarget implements GPUObjectBase { } declare class GPUBuffer implements GPUObjectBase { - label: string | null; + label: string; mapAsync( mode: GPUMapModeFlags, @@ -208,7 +214,7 @@ declare class GPUMapMode { } declare class GPUTexture implements GPUObjectBase { - label: string | null; + label: string; createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView; destroy(): undefined; @@ -235,7 +241,7 @@ declare class GPUTextureUsage { } declare class GPUTextureView implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { @@ -300,6 +306,8 @@ declare type GPUTextureFormat = | "depth24plus" | "depth24plus-stencil8" | "depth32float" + | "depth24unorm-stencil8" + | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" @@ -351,12 +359,10 @@ declare type GPUTextureFormat = | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" - | "astc-12x12-unorm-srgb" - | "depth24unorm-stencil8" - | "depth32float-stencil8"; + | "astc-12x12-unorm-srgb"; declare class GPUSampler implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { @@ -365,7 +371,7 @@ declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { addressModeW?: GPUAddressMode; magFilter?: GPUFilterMode; minFilter?: GPUFilterMode; - mipmapFilter?: GPUFilterMode; + mipmapFilter?: GPUMipmapFilterMode; lodMinClamp?: number; lodMaxClamp?: number; compare?: GPUCompareFunction; @@ -376,6 +382,8 @@ declare type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat"; declare type GPUFilterMode = "nearest" | "linear"; +declare type GPUMipmapFilterMode = "nearest" | "linear"; + declare type GPUCompareFunction = | "never" | "less" @@ -387,7 +395,7 @@ declare type GPUCompareFunction = | "always"; declare class GPUBindGroupLayout implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { @@ -450,7 +458,7 @@ declare interface GPUStorageTextureBindingLayout { } declare class GPUBindGroup implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { @@ -475,7 +483,7 @@ declare interface GPUBufferBinding { } declare class GPUPipelineLayout implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { @@ -496,7 +504,7 @@ declare interface GPUCompilationInfo { } declare class GPUShaderModule implements GPUObjectBase { - label: string | null; + label: string; compilationInfo(): Promise<GPUCompilationInfo>; } @@ -506,8 +514,10 @@ declare interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { sourceMap?: any; } +declare type GPUAutoLayoutMode = "auto"; + declare interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { - layout?: GPUPipelineLayout; + layout: GPUPipelineLayout | GPUAutoLayoutMode; } declare interface GPUPipelineBase { @@ -520,7 +530,7 @@ declare interface GPUProgrammableStage { } declare class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase { - label: string | null; + label: string; getBindGroupLayout(index: number): GPUBindGroupLayout; } @@ -531,7 +541,7 @@ declare interface GPUComputePipelineDescriptor } declare class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase { - label: string | null; + label: string; getBindGroupLayout(index: number): GPUBindGroupLayout; } @@ -545,13 +555,6 @@ declare interface GPURenderPipelineDescriptor fragment?: GPUFragmentState; } -declare type GPUPrimitiveTopology = - | "point-list" - | "line-list" - | "line-strip" - | "triangle-list" - | "triangle-strip"; - declare interface GPUPrimitiveState { topology?: GPUPrimitiveTopology; stripIndexFormat?: GPUIndexFormat; @@ -560,6 +563,13 @@ declare interface GPUPrimitiveState { unclippedDepth?: boolean; } +declare type GPUPrimitiveTopology = + | "point-list" + | "line-list" + | "line-strip" + | "triangle-list" + | "triangle-strip"; + declare type GPUFrontFace = "ccw" | "cw"; declare type GPUCullMode = "none" | "front" | "back"; @@ -571,7 +581,7 @@ declare interface GPUMultisampleState { } declare interface GPUFragmentState extends GPUProgrammableStage { - targets: GPUColorTargetState[]; + targets: (GPUColorTargetState | null)[]; } declare interface GPUColorTargetState { @@ -710,13 +720,13 @@ declare interface GPUVertexAttribute { } declare class GPUCommandBuffer implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {} declare class GPUCommandEncoder implements GPUObjectBase { - label: string | null; + label: string; beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder; beginComputePass( @@ -751,8 +761,8 @@ declare class GPUCommandEncoder implements GPUObjectBase { clearBuffer( destination: GPUBuffer, - destinationOffset: number, - size: number, + destinationOffset?: number, + size?: number, ): undefined; pushDebugGroup(groupLabel: string): undefined; @@ -813,7 +823,7 @@ interface GPUProgrammablePassEncoder { declare class GPUComputePassEncoder implements GPUObjectBase, GPUProgrammablePassEncoder { - label: string | null; + label: string; setBindGroup( index: number, bindGroup: GPUBindGroup, @@ -830,8 +840,8 @@ declare class GPUComputePassEncoder popDebugGroup(): undefined; insertDebugMarker(markerLabel: string): undefined; setPipeline(pipeline: GPUComputePipeline): undefined; - dispatch(x: number, y?: number, z?: number): undefined; - dispatchIndirect( + dispatchWorkgroups(x: number, y?: number, z?: number): undefined; + dispatchWorkgroupsIndirect( indirectBuffer: GPUBuffer, indirectOffset: number, ): undefined; @@ -844,7 +854,7 @@ declare class GPUComputePassEncoder writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined; - endPass(): undefined; + end(): undefined; } declare interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {} @@ -888,7 +898,7 @@ interface GPURenderEncoderBase { declare class GPURenderPassEncoder implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase { - label: string | null; + label: string; setBindGroup( index: number, bindGroup: GPUBindGroup, @@ -967,11 +977,11 @@ declare class GPURenderPassEncoder writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined; executeBundles(bundles: GPURenderBundle[]): undefined; - endPass(): undefined; + end(): undefined; } declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { - colorAttachments: GPURenderPassColorAttachment[]; + colorAttachments: (GPURenderPassColorAttachment | null)[]; depthStencilAttachment?: GPURenderPassDepthStencilAttachment; occlusionQuerySet?: GPUQuerySet; } @@ -980,35 +990,38 @@ declare interface GPURenderPassColorAttachment { view: GPUTextureView; resolveTarget?: GPUTextureView; - loadValue: GPULoadOp | GPUColor; - storeOp?: GPUStoreOp; + clearValue?: GPUColor; + loadOp: GPULoadOp; + storeOp: GPUStoreOp; } declare interface GPURenderPassDepthStencilAttachment { view: GPUTextureView; - depthLoadValue: GPULoadOp | number; - depthStoreOp: GPUStoreOp; + depthClearValue?: number; + depthLoadOp?: GPULoadOp; + depthStoreOp?: GPUStoreOp; depthReadOnly?: boolean; - stencilLoadValue: GPULoadOp | number; - stencilStoreOp: GPUStoreOp; + stencilClearValue?: number; + stencilLoadOp?: GPULoadOp; + stencilStoreOp?: GPUStoreOp; stencilReadOnly?: boolean; } -declare type GPULoadOp = "load"; +declare type GPULoadOp = "load" | "clear"; declare type GPUStoreOp = "store" | "discard"; declare class GPURenderBundle implements GPUObjectBase { - label: string | null; + label: string; } declare interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {} declare class GPURenderBundleEncoder implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase { - label: string | null; + label: string; draw( vertexCount: number, instanceCount?: number, @@ -1060,7 +1073,7 @@ declare class GPURenderBundleEncoder } declare interface GPURenderPassLayout extends GPUObjectDescriptorBase { - colorFormats: GPUTextureFormat[]; + colorFormats: (GPUTextureFormat | null)[]; depthStencilFormat?: GPUTextureFormat; sampleCount?: number; } @@ -1071,7 +1084,7 @@ declare interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { } declare class GPUQueue implements GPUObjectBase { - label: string | null; + label: string; submit(commandBuffers: GPUCommandBuffer[]): undefined; @@ -1094,7 +1107,7 @@ declare class GPUQueue implements GPUObjectBase { } declare class GPUQuerySet implements GPUObjectBase { - label: string | null; + label: string; destroy(): undefined; } @@ -1121,19 +1134,20 @@ declare interface GPUDeviceLostInfo { readonly message: string; } +declare class GPUError { + readonly message: string; +} + declare type GPUErrorFilter = "out-of-memory" | "validation"; -declare class GPUOutOfMemoryError { - constructor(); +declare class GPUOutOfMemoryError extends GPUError { + constructor(message: string); } -declare class GPUValidationError { +declare class GPUValidationError extends GPUError { constructor(message: string); - readonly message: string; } -declare type GPUError = GPUOutOfMemoryError | GPUValidationError; - declare class GPUUncapturedErrorEvent extends Event { constructor( type: string, |