Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update webgpu #17534

Merged
merged 6 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 24 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ url = { version = "2.3.1", features = ["serde", "expose_internals"] }
uuid = { version = "=1.1.2", features = ["v4"] }
zstd = "=0.11.2"

# webgpu
raw-window-handle = "0.5.0"
wgpu-core = "0.15"
wgpu-types = "0.15"

# macros
proc-macro2 = "1"
quote = "1"
Expand Down
58 changes: 30 additions & 28 deletions cli/tsc/dts/lib.deno_webgpu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare class GPUSupportedLimits {
maxTextureDimension3D?: number;
maxTextureArrayLayers?: number;
maxBindGroups?: number;
maxBindingsPerBindGroup?: number;
maxDynamicUniformBuffersPerPipelineLayout?: number;
maxDynamicStorageBuffersPerPipelineLayout?: number;
maxSampledTexturesPerShaderStage?: number;
Expand All @@ -34,6 +35,7 @@ declare class GPUSupportedLimits {
minUniformBufferOffsetAlignment?: number;
minStorageBufferOffsetAlignment?: number;
maxVertexBuffers?: number;
maxBufferSize?: number;
maxVertexAttributes?: number;
maxVertexBufferArrayStride?: number;
maxInterStageShaderComponents?: number;
Expand Down Expand Up @@ -109,7 +111,6 @@ declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
/** @category WebGPU */
declare type GPUFeatureName =
| "depth-clip-control"
| "depth24unorm-stencil8"
| "depth32float-stencil8"
| "pipeline-statistics-query"
| "texture-compression-bc"
Expand Down Expand Up @@ -139,9 +140,6 @@ declare class GPUDevice extends EventTarget implements GPUObjectBase {
readonly lost: Promise<GPUDeviceLostInfo>;
pushErrorScope(filter: GPUErrorFilter): undefined;
popErrorScope(): Promise<GPUError | null>;
onuncapturederror:
| ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any)
| null;

readonly features: GPUSupportedFeatures;
readonly limits: GPUSupportedLimits;
Expand Down Expand Up @@ -189,6 +187,10 @@ declare class GPUDevice extends EventTarget implements GPUObjectBase {
declare class GPUBuffer implements GPUObjectBase {
label: string;

readonly size: number;
readonly usage: GPUBufferUsageFlags;
readonly mapState: GPUBufferMapState;

mapAsync(
mode: GPUMapModeFlags,
offset?: number,
Expand All @@ -200,6 +202,9 @@ declare class GPUBuffer implements GPUObjectBase {
destroy(): undefined;
}

/** @category WebGPU */
declare type GPUBufferMapState = "unmapped" | "pending" | "mapped";

/** @category WebGPU */
declare interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
size: number;
Expand Down Expand Up @@ -239,6 +244,15 @@ declare class GPUTexture implements GPUObjectBase {

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: GPUTextureUsageFlags;
}

/** @category WebGPU */
Expand All @@ -249,6 +263,7 @@ declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
dimension?: GPUTextureDimension;
format: GPUTextureFormat;
usage: GPUTextureUsageFlags;
viewFormats?: GPUTextureFormat[];
}

/** @category WebGPU */
Expand Down Expand Up @@ -337,7 +352,6 @@ declare type GPUTextureFormat =
| "depth24plus"
| "depth24plus-stencil8"
| "depth32float"
| "depth24unorm-stencil8"
| "depth32float-stencil8"
| "bc1-rgba-unorm"
| "bc1-rgba-unorm-srgb"
Expand Down Expand Up @@ -814,6 +828,13 @@ declare interface GPUVertexAttribute {
shaderLocation: number;
}

/** @category WebGPU */
declare interface GPUImageDataLayout {
offset?: number;
bytesPerRow?: number;
rowsPerImage?: number;
}

/** @category WebGPU */
declare class GPUCommandBuffer implements GPUObjectBase {
label: string;
Expand Down Expand Up @@ -883,13 +904,6 @@ declare class GPUCommandEncoder implements GPUObjectBase {
/** @category WebGPU */
declare interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {}

/** @category WebGPU */
declare interface GPUImageDataLayout {
offset?: number;
bytesPerRow?: number;
rowsPerImage?: number;
}

/** @category WebGPU */
declare interface GPUImageCopyBuffer extends GPUImageDataLayout {
buffer: GPUBuffer;
Expand Down Expand Up @@ -1091,7 +1105,6 @@ declare class GPURenderPassEncoder
declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
colorAttachments: (GPURenderPassColorAttachment | null)[];
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
occlusionQuerySet?: GPUQuerySet;
}

/** @category WebGPU */
Expand Down Expand Up @@ -1229,6 +1242,9 @@ declare class GPUQuerySet implements GPUObjectBase {
label: string;

destroy(): undefined;

readonly type: GPUQueryType;
readonly count: number;
}

/** @category WebGPU */
Expand Down Expand Up @@ -1263,9 +1279,6 @@ declare class GPUError {
readonly message: string;
}

/** @category WebGPU */
declare type GPUErrorFilter = "out-of-memory" | "validation";

/** @category WebGPU */
declare class GPUOutOfMemoryError extends GPUError {
constructor(message: string);
Expand All @@ -1277,18 +1290,7 @@ declare class GPUValidationError extends GPUError {
}

/** @category WebGPU */
declare class GPUUncapturedErrorEvent extends Event {
constructor(
type: string,
gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit,
);
readonly error: GPUError;
}

/** @category WebGPU */
declare interface GPUUncapturedErrorEventInit extends EventInit {
error?: GPUError;
}
declare type GPUErrorFilter = "out-of-memory" | "validation";

/** @category WebGPU */
declare interface GPUColorDict {
Expand Down
Loading