@wasi-gfx/js-webgpu 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/canvas.d.ts +3 -3
- package/dist/canvas.js +36 -23
- package/dist/globals.js +12 -10
- package/dist/webgpu.d.ts +68 -12
- package/dist/webgpu.js +340 -48
- package/package.json +12 -6
- package/types/interfaces/wasi-cli-run.d.ts +2 -2
- package/types/interfaces/wasi-cli-stdout.d.ts +14 -3
- package/types/interfaces/wasi-cli-types.d.ts +15 -0
- package/types/interfaces/wasi-gfx-frame-buffer-frame-buffer.d.ts +13 -0
- package/types/interfaces/wasi-gfx-surface-surface-frame-buffer.d.ts +12 -0
- package/types/interfaces/wasi-gfx-surface-surface-webgpu.d.ts +29 -0
- package/types/interfaces/{wasi-surface-surface.d.ts → wasi-gfx-surface-surface.d.ts} +8 -18
- package/types/interfaces/wasi-webgpu-webgpu.d.ts +809 -810
- package/types/wit.d.ts +9 -10
- package/wit/deps/wasi-cli-0.3.0/package.wit +256 -0
- package/wit/deps/wasi-clocks-0.3.0/package.wit +43 -0
- package/wit/deps/wasi-filesystem-0.3.0/package.wit +149 -0
- package/wit/deps/wasi-gfx-frame-buffer-0.2.0/package.wit +13 -0
- package/wit/deps/{surface/surface.wit → wasi-gfx-surface-0.2.0/package.wit} +69 -44
- package/wit/deps/wasi-random-0.3.0/package.wit +18 -0
- package/wit/deps/wasi-sockets-0.3.0/package.wit +116 -0
- package/wit/deps/{webgpu/webgpu.wit → wasi-webgpu-0.3.0-rc.2/package.wit} +1007 -836
- package/wit/world.wit +8 -7
- package/types/interfaces/wasi-frame-buffer-frame-buffer.d.ts +0 -21
- package/types/interfaces/wasi-graphics-context-graphics-context.d.ts +0 -17
- package/types/interfaces/wasi-io-error.d.ts +0 -18
- package/types/interfaces/wasi-io-poll.d.ts +0 -43
- package/types/interfaces/wasi-io-streams.d.ts +0 -240
- package/wit/deps/cli/command.wit +0 -7
- package/wit/deps/cli/environment.wit +0 -18
- package/wit/deps/cli/exit.wit +0 -4
- package/wit/deps/cli/imports.wit +0 -20
- package/wit/deps/cli/run.wit +0 -4
- package/wit/deps/cli/stdio.wit +0 -17
- package/wit/deps/cli/terminal.wit +0 -49
- package/wit/deps/clocks/monotonic-clock.wit +0 -45
- package/wit/deps/clocks/wall-clock.wit +0 -42
- package/wit/deps/clocks/world.wit +0 -6
- package/wit/deps/filesystem/preopens.wit +0 -8
- package/wit/deps/filesystem/types.wit +0 -634
- package/wit/deps/filesystem/world.wit +0 -6
- package/wit/deps/frame-buffer/frame-buffer.wit +0 -23
- package/wit/deps/graphics-context/graphics-context.wit +0 -18
- package/wit/deps/io/error.wit +0 -34
- package/wit/deps/io/poll.wit +0 -41
- package/wit/deps/io/streams.wit +0 -262
- package/wit/deps/io/world.wit +0 -6
- package/wit/deps/random/insecure-seed.wit +0 -25
- package/wit/deps/random/insecure.wit +0 -22
- package/wit/deps/random/random.wit +0 -26
- package/wit/deps/random/world.wit +0 -7
- package/wit/deps/sockets/instance-network.wit +0 -9
- package/wit/deps/sockets/ip-name-lookup.wit +0 -51
- package/wit/deps/sockets/network.wit +0 -145
- package/wit/deps/sockets/tcp-create-socket.wit +0 -27
- package/wit/deps/sockets/tcp.wit +0 -353
- package/wit/deps/sockets/udp-create-socket.wit +0 -27
- package/wit/deps/sockets/udp.wit +0 -266
- package/wit/deps/sockets/world.wit +0 -11
- package/wit/deps/webgpu/imports.wit +0 -5
- package/wit/deps.lock +0 -51
- package/wit/deps.toml +0 -18
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@ npm run example --example=[example]
|
|
|
19
19
|
### Run an example:
|
|
20
20
|
Use [github.com/wasi-gfx/graphtime](https://github.com/wasi-gfx/graphtime) to run ./out/[example].wasm
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
## After Updating wit
|
|
23
|
+
Make sure to run:
|
|
24
24
|
```shell
|
|
25
|
-
|
|
25
|
+
npm run wit
|
|
26
26
|
```
|
package/dist/canvas.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as wasiSurface from 'wasi:surface/surface@0.0
|
|
2
|
-
import * as
|
|
1
|
+
import * as wasiSurface from 'wasi-gfx:surface/surface@0.2.0';
|
|
2
|
+
import * as wasiSurfaceWebgpu from 'wasi-gfx:surface/surface-webgpu@0.2.0';
|
|
3
3
|
import { GPUTexture } from './webgpu';
|
|
4
4
|
export declare function createCanvas(): HTMLCanvasElement;
|
|
5
5
|
type LimitedCanvas = Pick<globalThis.HTMLCanvasElement, "height" | "width" | "getContext" | "transferControlToOffscreen" | "addEventListener" | "removeEventListener" | "dispatchEvent" | "onclick" | "ondblclick" | "oninput" | "onkeydown" | "onkeyup" | "onpointerdown" | "onpointermove" | "onpointerup">;
|
|
6
6
|
export declare class HTMLCanvasElement implements LimitedCanvas, AnimationFrameProvider {
|
|
7
7
|
#private;
|
|
8
8
|
_surface: wasiSurface.Surface;
|
|
9
|
-
|
|
9
|
+
_webgpuContext: wasiSurfaceWebgpu.Context | undefined;
|
|
10
10
|
get height(): number;
|
|
11
11
|
set height(value: number);
|
|
12
12
|
get width(): number;
|
package/dist/canvas.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as wasiGraphicsContext from 'wasi:graphics-context/graphics-context@0.0.1';
|
|
1
|
+
import * as wasiSurface from 'wasi-gfx:surface/surface@0.2.0';
|
|
2
|
+
import * as wasiSurfaceWebgpu from 'wasi-gfx:surface/surface-webgpu@0.2.0';
|
|
4
3
|
import { inner, key, privateConstructorCalled, Todo, Unreachable, Unimplemented } from './common';
|
|
5
|
-
import { GPUTexture } from './webgpu';
|
|
4
|
+
import { GPUTexture, convertTextureFormatWebToWasi, convertTextureUsageWebToWasi } from './webgpu';
|
|
6
5
|
export function createCanvas() {
|
|
7
6
|
return new HTMLCanvasElement(key);
|
|
8
7
|
}
|
|
9
8
|
export class HTMLCanvasElement {
|
|
10
9
|
_surface;
|
|
11
|
-
|
|
12
|
-
#
|
|
10
|
+
_webgpuContext;
|
|
11
|
+
#frames;
|
|
13
12
|
get height() {
|
|
14
13
|
return this._surface.height();
|
|
15
14
|
}
|
|
@@ -25,8 +24,6 @@ export class HTMLCanvasElement {
|
|
|
25
24
|
constructor(k) {
|
|
26
25
|
privateConstructorCalled(k);
|
|
27
26
|
this._surface = new wasiSurface.Surface({});
|
|
28
|
-
this._graphicsContext = new wasiGraphicsContext.Context();
|
|
29
|
-
this._surface.connectGraphicsContext(this._graphicsContext);
|
|
30
27
|
}
|
|
31
28
|
getContext(contextId, options) {
|
|
32
29
|
switch (contextId.toLowerCase()) {
|
|
@@ -68,16 +65,16 @@ export class HTMLCanvasElement {
|
|
|
68
65
|
throw new Todo;
|
|
69
66
|
}
|
|
70
67
|
requestAnimationFrame(callback) {
|
|
71
|
-
if (!this.#
|
|
72
|
-
this.#
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this._surface.getFrame();
|
|
68
|
+
if (!this.#frames)
|
|
69
|
+
this.#frames = this._surface.onFrame()[Symbol.asyncIterator]();
|
|
70
|
+
const frames = this.#frames;
|
|
71
|
+
frames.next().then(({ done }) => {
|
|
72
|
+
if (done)
|
|
73
|
+
return;
|
|
78
74
|
// TODO: this number should be real
|
|
79
75
|
callback(0);
|
|
80
|
-
|
|
76
|
+
// present automatically just like the web
|
|
77
|
+
this._webgpuContext?.present();
|
|
81
78
|
});
|
|
82
79
|
// TODO: this number should be real
|
|
83
80
|
return 0;
|
|
@@ -94,19 +91,35 @@ export class GPUCanvasContext {
|
|
|
94
91
|
throw new Todo;
|
|
95
92
|
}
|
|
96
93
|
configure(configuration) {
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
let usage;
|
|
95
|
+
if (configuration.usage !== undefined)
|
|
96
|
+
usage = convertTextureUsageWebToWasi(configuration.usage);
|
|
97
|
+
let viewFormats;
|
|
98
|
+
if (configuration.viewFormats)
|
|
99
|
+
viewFormats = Array.from(configuration.viewFormats).map(convertTextureFormatWebToWasi);
|
|
100
|
+
const context = new wasiSurfaceWebgpu.Context(this.#canvas._surface);
|
|
101
|
+
context.configure({
|
|
102
|
+
...configuration,
|
|
103
|
+
usage,
|
|
104
|
+
viewFormats,
|
|
105
|
+
device: configuration.device[inner],
|
|
106
|
+
format: convertTextureFormatWebToWasi(configuration.format),
|
|
107
|
+
});
|
|
108
|
+
this.#canvas._webgpuContext = context;
|
|
100
109
|
}
|
|
101
110
|
unconfigure() {
|
|
102
|
-
|
|
111
|
+
this.#canvas._webgpuContext?.unconfigure();
|
|
112
|
+
this.#canvas._webgpuContext = undefined;
|
|
103
113
|
}
|
|
104
114
|
getConfiguration() {
|
|
105
115
|
throw new Todo;
|
|
106
116
|
}
|
|
107
117
|
getCurrentTexture() {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
118
|
+
if (!this.#canvas._webgpuContext) {
|
|
119
|
+
// https://www.w3.org/TR/webgpu/#dom-gpucanvascontext-getcurrenttexture
|
|
120
|
+
// > 1. If this.[[configuration]] is null, throw an InvalidStateError and return.
|
|
121
|
+
throw new DOMException("GPUCanvasContext.getCurrentTexture: Canvas not configured", "InvalidStateError");
|
|
122
|
+
}
|
|
123
|
+
return new GPUTexture(key, this.#canvas._webgpuContext.getCurrentTexture());
|
|
111
124
|
}
|
|
112
125
|
}
|
package/dist/globals.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getGpu, GPU, GPUAdapter, GPUDevice, GPUQueue, GPUBuffer, GPUBufferUsage, GPUMapMode, GPUTextureUsage, GPUTexture, GPUTextureView, GPUSampler, GPUBindGroupLayout, GPUPipelineLayout, GPUBindGroup, GPUShaderModule, GPUShaderStage, GPUComputePipeline, GPURenderPipeline, GPUColorWrite, GPUCommandEncoder, GPURenderPassEncoder, GPUComputePassEncoder, GPUCommandBuffer, GPUQuerySet } from "./webgpu";
|
|
1
|
+
import { getGpu, GPU, GPUAdapter, GPUDeviceLostInfo, GPUDevice, GPUQueue, GPUBuffer, GPUBufferUsage, GPUMapMode, GPUTextureUsage, GPUTexture, GPUTextureView, GPUSampler, GPUBindGroupLayout, GPUPipelineLayout, GPUBindGroup, GPUShaderModule, GPUShaderStage, GPUComputePipeline, GPURenderPipeline, GPUColorWrite, GPUCommandEncoder, GPURenderPassEncoder, GPUComputePassEncoder, GPUCommandBuffer, GPUQuerySet, GPUAdapterInfo, GPUSupportedLimits, GPUSupportedFeatures, GPURenderBundleEncoder, GPURenderBundle, GPUError, GPUValidationError, GPUOutOfMemoryError, GPUInternalError, GPUPipelineError } from "./webgpu";
|
|
2
2
|
class Navigator {
|
|
3
3
|
gpu;
|
|
4
4
|
constructor() {
|
|
@@ -18,10 +18,10 @@ export function declareGlobals() {
|
|
|
18
18
|
defineGlobal("navigator", new Navigator());
|
|
19
19
|
defineGlobal("GPU", GPU);
|
|
20
20
|
defineGlobal("GPUAdapter", GPUAdapter);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
defineGlobal("GPUAdapterInfo", GPUAdapterInfo);
|
|
22
|
+
defineGlobal("GPUSupportedLimits", GPUSupportedLimits);
|
|
23
|
+
defineGlobal("GPUSupportedFeatures", GPUSupportedFeatures);
|
|
24
|
+
defineGlobal("GPUDeviceLostInfo", GPUDeviceLostInfo);
|
|
25
25
|
defineGlobal("GPUDevice", GPUDevice);
|
|
26
26
|
defineGlobal("GPUQueue", GPUQueue);
|
|
27
27
|
defineGlobal("GPUBuffer", GPUBuffer);
|
|
@@ -43,10 +43,12 @@ export function declareGlobals() {
|
|
|
43
43
|
defineGlobal("GPURenderPassEncoder", GPURenderPassEncoder);
|
|
44
44
|
defineGlobal("GPUComputePassEncoder", GPUComputePassEncoder);
|
|
45
45
|
defineGlobal("GPUCommandBuffer", GPUCommandBuffer);
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
defineGlobal("GPURenderBundleEncoder", GPURenderBundleEncoder);
|
|
47
|
+
defineGlobal("GPURenderBundle", GPURenderBundle);
|
|
48
48
|
defineGlobal("GPUQuerySet", GPUQuerySet);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
defineGlobal("GPUError", GPUError);
|
|
50
|
+
defineGlobal("GPUValidationError", GPUValidationError);
|
|
51
|
+
defineGlobal("GPUOutOfMemoryError", GPUOutOfMemoryError);
|
|
52
|
+
defineGlobal("GPUInternalError", GPUInternalError);
|
|
53
|
+
defineGlobal("GPUPipelineError", GPUPipelineError);
|
|
52
54
|
}
|
package/dist/webgpu.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as gfx from 'wasi:webgpu/webgpu@0.0.
|
|
2
|
-
import { inner } from './common';
|
|
1
|
+
import * as gfx from 'wasi:webgpu/webgpu@0.3.0-rc.2';
|
|
2
|
+
import { EventTarget, inner } from './common';
|
|
3
|
+
export declare function convertTextureUsageWebToWasi(usage: number): gfx.GpuTextureUsage;
|
|
4
|
+
export declare function convertTextureFormatWebToWasi(name: GPUTextureFormat): gfx.GpuTextureFormat;
|
|
3
5
|
export declare class GPU implements globalThis.GPU {
|
|
4
6
|
[inner]: gfx.Gpu;
|
|
5
7
|
constructor(k: symbol, i: gfx.Gpu);
|
|
@@ -9,6 +11,7 @@ export declare class GPU implements globalThis.GPU {
|
|
|
9
11
|
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
10
12
|
}
|
|
11
13
|
export declare class GPUAdapter implements globalThis.GPUAdapter {
|
|
14
|
+
#private;
|
|
12
15
|
[inner]: gfx.GpuAdapter;
|
|
13
16
|
constructor(k: symbol, i: gfx.GpuAdapter);
|
|
14
17
|
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
@@ -17,7 +20,6 @@ export declare class GPUAdapter implements globalThis.GPUAdapter {
|
|
|
17
20
|
get info(): GPUAdapterInfo;
|
|
18
21
|
get features(): GPUSupportedFeatures;
|
|
19
22
|
get limits(): GPUSupportedLimits;
|
|
20
|
-
get isFallbackAdapter(): boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare class GPUSupportedFeatures implements globalThis.GPUSupportedFeatures {
|
|
23
25
|
[inner]: gfx.GpuSupportedFeatures;
|
|
@@ -41,6 +43,7 @@ export declare class GPUSupportedLimits implements globalThis.GPUSupportedLimits
|
|
|
41
43
|
get maxTextureArrayLayers(): number;
|
|
42
44
|
get maxBindGroups(): number;
|
|
43
45
|
get maxBindGroupsPlusVertexBuffers(): number;
|
|
46
|
+
get maxImmediateSize(): number;
|
|
44
47
|
get maxBindingsPerBindGroup(): number;
|
|
45
48
|
get maxDynamicUniformBuffersPerPipelineLayout(): number;
|
|
46
49
|
get maxDynamicStorageBuffersPerPipelineLayout(): number;
|
|
@@ -75,8 +78,39 @@ export declare class GPUAdapterInfo implements globalThis.GPUAdapterInfo {
|
|
|
75
78
|
get architecture(): string;
|
|
76
79
|
get device(): string;
|
|
77
80
|
get description(): string;
|
|
81
|
+
get isFallbackAdapter(): boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare class GPUDeviceLostInfo implements globalThis.GPUDeviceLostInfo {
|
|
84
|
+
[inner]: gfx.GpuDeviceLostInfo;
|
|
85
|
+
constructor(k: symbol, i: gfx.GpuDeviceLostInfo);
|
|
86
|
+
get __brand(): 'GPUDeviceLostInfo';
|
|
87
|
+
get reason(): GPUDeviceLostReason;
|
|
88
|
+
get message(): string;
|
|
89
|
+
}
|
|
90
|
+
export declare class GPUError implements globalThis.GPUError {
|
|
91
|
+
#private;
|
|
92
|
+
constructor(k: symbol, message: string);
|
|
93
|
+
get message(): string;
|
|
94
|
+
}
|
|
95
|
+
export declare class GPUValidationError extends GPUError implements globalThis.GPUValidationError {
|
|
96
|
+
constructor(message: string);
|
|
97
|
+
get __brand(): 'GPUValidationError';
|
|
98
|
+
}
|
|
99
|
+
export declare class GPUOutOfMemoryError extends GPUError implements globalThis.GPUOutOfMemoryError {
|
|
100
|
+
constructor(message: string);
|
|
101
|
+
get __brand(): 'GPUOutOfMemoryError';
|
|
102
|
+
}
|
|
103
|
+
export declare class GPUInternalError extends GPUError implements globalThis.GPUInternalError {
|
|
104
|
+
constructor(message: string);
|
|
105
|
+
get __brand(): 'GPUInternalError';
|
|
106
|
+
}
|
|
107
|
+
export declare class GPUPipelineError extends DOMException implements globalThis.GPUPipelineError {
|
|
108
|
+
readonly reason: GPUPipelineErrorReason;
|
|
109
|
+
constructor(message: string | undefined, options: GPUPipelineErrorInit);
|
|
110
|
+
get __brand(): 'GPUPipelineError';
|
|
78
111
|
}
|
|
79
112
|
export declare class GPUDevice extends EventTarget implements globalThis.GPUDevice {
|
|
113
|
+
#private;
|
|
80
114
|
[inner]: gfx.GpuDevice;
|
|
81
115
|
constructor(k: symbol, i: gfx.GpuDevice);
|
|
82
116
|
get __brand(): 'GPUDevice';
|
|
@@ -97,7 +131,7 @@ export declare class GPUDevice extends EventTarget implements globalThis.GPUDevi
|
|
|
97
131
|
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
98
132
|
createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline;
|
|
99
133
|
createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
100
|
-
createComputePipelineAsync(
|
|
134
|
+
createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>;
|
|
101
135
|
createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
|
|
102
136
|
createCommandEncoder(descriptor?: GPUCommandEncoderDescriptor): GPUCommandEncoder;
|
|
103
137
|
createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
|
|
@@ -110,6 +144,7 @@ export declare class GPUDevice extends EventTarget implements globalThis.GPUDevi
|
|
|
110
144
|
export declare class GPURenderBundleEncoder implements globalThis.GPURenderBundleEncoder {
|
|
111
145
|
[inner]: gfx.GpuRenderBundleEncoder;
|
|
112
146
|
constructor(k: symbol, i: gfx.GpuRenderBundleEncoder);
|
|
147
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
113
148
|
get __brand(): 'GPURenderBundleEncoder';
|
|
114
149
|
get label(): string;
|
|
115
150
|
set label(value: string);
|
|
@@ -118,13 +153,13 @@ export declare class GPURenderBundleEncoder implements globalThis.GPURenderBundl
|
|
|
118
153
|
popDebugGroup(): undefined;
|
|
119
154
|
insertDebugMarker(markerLabel: string): undefined;
|
|
120
155
|
setBindGroup(index: unknown, bindGroup: unknown, dynamicOffsetsData?: unknown, dynamicOffsetsDataStart?: unknown, dynamicOffsetsDataLength?: unknown): undefined;
|
|
121
|
-
setPipeline(pipeline:
|
|
122
|
-
setIndexBuffer(buffer:
|
|
123
|
-
setVertexBuffer(slot: GPUIndex32, buffer:
|
|
156
|
+
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
157
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
158
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null | undefined, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
124
159
|
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32, firstVertex?: GPUSize32, firstInstance?: GPUSize32): undefined;
|
|
125
160
|
drawIndexed(indexCount: GPUSize32, instanceCount?: GPUSize32, firstIndex?: GPUSize32, baseVertex?: GPUSignedOffset32, firstInstance?: GPUSize32): undefined;
|
|
126
|
-
drawIndirect(indirectBuffer:
|
|
127
|
-
drawIndexedIndirect(indirectBuffer:
|
|
161
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
162
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
128
163
|
}
|
|
129
164
|
export declare class GPURenderBundle implements globalThis.GPURenderBundle {
|
|
130
165
|
[inner]: gfx.GpuRenderBundle;
|
|
@@ -141,6 +176,23 @@ export declare class GPUShaderModule implements globalThis.GPUShaderModule {
|
|
|
141
176
|
set label(value: string);
|
|
142
177
|
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
143
178
|
}
|
|
179
|
+
export declare class GPUCompilationInfo implements globalThis.GPUCompilationInfo {
|
|
180
|
+
[inner]: gfx.GpuCompilationInfo;
|
|
181
|
+
constructor(k: symbol, i: gfx.GpuCompilationInfo);
|
|
182
|
+
get __brand(): 'GPUCompilationInfo';
|
|
183
|
+
get messages(): GPUCompilationMessage[];
|
|
184
|
+
}
|
|
185
|
+
export declare class GPUCompilationMessage implements globalThis.GPUCompilationMessage {
|
|
186
|
+
[inner]: gfx.GpuCompilationMessage;
|
|
187
|
+
constructor(k: symbol, i: gfx.GpuCompilationMessage);
|
|
188
|
+
get __brand(): 'GPUCompilationMessage';
|
|
189
|
+
get message(): string;
|
|
190
|
+
get type(): GPUCompilationMessageType;
|
|
191
|
+
get lineNum(): number;
|
|
192
|
+
get linePos(): number;
|
|
193
|
+
get offset(): number;
|
|
194
|
+
get length(): number;
|
|
195
|
+
}
|
|
144
196
|
export declare class GPUComputePipeline implements globalThis.GPUComputePipeline {
|
|
145
197
|
[inner]: gfx.GpuComputePipeline;
|
|
146
198
|
constructor(k: symbol, i: gfx.GpuComputePipeline);
|
|
@@ -235,7 +287,7 @@ export declare class GPUTexture implements globalThis.GPUTexture {
|
|
|
235
287
|
get dimension(): GPUTextureDimension;
|
|
236
288
|
get format(): GPUTextureFormat;
|
|
237
289
|
get usage(): number;
|
|
238
|
-
createView(descriptor?: GPUTextureViewDescriptor):
|
|
290
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
239
291
|
destroy(): undefined;
|
|
240
292
|
}
|
|
241
293
|
export declare class GPUCommandEncoder implements globalThis.GPUCommandEncoder {
|
|
@@ -246,12 +298,13 @@ export declare class GPUCommandEncoder implements globalThis.GPUCommandEncoder {
|
|
|
246
298
|
set label(value: string);
|
|
247
299
|
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
248
300
|
beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
|
|
249
|
-
copyBufferToBuffer(source: GPUBuffer,
|
|
301
|
+
copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): undefined;
|
|
302
|
+
copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): undefined;
|
|
250
303
|
copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): undefined;
|
|
251
304
|
copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): undefined;
|
|
252
305
|
copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): undefined;
|
|
253
306
|
clearBuffer(buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
254
|
-
resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination:
|
|
307
|
+
resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): undefined;
|
|
255
308
|
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
256
309
|
pushDebugGroup(groupLabel: string): undefined;
|
|
257
310
|
popDebugGroup(): undefined;
|
|
@@ -271,6 +324,7 @@ export declare class GPUComputePassEncoder implements globalThis.GPUComputePassE
|
|
|
271
324
|
popDebugGroup(): undefined;
|
|
272
325
|
insertDebugMarker(markerLabel: string): undefined;
|
|
273
326
|
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetsData?: Iterable<GPUBufferDynamicOffset> | Uint32Array, dynamicOffsetsDataStart?: GPUSize64, dynamicOffsetsDataLength?: GPUSize32): undefined;
|
|
327
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
274
328
|
}
|
|
275
329
|
export declare class GPURenderPassEncoder implements globalThis.GPURenderPassEncoder {
|
|
276
330
|
[inner]: gfx.GpuRenderPassEncoder;
|
|
@@ -290,6 +344,7 @@ export declare class GPURenderPassEncoder implements globalThis.GPURenderPassEnc
|
|
|
290
344
|
popDebugGroup(): undefined;
|
|
291
345
|
insertDebugMarker(markerLabel: string): undefined;
|
|
292
346
|
setBindGroup(index: unknown, bindGroup: unknown, dynamicOffsetsData?: unknown, dynamicOffsetsDataStart?: unknown, dynamicOffsetsDataLength?: unknown): undefined;
|
|
347
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
293
348
|
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
294
349
|
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
295
350
|
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
@@ -338,6 +393,7 @@ export declare const GPUTextureUsage: {
|
|
|
338
393
|
TEXTURE_BINDING: number;
|
|
339
394
|
STORAGE_BINDING: number;
|
|
340
395
|
RENDER_ATTACHMENT: number;
|
|
396
|
+
TRANSIENT_ATTACHMENT: number;
|
|
341
397
|
};
|
|
342
398
|
export declare const GPUShaderStage: {
|
|
343
399
|
VERTEX: number;
|