2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-12-08 19:19:16 -05:00
|
|
|
|
|
|
|
// deno-lint-ignore-file no-explicit-any no-empty-interface
|
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-04-26 12:04:29 -04:00
|
|
|
declare interface GPUObjectBase {
|
2023-12-08 19:19:16 -05:00
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUObjectDescriptorBase {
|
|
|
|
label?: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUSupportedLimits {
|
|
|
|
maxTextureDimension1D?: number;
|
|
|
|
maxTextureDimension2D?: number;
|
|
|
|
maxTextureDimension3D?: number;
|
|
|
|
maxTextureArrayLayers?: number;
|
|
|
|
maxBindGroups?: number;
|
|
|
|
maxBindingsPerBindGroup?: number;
|
|
|
|
maxDynamicUniformBuffersPerPipelineLayout?: number;
|
|
|
|
maxDynamicStorageBuffersPerPipelineLayout?: number;
|
|
|
|
maxSampledTexturesPerShaderStage?: number;
|
|
|
|
maxSamplersPerShaderStage?: number;
|
|
|
|
maxStorageBuffersPerShaderStage?: number;
|
|
|
|
maxStorageTexturesPerShaderStage?: number;
|
|
|
|
maxUniformBuffersPerShaderStage?: number;
|
|
|
|
maxUniformBufferBindingSize?: number;
|
|
|
|
maxStorageBufferBindingSize?: number;
|
|
|
|
minUniformBufferOffsetAlignment?: number;
|
|
|
|
minStorageBufferOffsetAlignment?: number;
|
|
|
|
maxVertexBuffers?: number;
|
|
|
|
maxBufferSize?: number;
|
|
|
|
maxVertexAttributes?: number;
|
|
|
|
maxVertexBufferArrayStride?: number;
|
|
|
|
maxInterStageShaderComponents?: number;
|
2024-05-05 10:22:18 -04:00
|
|
|
maxColorAttachments?: number;
|
|
|
|
maxColorAttachmentBytesPerSample?: number;
|
2023-12-08 19:19:16 -05:00
|
|
|
maxComputeWorkgroupStorageSize?: number;
|
|
|
|
maxComputeInvocationsPerWorkgroup?: number;
|
|
|
|
maxComputeWorkgroupSizeX?: number;
|
|
|
|
maxComputeWorkgroupSizeY?: number;
|
|
|
|
maxComputeWorkgroupSizeZ?: number;
|
|
|
|
maxComputeWorkgroupsPerDimension?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUSupportedFeatures {
|
|
|
|
forEach(
|
|
|
|
callbackfn: (
|
|
|
|
value: GPUFeatureName,
|
|
|
|
value2: GPUFeatureName,
|
|
|
|
set: Set<GPUFeatureName>,
|
|
|
|
) => void,
|
|
|
|
thisArg?: any,
|
|
|
|
): void;
|
|
|
|
has(value: GPUFeatureName): boolean;
|
|
|
|
size: number;
|
|
|
|
[Symbol.iterator](): IterableIterator<GPUFeatureName>;
|
|
|
|
entries(): IterableIterator<[GPUFeatureName, GPUFeatureName]>;
|
|
|
|
keys(): IterableIterator<GPUFeatureName>;
|
|
|
|
values(): IterableIterator<GPUFeatureName>;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUAdapterInfo {
|
|
|
|
readonly vendor: string;
|
|
|
|
readonly architecture: string;
|
|
|
|
readonly device: string;
|
|
|
|
readonly description: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPU {
|
|
|
|
requestAdapter(
|
|
|
|
options?: GPURequestAdapterOptions,
|
|
|
|
): Promise<GPUAdapter | null>;
|
2024-01-27 12:40:09 -05:00
|
|
|
getPreferredCanvasFormat(): GPUTextureFormat;
|
2023-12-08 19:19:16 -05:00
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURequestAdapterOptions {
|
|
|
|
powerPreference?: GPUPowerPreference;
|
|
|
|
forceFallbackAdapter?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUPowerPreference = "low-power" | "high-performance";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUAdapter {
|
|
|
|
readonly features: GPUSupportedFeatures;
|
|
|
|
readonly limits: GPUSupportedLimits;
|
2024-08-06 06:00:32 -04:00
|
|
|
readonly info: GPUAdapterInfo;
|
2023-12-08 19:19:16 -05:00
|
|
|
readonly isFallbackAdapter: boolean;
|
|
|
|
|
|
|
|
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
requiredFeatures?: GPUFeatureName[];
|
|
|
|
requiredLimits?: Record<string, number>;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUFeatureName =
|
|
|
|
| "depth-clip-control"
|
|
|
|
| "depth32float-stencil8"
|
|
|
|
| "pipeline-statistics-query"
|
|
|
|
| "texture-compression-bc"
|
|
|
|
| "texture-compression-etc2"
|
|
|
|
| "texture-compression-astc"
|
|
|
|
| "timestamp-query"
|
|
|
|
| "indirect-first-instance"
|
|
|
|
| "shader-f16"
|
2024-05-05 10:22:18 -04:00
|
|
|
| "rg11b10ufloat-renderable"
|
|
|
|
| "bgra8unorm-storage"
|
|
|
|
| "float32-filterable"
|
2023-12-08 19:19:16 -05:00
|
|
|
// extended from spec
|
|
|
|
| "mappable-primary-buffers"
|
|
|
|
| "sampled-texture-binding-array"
|
|
|
|
| "sampled-texture-array-dynamic-indexing"
|
|
|
|
| "sampled-texture-array-non-uniform-indexing"
|
|
|
|
| "unsized-binding-array"
|
|
|
|
| "multi-draw-indirect"
|
|
|
|
| "multi-draw-indirect-count"
|
|
|
|
| "push-constants"
|
|
|
|
| "address-mode-clamp-to-border"
|
|
|
|
| "texture-adapter-specific-format-features"
|
|
|
|
| "shader-float64"
|
|
|
|
| "vertex-attribute-64bit";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUDevice extends EventTarget implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
readonly lost: Promise<GPUDeviceLostInfo>;
|
|
|
|
pushErrorScope(filter: GPUErrorFilter): undefined;
|
|
|
|
popErrorScope(): Promise<GPUError | null>;
|
|
|
|
|
|
|
|
readonly features: GPUSupportedFeatures;
|
|
|
|
readonly limits: GPUSupportedLimits;
|
|
|
|
readonly queue: GPUQueue;
|
|
|
|
|
|
|
|
destroy(): undefined;
|
|
|
|
|
|
|
|
createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer;
|
|
|
|
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
|
|
|
|
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
|
|
|
|
|
|
|
|
createBindGroupLayout(
|
|
|
|
descriptor: GPUBindGroupLayoutDescriptor,
|
|
|
|
): GPUBindGroupLayout;
|
|
|
|
createPipelineLayout(
|
|
|
|
descriptor: GPUPipelineLayoutDescriptor,
|
|
|
|
): GPUPipelineLayout;
|
|
|
|
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
|
|
|
|
|
|
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
|
|
createComputePipeline(
|
|
|
|
descriptor: GPUComputePipelineDescriptor,
|
|
|
|
): GPUComputePipeline;
|
|
|
|
createRenderPipeline(
|
|
|
|
descriptor: GPURenderPipelineDescriptor,
|
|
|
|
): GPURenderPipeline;
|
|
|
|
createComputePipelineAsync(
|
|
|
|
descriptor: GPUComputePipelineDescriptor,
|
|
|
|
): Promise<GPUComputePipeline>;
|
|
|
|
createRenderPipelineAsync(
|
|
|
|
descriptor: GPURenderPipelineDescriptor,
|
|
|
|
): Promise<GPURenderPipeline>;
|
|
|
|
|
|
|
|
createCommandEncoder(
|
|
|
|
descriptor?: GPUCommandEncoderDescriptor,
|
|
|
|
): GPUCommandEncoder;
|
|
|
|
createRenderBundleEncoder(
|
|
|
|
descriptor: GPURenderBundleEncoderDescriptor,
|
|
|
|
): GPURenderBundleEncoder;
|
|
|
|
|
|
|
|
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUBuffer implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
readonly size: number;
|
|
|
|
readonly usage: GPUFlagsConstant;
|
|
|
|
readonly mapState: GPUBufferMapState;
|
|
|
|
|
|
|
|
mapAsync(
|
|
|
|
mode: GPUMapModeFlags,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): Promise<undefined>;
|
|
|
|
getMappedRange(offset?: number, size?: number): ArrayBuffer;
|
|
|
|
unmap(): undefined;
|
|
|
|
|
|
|
|
destroy(): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBufferMapState = "unmapped" | "pending" | "mapped";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
size: number;
|
|
|
|
usage: GPUBufferUsageFlags;
|
|
|
|
mappedAtCreation?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBufferUsageFlags = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUFlagsConstant = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUBufferUsage {
|
|
|
|
static MAP_READ: 0x0001;
|
|
|
|
static MAP_WRITE: 0x0002;
|
|
|
|
static COPY_SRC: 0x0004;
|
|
|
|
static COPY_DST: 0x0008;
|
|
|
|
static INDEX: 0x0010;
|
|
|
|
static VERTEX: 0x0020;
|
|
|
|
static UNIFORM: 0x0040;
|
|
|
|
static STORAGE: 0x0080;
|
|
|
|
static INDIRECT: 0x0100;
|
|
|
|
static QUERY_RESOLVE: 0x0200;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUMapModeFlags = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUMapMode {
|
|
|
|
static READ: 0x0001;
|
|
|
|
static WRITE: 0x0002;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUTexture implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
|
|
destroy(): undefined;
|
|
|
|
|
|
|
|
readonly width: number;
|
|
|
|
readonly height: number;
|
|
|
|
readonly depthOrArrayLayers: number;
|
|
|
|
readonly mipLevelCount: number;
|
|
|
|
readonly sampleCount: number;
|
|
|
|
readonly dimension: GPUTextureDimension;
|
|
|
|
readonly format: GPUTextureFormat;
|
|
|
|
readonly usage: GPUFlagsConstant;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
size: GPUExtent3D;
|
|
|
|
mipLevelCount?: number;
|
|
|
|
sampleCount?: number;
|
|
|
|
dimension?: GPUTextureDimension;
|
|
|
|
format: GPUTextureFormat;
|
|
|
|
usage: GPUTextureUsageFlags;
|
|
|
|
viewFormats?: GPUTextureFormat[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureUsageFlags = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUTextureUsage {
|
|
|
|
static COPY_SRC: 0x01;
|
|
|
|
static COPY_DST: 0x02;
|
|
|
|
static TEXTURE_BINDING: 0x04;
|
|
|
|
static STORAGE_BINDING: 0x08;
|
|
|
|
static RENDER_ATTACHMENT: 0x10;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUTextureView implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
format?: GPUTextureFormat;
|
|
|
|
dimension?: GPUTextureViewDimension;
|
|
|
|
aspect?: GPUTextureAspect;
|
|
|
|
baseMipLevel?: number;
|
|
|
|
mipLevelCount?: number;
|
|
|
|
baseArrayLayer?: number;
|
|
|
|
arrayLayerCount?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureViewDimension =
|
|
|
|
| "1d"
|
|
|
|
| "2d"
|
|
|
|
| "2d-array"
|
|
|
|
| "cube"
|
|
|
|
| "cube-array"
|
|
|
|
| "3d";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureAspect = "all" | "stencil-only" | "depth-only";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureFormat =
|
|
|
|
| "r8unorm"
|
|
|
|
| "r8snorm"
|
|
|
|
| "r8uint"
|
|
|
|
| "r8sint"
|
|
|
|
| "r16uint"
|
|
|
|
| "r16sint"
|
|
|
|
| "r16float"
|
|
|
|
| "rg8unorm"
|
|
|
|
| "rg8snorm"
|
|
|
|
| "rg8uint"
|
|
|
|
| "rg8sint"
|
|
|
|
| "r32uint"
|
|
|
|
| "r32sint"
|
|
|
|
| "r32float"
|
|
|
|
| "rg16uint"
|
|
|
|
| "rg16sint"
|
|
|
|
| "rg16float"
|
|
|
|
| "rgba8unorm"
|
|
|
|
| "rgba8unorm-srgb"
|
|
|
|
| "rgba8snorm"
|
|
|
|
| "rgba8uint"
|
|
|
|
| "rgba8sint"
|
|
|
|
| "bgra8unorm"
|
|
|
|
| "bgra8unorm-srgb"
|
|
|
|
| "rgb9e5ufloat"
|
2024-05-05 10:22:18 -04:00
|
|
|
| "rgb10a2uint"
|
2023-12-08 19:19:16 -05:00
|
|
|
| "rgb10a2unorm"
|
|
|
|
| "rg11b10ufloat"
|
|
|
|
| "rg32uint"
|
|
|
|
| "rg32sint"
|
|
|
|
| "rg32float"
|
|
|
|
| "rgba16uint"
|
|
|
|
| "rgba16sint"
|
|
|
|
| "rgba16float"
|
|
|
|
| "rgba32uint"
|
|
|
|
| "rgba32sint"
|
|
|
|
| "rgba32float"
|
|
|
|
| "stencil8"
|
|
|
|
| "depth16unorm"
|
|
|
|
| "depth24plus"
|
|
|
|
| "depth24plus-stencil8"
|
|
|
|
| "depth32float"
|
|
|
|
| "depth32float-stencil8"
|
|
|
|
| "bc1-rgba-unorm"
|
|
|
|
| "bc1-rgba-unorm-srgb"
|
|
|
|
| "bc2-rgba-unorm"
|
|
|
|
| "bc2-rgba-unorm-srgb"
|
|
|
|
| "bc3-rgba-unorm"
|
|
|
|
| "bc3-rgba-unorm-srgb"
|
|
|
|
| "bc4-r-unorm"
|
|
|
|
| "bc4-r-snorm"
|
|
|
|
| "bc5-rg-unorm"
|
|
|
|
| "bc5-rg-snorm"
|
|
|
|
| "bc6h-rgb-ufloat"
|
|
|
|
| "bc6h-rgb-float"
|
|
|
|
| "bc7-rgba-unorm"
|
|
|
|
| "bc7-rgba-unorm-srgb"
|
|
|
|
| "etc2-rgb8unorm"
|
|
|
|
| "etc2-rgb8unorm-srgb"
|
|
|
|
| "etc2-rgb8a1unorm"
|
|
|
|
| "etc2-rgb8a1unorm-srgb"
|
|
|
|
| "etc2-rgba8unorm"
|
|
|
|
| "etc2-rgba8unorm-srgb"
|
|
|
|
| "eac-r11unorm"
|
|
|
|
| "eac-r11snorm"
|
|
|
|
| "eac-rg11unorm"
|
|
|
|
| "eac-rg11snorm"
|
|
|
|
| "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";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUSampler implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
addressModeU?: GPUAddressMode;
|
|
|
|
addressModeV?: GPUAddressMode;
|
|
|
|
addressModeW?: GPUAddressMode;
|
|
|
|
magFilter?: GPUFilterMode;
|
|
|
|
minFilter?: GPUFilterMode;
|
|
|
|
mipmapFilter?: GPUMipmapFilterMode;
|
|
|
|
lodMinClamp?: number;
|
|
|
|
lodMaxClamp?: number;
|
|
|
|
compare?: GPUCompareFunction;
|
|
|
|
maxAnisotropy?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUFilterMode = "nearest" | "linear";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUMipmapFilterMode = "nearest" | "linear";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUCompareFunction =
|
|
|
|
| "never"
|
|
|
|
| "less"
|
|
|
|
| "equal"
|
|
|
|
| "less-equal"
|
|
|
|
| "greater"
|
|
|
|
| "not-equal"
|
|
|
|
| "greater-equal"
|
|
|
|
| "always";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUBindGroupLayout implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
entries: GPUBindGroupLayoutEntry[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBindGroupLayoutEntry {
|
|
|
|
binding: number;
|
|
|
|
visibility: GPUShaderStageFlags;
|
|
|
|
|
|
|
|
buffer?: GPUBufferBindingLayout;
|
|
|
|
sampler?: GPUSamplerBindingLayout;
|
|
|
|
texture?: GPUTextureBindingLayout;
|
|
|
|
storageTexture?: GPUStorageTextureBindingLayout;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUShaderStageFlags = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUShaderStage {
|
|
|
|
static VERTEX: 0x1;
|
|
|
|
static FRAGMENT: 0x2;
|
|
|
|
static COMPUTE: 0x4;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBufferBindingLayout {
|
|
|
|
type?: GPUBufferBindingType;
|
|
|
|
hasDynamicOffset?: boolean;
|
|
|
|
minBindingSize?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUSamplerBindingLayout {
|
|
|
|
type?: GPUSamplerBindingType;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUSamplerBindingType =
|
|
|
|
| "filtering"
|
|
|
|
| "non-filtering"
|
|
|
|
| "comparison";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUTextureBindingLayout {
|
|
|
|
sampleType?: GPUTextureSampleType;
|
|
|
|
viewDimension?: GPUTextureViewDimension;
|
|
|
|
multisampled?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUTextureSampleType =
|
|
|
|
| "float"
|
|
|
|
| "unfilterable-float"
|
|
|
|
| "depth"
|
|
|
|
| "sint"
|
|
|
|
| "uint";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare type GPUStorageTextureAccess =
|
|
|
|
| "write-only"
|
|
|
|
| "read-only"
|
|
|
|
| "read-write";
|
2023-12-08 19:19:16 -05:00
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUStorageTextureBindingLayout {
|
|
|
|
access: GPUStorageTextureAccess;
|
|
|
|
format: GPUTextureFormat;
|
|
|
|
viewDimension?: GPUTextureViewDimension;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUBindGroup implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
layout: GPUBindGroupLayout;
|
|
|
|
entries: GPUBindGroupEntry[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBindingResource =
|
|
|
|
| GPUSampler
|
|
|
|
| GPUTextureView
|
|
|
|
| GPUBufferBinding;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBindGroupEntry {
|
|
|
|
binding: number;
|
|
|
|
resource: GPUBindingResource;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBufferBinding {
|
|
|
|
buffer: GPUBuffer;
|
|
|
|
offset?: number;
|
|
|
|
size?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUPipelineLayout implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
bindGroupLayouts: GPUBindGroupLayout[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUCompilationMessageType = "error" | "warning" | "info";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUCompilationMessage {
|
|
|
|
readonly message: string;
|
|
|
|
readonly type: GPUCompilationMessageType;
|
|
|
|
readonly lineNum: number;
|
|
|
|
readonly linePos: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUCompilationInfo {
|
|
|
|
readonly messages: ReadonlyArray<GPUCompilationMessage>;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare class GPUPipelineError extends DOMException {
|
|
|
|
constructor(message?: string, options?: GPUPipelineErrorInit);
|
|
|
|
|
|
|
|
readonly reason: GPUPipelineErrorReason;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare interface GPUPipelineErrorInit {
|
|
|
|
reason: GPUPipelineErrorReason;
|
|
|
|
}
|
|
|
|
|
2024-09-11 20:59:05 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare type GPUPipelineErrorReason = "validation" | "internal";
|
|
|
|
|
2024-09-11 20:59:05 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUShaderModule implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
code: string;
|
|
|
|
sourceMap?: any;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUAutoLayoutMode = "auto";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
|
|
|
|
layout: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUPipelineBase {
|
|
|
|
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUProgrammableStage {
|
|
|
|
module: GPUShaderModule;
|
2024-05-05 10:22:18 -04:00
|
|
|
entryPoint?: string;
|
|
|
|
constants?: Record<string, number>;
|
2023-12-08 19:19:16 -05:00
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUComputePipelineDescriptor
|
|
|
|
extends GPUPipelineDescriptorBase {
|
|
|
|
compute: GPUProgrammableStage;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPipelineDescriptor
|
|
|
|
extends GPUPipelineDescriptorBase {
|
|
|
|
vertex: GPUVertexState;
|
|
|
|
primitive?: GPUPrimitiveState;
|
|
|
|
depthStencil?: GPUDepthStencilState;
|
|
|
|
multisample?: GPUMultisampleState;
|
|
|
|
fragment?: GPUFragmentState;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUPrimitiveState {
|
|
|
|
topology?: GPUPrimitiveTopology;
|
|
|
|
stripIndexFormat?: GPUIndexFormat;
|
|
|
|
frontFace?: GPUFrontFace;
|
|
|
|
cullMode?: GPUCullMode;
|
|
|
|
unclippedDepth?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUPrimitiveTopology =
|
|
|
|
| "point-list"
|
|
|
|
| "line-list"
|
|
|
|
| "line-strip"
|
|
|
|
| "triangle-list"
|
|
|
|
| "triangle-strip";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUFrontFace = "ccw" | "cw";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUCullMode = "none" | "front" | "back";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUMultisampleState {
|
|
|
|
count?: number;
|
|
|
|
mask?: number;
|
|
|
|
alphaToCoverageEnabled?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUFragmentState extends GPUProgrammableStage {
|
|
|
|
targets: (GPUColorTargetState | null)[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUColorTargetState {
|
|
|
|
format: GPUTextureFormat;
|
|
|
|
|
|
|
|
blend?: GPUBlendState;
|
|
|
|
writeMask?: GPUColorWriteFlags;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBlendState {
|
|
|
|
color: GPUBlendComponent;
|
|
|
|
alpha: GPUBlendComponent;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUColorWriteFlags = number;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUColorWrite {
|
|
|
|
static RED: 0x1;
|
|
|
|
static GREEN: 0x2;
|
|
|
|
static BLUE: 0x4;
|
|
|
|
static ALPHA: 0x8;
|
|
|
|
static ALL: 0xF;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUBlendComponent {
|
|
|
|
operation?: GPUBlendOperation;
|
|
|
|
srcFactor?: GPUBlendFactor;
|
|
|
|
dstFactor?: GPUBlendFactor;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBlendFactor =
|
|
|
|
| "zero"
|
|
|
|
| "one"
|
|
|
|
| "src"
|
|
|
|
| "one-minus-src"
|
|
|
|
| "src-alpha"
|
|
|
|
| "one-minus-src-alpha"
|
|
|
|
| "dst"
|
|
|
|
| "one-minus-dst"
|
|
|
|
| "dst-alpha"
|
|
|
|
| "one-minus-dst-alpha"
|
|
|
|
| "src-alpha-saturated"
|
|
|
|
| "constant"
|
|
|
|
| "one-minus-constant";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUBlendOperation =
|
|
|
|
| "add"
|
|
|
|
| "subtract"
|
|
|
|
| "reverse-subtract"
|
|
|
|
| "min"
|
|
|
|
| "max";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUDepthStencilState {
|
|
|
|
format: GPUTextureFormat;
|
|
|
|
|
|
|
|
depthWriteEnabled: boolean;
|
|
|
|
depthCompare: GPUCompareFunction;
|
|
|
|
|
|
|
|
stencilFront?: GPUStencilFaceState;
|
|
|
|
stencilBack?: GPUStencilFaceState;
|
|
|
|
|
|
|
|
stencilReadMask?: number;
|
|
|
|
stencilWriteMask?: number;
|
|
|
|
|
|
|
|
depthBias?: number;
|
|
|
|
depthBiasSlopeScale?: number;
|
|
|
|
depthBiasClamp?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUStencilFaceState {
|
|
|
|
compare?: GPUCompareFunction;
|
|
|
|
failOp?: GPUStencilOperation;
|
|
|
|
depthFailOp?: GPUStencilOperation;
|
|
|
|
passOp?: GPUStencilOperation;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUStencilOperation =
|
|
|
|
| "keep"
|
|
|
|
| "zero"
|
|
|
|
| "replace"
|
|
|
|
| "invert"
|
|
|
|
| "increment-clamp"
|
|
|
|
| "decrement-clamp"
|
|
|
|
| "increment-wrap"
|
|
|
|
| "decrement-wrap";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUIndexFormat = "uint16" | "uint32";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUVertexFormat =
|
|
|
|
| "uint8x2"
|
|
|
|
| "uint8x4"
|
|
|
|
| "sint8x2"
|
|
|
|
| "sint8x4"
|
|
|
|
| "unorm8x2"
|
|
|
|
| "unorm8x4"
|
|
|
|
| "snorm8x2"
|
|
|
|
| "snorm8x4"
|
|
|
|
| "uint16x2"
|
|
|
|
| "uint16x4"
|
|
|
|
| "sint16x2"
|
|
|
|
| "sint16x4"
|
|
|
|
| "unorm16x2"
|
|
|
|
| "unorm16x4"
|
|
|
|
| "snorm16x2"
|
|
|
|
| "snorm16x4"
|
|
|
|
| "float16x2"
|
|
|
|
| "float16x4"
|
|
|
|
| "float32"
|
|
|
|
| "float32x2"
|
|
|
|
| "float32x3"
|
|
|
|
| "float32x4"
|
|
|
|
| "uint32"
|
|
|
|
| "uint32x2"
|
|
|
|
| "uint32x3"
|
|
|
|
| "uint32x4"
|
|
|
|
| "sint32"
|
|
|
|
| "sint32x2"
|
|
|
|
| "sint32x3"
|
2024-05-05 10:22:18 -04:00
|
|
|
| "sint32x4"
|
|
|
|
| "unorm10-10-10-2";
|
2023-12-08 19:19:16 -05:00
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUVertexStepMode = "vertex" | "instance";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUVertexState extends GPUProgrammableStage {
|
|
|
|
buffers?: (GPUVertexBufferLayout | null)[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUVertexBufferLayout {
|
|
|
|
arrayStride: number;
|
|
|
|
stepMode?: GPUVertexStepMode;
|
|
|
|
attributes: GPUVertexAttribute[];
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUVertexAttribute {
|
|
|
|
format: GPUVertexFormat;
|
|
|
|
offset: number;
|
|
|
|
|
|
|
|
shaderLocation: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUImageDataLayout {
|
|
|
|
offset?: number;
|
|
|
|
bytesPerRow?: number;
|
|
|
|
rowsPerImage?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUCommandBuffer implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUCommandEncoder implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
|
|
beginComputePass(
|
|
|
|
descriptor?: GPUComputePassDescriptor,
|
|
|
|
): GPUComputePassEncoder;
|
|
|
|
|
|
|
|
copyBufferToBuffer(
|
|
|
|
source: GPUBuffer,
|
|
|
|
sourceOffset: number,
|
|
|
|
destination: GPUBuffer,
|
|
|
|
destinationOffset: number,
|
|
|
|
size: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
copyBufferToTexture(
|
|
|
|
source: GPUImageCopyBuffer,
|
|
|
|
destination: GPUImageCopyTexture,
|
|
|
|
copySize: GPUExtent3D,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
copyTextureToBuffer(
|
|
|
|
source: GPUImageCopyTexture,
|
|
|
|
destination: GPUImageCopyBuffer,
|
|
|
|
copySize: GPUExtent3D,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
copyTextureToTexture(
|
|
|
|
source: GPUImageCopyTexture,
|
|
|
|
destination: GPUImageCopyTexture,
|
|
|
|
copySize: GPUExtent3D,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
clearBuffer(
|
|
|
|
destination: GPUBuffer,
|
|
|
|
destinationOffset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
pushDebugGroup(groupLabel: string): undefined;
|
|
|
|
popDebugGroup(): undefined;
|
|
|
|
insertDebugMarker(markerLabel: string): undefined;
|
|
|
|
|
|
|
|
writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined;
|
|
|
|
|
|
|
|
resolveQuerySet(
|
|
|
|
querySet: GPUQuerySet,
|
|
|
|
firstQuery: number,
|
|
|
|
queryCount: number,
|
|
|
|
destination: GPUBuffer,
|
|
|
|
destinationOffset: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUImageCopyBuffer extends GPUImageDataLayout {
|
|
|
|
buffer: GPUBuffer;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUImageCopyTexture {
|
|
|
|
texture: GPUTexture;
|
|
|
|
mipLevel?: number;
|
|
|
|
origin?: GPUOrigin3D;
|
|
|
|
aspect?: GPUTextureAspect;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-04-26 12:04:29 -04:00
|
|
|
declare interface GPUProgrammablePassEncoder {
|
2023-12-08 19:19:16 -05:00
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsets?: number[],
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsetsData: Uint32Array,
|
|
|
|
dynamicOffsetsDataStart: number,
|
|
|
|
dynamicOffsetsDataLength: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
pushDebugGroup(groupLabel: string): undefined;
|
|
|
|
popDebugGroup(): undefined;
|
|
|
|
insertDebugMarker(markerLabel: string): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUComputePassEncoder
|
|
|
|
implements GPUObjectBase, GPUProgrammablePassEncoder {
|
|
|
|
label: string;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsets?: number[],
|
|
|
|
): undefined;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsetsData: Uint32Array,
|
|
|
|
dynamicOffsetsDataStart: number,
|
|
|
|
dynamicOffsetsDataLength: number,
|
|
|
|
): undefined;
|
|
|
|
pushDebugGroup(groupLabel: string): undefined;
|
|
|
|
popDebugGroup(): undefined;
|
|
|
|
insertDebugMarker(markerLabel: string): undefined;
|
|
|
|
setPipeline(pipeline: GPUComputePipeline): undefined;
|
|
|
|
dispatchWorkgroups(x: number, y?: number, z?: number): undefined;
|
|
|
|
dispatchWorkgroupsIndirect(
|
|
|
|
indirectBuffer: GPUBuffer,
|
|
|
|
indirectOffset: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
end(): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUComputePassTimestampWrites {
|
|
|
|
querySet: GPUQuerySet;
|
|
|
|
beginningOfPassWriteIndex?: number;
|
|
|
|
endOfPassWriteIndex?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
timestampWrites?: GPUComputePassTimestampWrites;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-04-26 12:04:29 -04:00
|
|
|
declare interface GPURenderEncoderBase {
|
2023-12-08 19:19:16 -05:00
|
|
|
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
|
|
|
|
|
|
setIndexBuffer(
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
indexFormat: GPUIndexFormat,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
setVertexBuffer(
|
|
|
|
slot: number,
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
draw(
|
|
|
|
vertexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndexed(
|
|
|
|
indexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstIndex?: number,
|
|
|
|
baseVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined;
|
|
|
|
drawIndexedIndirect(
|
|
|
|
indirectBuffer: GPUBuffer,
|
|
|
|
indirectOffset: number,
|
|
|
|
): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPURenderPassEncoder
|
|
|
|
implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase {
|
|
|
|
label: string;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsets?: number[],
|
|
|
|
): undefined;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsetsData: Uint32Array,
|
|
|
|
dynamicOffsetsDataStart: number,
|
|
|
|
dynamicOffsetsDataLength: number,
|
|
|
|
): undefined;
|
|
|
|
pushDebugGroup(groupLabel: string): undefined;
|
|
|
|
popDebugGroup(): undefined;
|
|
|
|
insertDebugMarker(markerLabel: string): undefined;
|
|
|
|
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
|
|
setIndexBuffer(
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
indexFormat: GPUIndexFormat,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
setVertexBuffer(
|
|
|
|
slot: number,
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
draw(
|
|
|
|
vertexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndexed(
|
|
|
|
indexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstIndex?: number,
|
|
|
|
baseVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined;
|
|
|
|
drawIndexedIndirect(
|
|
|
|
indirectBuffer: GPUBuffer,
|
|
|
|
indirectOffset: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
setViewport(
|
|
|
|
x: number,
|
|
|
|
y: number,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
|
|
|
minDepth: number,
|
|
|
|
maxDepth: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
setScissorRect(
|
|
|
|
x: number,
|
|
|
|
y: number,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
setBlendConstant(color: GPUColor): undefined;
|
|
|
|
setStencilReference(reference: number): undefined;
|
|
|
|
|
|
|
|
beginOcclusionQuery(queryIndex: number): undefined;
|
|
|
|
endOcclusionQuery(): undefined;
|
|
|
|
|
|
|
|
executeBundles(bundles: GPURenderBundle[]): undefined;
|
|
|
|
end(): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPassTimestampWrites {
|
|
|
|
querySet: GPUQuerySet;
|
|
|
|
beginningOfPassWriteIndex?: number;
|
|
|
|
endOfPassWriteIndex?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
colorAttachments: (GPURenderPassColorAttachment | null)[];
|
|
|
|
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
|
|
occlusionQuerySet?: GPUQuerySet;
|
|
|
|
timestampWrites?: GPURenderPassTimestampWrites;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPassColorAttachment {
|
|
|
|
view: GPUTextureView;
|
|
|
|
resolveTarget?: GPUTextureView;
|
|
|
|
|
|
|
|
clearValue?: GPUColor;
|
|
|
|
loadOp: GPULoadOp;
|
|
|
|
storeOp: GPUStoreOp;
|
|
|
|
}
|
|
|
|
|
2024-09-11 20:59:05 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPassDepthStencilAttachment {
|
|
|
|
view: GPUTextureView;
|
|
|
|
|
|
|
|
depthClearValue?: number;
|
|
|
|
depthLoadOp?: GPULoadOp;
|
|
|
|
depthStoreOp?: GPUStoreOp;
|
|
|
|
depthReadOnly?: boolean;
|
|
|
|
|
|
|
|
stencilClearValue?: number;
|
|
|
|
stencilLoadOp?: GPULoadOp;
|
|
|
|
stencilStoreOp?: GPUStoreOp;
|
|
|
|
stencilReadOnly?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPULoadOp = "load" | "clear";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUStoreOp = "store" | "discard";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPURenderBundle implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPURenderBundleEncoder
|
|
|
|
implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase {
|
|
|
|
label: string;
|
|
|
|
draw(
|
|
|
|
vertexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndexed(
|
|
|
|
indexCount: number,
|
|
|
|
instanceCount?: number,
|
|
|
|
firstIndex?: number,
|
|
|
|
baseVertex?: number,
|
|
|
|
firstInstance?: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndexedIndirect(
|
|
|
|
indirectBuffer: GPUBuffer,
|
|
|
|
indirectOffset: number,
|
|
|
|
): undefined;
|
|
|
|
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined;
|
|
|
|
insertDebugMarker(markerLabel: string): undefined;
|
|
|
|
popDebugGroup(): undefined;
|
|
|
|
pushDebugGroup(groupLabel: string): undefined;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsets?: number[],
|
|
|
|
): undefined;
|
|
|
|
setBindGroup(
|
|
|
|
index: number,
|
|
|
|
bindGroup: GPUBindGroup,
|
|
|
|
dynamicOffsetsData: Uint32Array,
|
|
|
|
dynamicOffsetsDataStart: number,
|
|
|
|
dynamicOffsetsDataLength: number,
|
|
|
|
): undefined;
|
|
|
|
setIndexBuffer(
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
indexFormat: GPUIndexFormat,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
|
|
setVertexBuffer(
|
|
|
|
slot: number,
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
offset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderPassLayout extends GPUObjectDescriptorBase {
|
|
|
|
colorFormats: (GPUTextureFormat | null)[];
|
|
|
|
depthStencilFormat?: GPUTextureFormat;
|
|
|
|
sampleCount?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
|
|
|
|
depthReadOnly?: boolean;
|
|
|
|
stencilReadOnly?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUQueue implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
submit(commandBuffers: GPUCommandBuffer[]): undefined;
|
|
|
|
|
|
|
|
onSubmittedWorkDone(): Promise<undefined>;
|
|
|
|
|
|
|
|
writeBuffer(
|
|
|
|
buffer: GPUBuffer,
|
|
|
|
bufferOffset: number,
|
|
|
|
data: BufferSource,
|
|
|
|
dataOffset?: number,
|
|
|
|
size?: number,
|
|
|
|
): undefined;
|
|
|
|
|
|
|
|
writeTexture(
|
|
|
|
destination: GPUImageCopyTexture,
|
|
|
|
data: BufferSource,
|
|
|
|
dataLayout: GPUImageDataLayout,
|
|
|
|
size: GPUExtent3D,
|
|
|
|
): undefined;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUQuerySet implements GPUObjectBase {
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
destroy(): undefined;
|
|
|
|
|
|
|
|
readonly type: GPUQueryType;
|
|
|
|
readonly count: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
|
|
type: GPUQueryType;
|
|
|
|
count: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUQueryType = "occlusion" | "timestamp";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUDeviceLostReason = "destroyed";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUDeviceLostInfo {
|
|
|
|
readonly reason: GPUDeviceLostReason;
|
|
|
|
readonly message: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUError {
|
|
|
|
readonly message: string;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUOutOfMemoryError extends GPUError {
|
|
|
|
constructor(message: string);
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare class GPUValidationError extends GPUError {
|
|
|
|
constructor(message: string);
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare class GPUInternalError extends GPUError {
|
|
|
|
constructor(message: string);
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare type GPUErrorFilter = "out-of-memory" | "validation" | "internal";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-07-10 03:09:15 -04:00
|
|
|
declare class GPUUncapturedErrorEvent extends Event {
|
2024-05-05 10:22:18 -04:00
|
|
|
constructor(
|
|
|
|
type: string,
|
|
|
|
gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit,
|
|
|
|
);
|
|
|
|
|
|
|
|
readonly error: GPUError;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-05-05 10:22:18 -04:00
|
|
|
declare interface GPUUncapturedErrorEventInit extends EventInit {
|
|
|
|
error: GPUError;
|
|
|
|
}
|
2023-12-08 19:19:16 -05:00
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUColorDict {
|
|
|
|
r: number;
|
|
|
|
g: number;
|
|
|
|
b: number;
|
|
|
|
a: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUColor = number[] | GPUColorDict;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUOrigin3DDict {
|
|
|
|
x?: number;
|
|
|
|
y?: number;
|
|
|
|
z?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUOrigin3D = number[] | GPUOrigin3DDict;
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare interface GPUExtent3DDict {
|
|
|
|
width: number;
|
|
|
|
height?: number;
|
|
|
|
depthOrArrayLayers?: number;
|
|
|
|
}
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2023-12-08 19:19:16 -05:00
|
|
|
declare type GPUExtent3D = number[] | GPUExtent3DDict;
|
2024-01-21 15:51:45 -05:00
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-01-21 15:51:45 -05:00
|
|
|
declare type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
|
|
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-01-21 15:51:45 -05:00
|
|
|
declare interface GPUCanvasConfiguration {
|
|
|
|
device: GPUDevice;
|
|
|
|
format: GPUTextureFormat;
|
|
|
|
usage?: GPUTextureUsageFlags;
|
|
|
|
viewFormats?: GPUTextureFormat[];
|
|
|
|
colorSpace?: "srgb" | "display-p3";
|
|
|
|
alphaMode?: GPUCanvasAlphaMode;
|
|
|
|
}
|
2024-09-10 08:04:59 -04:00
|
|
|
/** @category GPU */
|
2024-01-21 15:51:45 -05:00
|
|
|
declare interface GPUCanvasContext {
|
|
|
|
configure(configuration: GPUCanvasConfiguration): undefined;
|
|
|
|
unconfigure(): undefined;
|
|
|
|
getCurrentTexture(): GPUTexture;
|
|
|
|
}
|