@webgpu/types
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -1,4 +0,5 @@ | ||
// https://github.com/gpuweb/gpuweb/blob/402b69138fbedf4a3c9c85cd1bf7e1cc27c1b34e/spec/index.bs | ||
// https://github.com/gpuweb/gpuweb/blob/0a48816412b5d08a5fb8b89005e019165a1a2c63/spec/index.bs | ||
// except #280 which removed setSubData | ||
// except #494 which reverted the addition of GPUAdapter.limits | ||
// except #591 which removed Uint32Array from GPUShaderModuleDescriptor | ||
@@ -47,3 +48,3 @@ export {}; | ||
export type GPUExtensionName = | ||
| "anisotropic-filtering"; | ||
| "texture-compression-bc"; | ||
export type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat"; | ||
@@ -55,4 +56,6 @@ export type GPUBindingType = | ||
| "sampler" | ||
| "comparison-sampler" | ||
| "sampled-texture" | ||
| "storage-texture"; | ||
| "readonly-storage-texture" | ||
| "writeonly-storage-texture"; | ||
export type GPUBlendFactor = | ||
@@ -229,3 +232,3 @@ | "zero" | ||
export interface GPUBindGroupBinding { | ||
export interface GPUBindGroupEntry { | ||
binding: number; | ||
@@ -237,13 +240,14 @@ resource: GPUBindingResource; | ||
layout: GPUBindGroupLayout; | ||
bindings: GPUBindGroupBinding[]; | ||
entries: Iterable<GPUBindGroupEntry>; | ||
} | ||
export interface GPUBindGroupLayoutBinding { | ||
export interface GPUBindGroupLayoutEntry { | ||
binding: number; | ||
visibility: GPUShaderStageFlags; | ||
type: GPUBindingType; | ||
textureDimension?: GPUTextureViewDimension; | ||
viewDimension?: GPUTextureViewDimension; | ||
textureComponentType?: GPUTextureComponentType; | ||
multisampled?: boolean; | ||
hasDynamicOffset?: boolean; | ||
storageTextureFormat?: GPUTextureFormat; | ||
} | ||
@@ -253,3 +257,3 @@ | ||
extends GPUObjectDescriptorBase { | ||
bindings?: GPUBindGroupLayoutBinding[]; | ||
entries: Iterable<GPUBindGroupLayoutEntry>; | ||
} | ||
@@ -280,4 +284,4 @@ | ||
offset?: number; | ||
rowPitch: number; | ||
imageHeight: number; | ||
bytesPerRow: number; | ||
rowsPerImage?: number; | ||
} | ||
@@ -325,3 +329,3 @@ | ||
export interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { | ||
extensions?: GPUExtensionName[]; | ||
extensions?: Iterable<GPUExtensionName>; | ||
limits?: GPULimits; | ||
@@ -345,3 +349,3 @@ } | ||
stepMode?: GPUInputStepMode; | ||
attributes: GPUVertexAttributeDescriptor[]; | ||
attributes: Iterable<GPUVertexAttributeDescriptor>; | ||
} | ||
@@ -351,3 +355,3 @@ | ||
indexFormat?: GPUIndexFormat; | ||
vertexBuffers?: GPUVertexBufferLayoutDescriptor[]; | ||
vertexBuffers?: Iterable<GPUVertexBufferLayoutDescriptor>; | ||
} | ||
@@ -366,3 +370,3 @@ | ||
export interface GPULimitsOut { | ||
export interface GPULimitsOut extends GPULimits { | ||
maxBindGroups: number; | ||
@@ -384,3 +388,3 @@ maxDynamicUniformBuffersPerPipelineLayout: number; | ||
export interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { | ||
bindGroupLayouts: GPUBindGroupLayout[]; | ||
bindGroupLayouts: Iterable<GPUBindGroupLayout>; | ||
} | ||
@@ -420,3 +424,3 @@ | ||
export interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { | ||
colorAttachments: GPURenderPassColorAttachmentDescriptor[]; | ||
colorAttachments: Iterable<GPURenderPassColorAttachmentDescriptor>; | ||
depthStencilAttachment?: GPURenderPassDepthStencilAttachmentDescriptor; | ||
@@ -432,3 +436,3 @@ } | ||
rasterizationState?: GPURasterizationStateDescriptor; | ||
colorStates: GPUColorStateDescriptor[]; | ||
colorStates: Iterable<GPUColorStateDescriptor>; | ||
depthStencilState?: GPUDepthStencilStateDescriptor; | ||
@@ -475,3 +479,2 @@ vertexState?: GPUVertexStateDescriptor; | ||
size: GPUExtent3D; | ||
arrayLayerCount?: number; | ||
mipLevelCount?: number; | ||
@@ -495,2 +498,4 @@ sampleCount?: number; | ||
export class GPUAdapter { | ||
// https://michalzalecki.com/nominal-typing-in-typescript/#approach-1-class-with-a-private-property | ||
private __brand: void; | ||
readonly name: string; | ||
@@ -504,2 +509,3 @@ readonly extensions: GPUExtensionName[]; | ||
export class GPUBindGroup implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -509,2 +515,3 @@ } | ||
export class GPUBindGroupLayout implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -514,2 +521,3 @@ } | ||
export class GPUBuffer implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -533,2 +541,3 @@ | ||
export class GPUCommandBuffer implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -540,2 +549,3 @@ } | ||
export class GPUCommandEncoder implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -579,2 +589,3 @@ | ||
export class GPUComputePassEncoder implements GPUProgrammablePassEncoder { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -585,3 +596,3 @@ | ||
bindGroup: GPUBindGroup, | ||
dynamicOffsets?: number[] | ||
dynamicOffsets?: Iterable<number> | ||
): void; | ||
@@ -601,2 +612,3 @@ | ||
export class GPUComputePipeline implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -615,2 +627,3 @@ } | ||
export class GPUCanvasContext { | ||
private __brand: void; | ||
configureSwapChain(descriptor: GPUSwapChainDescriptor): GPUSwapChain; | ||
@@ -622,2 +635,3 @@ | ||
export class GPUDevice extends EventTarget implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -666,2 +680,3 @@ | ||
export class GPUFence implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -674,2 +689,3 @@ | ||
export class GPUPipelineLayout implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -682,3 +698,3 @@ } | ||
bindGroup: GPUBindGroup, | ||
dynamicOffsets?: number[] | ||
dynamicOffsets?: Iterable<number> | ||
): void; | ||
@@ -692,6 +708,7 @@ | ||
export class GPUQueue implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
signal(fence: GPUFence, signalValue: number): void; | ||
submit(commandBuffers: GPUCommandBuffer[]): void; | ||
submit(commandBuffers: Iterable<GPUCommandBuffer>): void; | ||
createFence(descriptor?: GPUFenceDescriptor): GPUFence; | ||
@@ -708,4 +725,4 @@ copyImageBitmapToTexture( | ||
setIndexBuffer(buffer: GPUBuffer, offset?: number): void; | ||
setVertexBuffer(slot: number, buffer: GPUBuffer, offset?: number): void; | ||
setIndexBuffer(buffer: GPUBuffer, offset?: number, size?: number): void; | ||
setVertexBuffer(slot: number, buffer: GPUBuffer, offset?: number, size?: number): void; | ||
@@ -734,2 +751,3 @@ draw( | ||
export class GPURenderPassEncoder implements GPURenderEncoderBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -740,3 +758,3 @@ | ||
bindGroup: GPUBindGroup, | ||
dynamicOffsets?: number[] | ||
dynamicOffsets?: Iterable<number> | ||
): void; | ||
@@ -786,3 +804,3 @@ | ||
executeBundles(bundles: GPURenderBundle[]): void; | ||
executeBundles(bundles: Iterable<GPURenderBundle>): void; | ||
endPass(): void; | ||
@@ -794,2 +812,3 @@ } | ||
export class GPURenderBundle implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -799,2 +818,3 @@ } | ||
export class GPURenderBundleEncoder implements GPURenderEncoderBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -805,3 +825,3 @@ | ||
bindGroup: GPUBindGroup, | ||
dynamicOffsets?: number[] | ||
dynamicOffsets?: Iterable<number> | ||
): void; | ||
@@ -843,3 +863,3 @@ | ||
extends GPUObjectDescriptorBase { | ||
colorFormats: GPUTextureFormat[]; | ||
colorFormats: Iterable<GPUTextureFormat>; | ||
depthStencilFormat?: GPUTextureFormat; | ||
@@ -850,2 +870,3 @@ sampleCount?: number; | ||
export class GPURenderPipeline implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -855,2 +876,3 @@ } | ||
export class GPUSampler implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -860,2 +882,3 @@ } | ||
export class GPUShaderModule implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -865,2 +888,3 @@ } | ||
export class GPUSwapChain implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -872,2 +896,3 @@ | ||
export class GPUTexture implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -880,2 +905,3 @@ | ||
export class GPUTextureView implements GPUObjectBase { | ||
private __brand: void; | ||
label: string | undefined; | ||
@@ -890,2 +916,3 @@ } | ||
export class GPU { | ||
private __brand: void; | ||
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter>; | ||
@@ -901,2 +928,3 @@ } | ||
export class GPUOutOfMemoryError { | ||
private __brand: void; | ||
constructor(); | ||
@@ -906,2 +934,3 @@ } | ||
export class GPUValidationError { | ||
private __brand: void; | ||
constructor(message: string); | ||
@@ -918,2 +947,3 @@ readonly message: string; | ||
export class GPUUncapturedErrorEvent extends Event { | ||
private __brand: void; | ||
constructor( | ||
@@ -931,4 +961,5 @@ type: string, | ||
export class GPUDeviceLostInfo { | ||
private __brand: void; | ||
readonly message: string; | ||
} | ||
} |
{ | ||
"name": "@webgpu/types", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"main": "", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -1,2 +0,2 @@ | ||
// https://github.com/gpuweb/gpuweb/blob/402b69138fbedf4a3c9c85cd1bf7e1cc27c1b34e/spec/index.bs | ||
// https://github.com/gpuweb/gpuweb/blob/0a48816412b5d08a5fb8b89005e019165a1a2c63/spec/index.bs | ||
@@ -7,3 +7,3 @@ // tslint:disable:variable-name | ||
export const enum ExtensionName { | ||
AnisotropicFiltering = 'anisotropic-filtering', | ||
TextureCompressionBC = 'texture-compression-bc', | ||
} | ||
@@ -20,4 +20,6 @@ export const enum AddressMode { | ||
Sampler = 'sampler', | ||
ComparisonSampler = 'comparison-sampler', | ||
SampledTexture = 'sampled-texture', | ||
StorageTexture = 'storage-texture', | ||
ReadonlyStorageTexture = 'readonly-storage-texture', | ||
WriteonlyStorageTexture = 'writeonly-storage-texture', | ||
} | ||
@@ -24,0 +26,0 @@ export const enum BlendFactor { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46460
1471