@wasi-gfx/js-webgpu 0.1.0 → 0.3.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 +45 -0
- package/dist/canvas.js +125 -0
- package/dist/common.d.ts +17 -0
- package/dist/common.js +33 -0
- package/dist/globals.d.ts +1 -0
- package/dist/globals.js +52 -0
- package/dist/webgpu.d.ts +380 -0
- package/dist/{index.js → webgpu.js} +243 -177
- package/package.json +26 -7
- 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
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import { GPUTexture } from './webgpu';
|
|
4
|
+
export declare function createCanvas(): HTMLCanvasElement;
|
|
5
|
+
type LimitedCanvas = Pick<globalThis.HTMLCanvasElement, "height" | "width" | "getContext" | "transferControlToOffscreen" | "addEventListener" | "removeEventListener" | "dispatchEvent" | "onclick" | "ondblclick" | "oninput" | "onkeydown" | "onkeyup" | "onpointerdown" | "onpointermove" | "onpointerup">;
|
|
6
|
+
export declare class HTMLCanvasElement implements LimitedCanvas, AnimationFrameProvider {
|
|
7
|
+
#private;
|
|
8
|
+
_surface: wasiSurface.Surface;
|
|
9
|
+
_webgpuContext: wasiSurfaceWebgpu.Context | undefined;
|
|
10
|
+
get height(): number;
|
|
11
|
+
set height(value: number);
|
|
12
|
+
get width(): number;
|
|
13
|
+
set width(value: number);
|
|
14
|
+
constructor(k: symbol);
|
|
15
|
+
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings | undefined): CanvasRenderingContext2D | null;
|
|
16
|
+
getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings | undefined): ImageBitmapRenderingContext | null;
|
|
17
|
+
getContext(contextId: "webgl", options?: WebGLContextAttributes | undefined): WebGLRenderingContext | null;
|
|
18
|
+
getContext(contextId: "webgl2", options?: WebGLContextAttributes | undefined): WebGL2RenderingContext | null;
|
|
19
|
+
getContext(contextId: "webgpu"): GPUCanvasContext;
|
|
20
|
+
transferControlToOffscreen(): OffscreenCanvas;
|
|
21
|
+
addEventListener(type: unknown, listener: unknown, options?: unknown): void;
|
|
22
|
+
removeEventListener(type: unknown, listener: unknown, options?: unknown): void;
|
|
23
|
+
dispatchEvent(event: Event): boolean;
|
|
24
|
+
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
25
|
+
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
26
|
+
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
27
|
+
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
28
|
+
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
29
|
+
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
30
|
+
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
31
|
+
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
32
|
+
cancelAnimationFrame(handle: number): void;
|
|
33
|
+
requestAnimationFrame(callback: FrameRequestCallback): number;
|
|
34
|
+
}
|
|
35
|
+
export declare class GPUCanvasContext implements globalThis.GPUCanvasContext {
|
|
36
|
+
#private;
|
|
37
|
+
constructor(k: symbol, canvas: HTMLCanvasElement);
|
|
38
|
+
readonly __brand: 'GPUCanvasContext';
|
|
39
|
+
get canvas(): globalThis.HTMLCanvasElement;
|
|
40
|
+
configure(configuration: GPUCanvasConfiguration): undefined;
|
|
41
|
+
unconfigure(): undefined;
|
|
42
|
+
getConfiguration(): GPUCanvasConfigurationOut | null;
|
|
43
|
+
getCurrentTexture(): GPUTexture;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
package/dist/canvas.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
import { inner, key, privateConstructorCalled, Todo, Unreachable, Unimplemented } from './common';
|
|
4
|
+
import { GPUTexture, convertTextureFormatWebToWasi, convertTextureUsageWebToWasi } from './webgpu';
|
|
5
|
+
export function createCanvas() {
|
|
6
|
+
return new HTMLCanvasElement(key);
|
|
7
|
+
}
|
|
8
|
+
export class HTMLCanvasElement {
|
|
9
|
+
_surface;
|
|
10
|
+
_webgpuContext;
|
|
11
|
+
#frames;
|
|
12
|
+
get height() {
|
|
13
|
+
return this._surface.height();
|
|
14
|
+
}
|
|
15
|
+
set height(value) {
|
|
16
|
+
this._surface.requestSetSize(value, undefined);
|
|
17
|
+
}
|
|
18
|
+
get width() {
|
|
19
|
+
return this._surface.width();
|
|
20
|
+
}
|
|
21
|
+
set width(value) {
|
|
22
|
+
this._surface.requestSetSize(undefined, value);
|
|
23
|
+
}
|
|
24
|
+
constructor(k) {
|
|
25
|
+
privateConstructorCalled(k);
|
|
26
|
+
this._surface = new wasiSurface.Surface({});
|
|
27
|
+
}
|
|
28
|
+
getContext(contextId, options) {
|
|
29
|
+
switch (contextId.toLowerCase()) {
|
|
30
|
+
case "2d":
|
|
31
|
+
throw new Unimplemented;
|
|
32
|
+
case "bitmaprenderer":
|
|
33
|
+
throw new Todo;
|
|
34
|
+
case "webgl":
|
|
35
|
+
throw new Unimplemented;
|
|
36
|
+
case "webgl2":
|
|
37
|
+
throw new Unimplemented;
|
|
38
|
+
case "webgpu":
|
|
39
|
+
return new GPUCanvasContext(key, this);
|
|
40
|
+
default:
|
|
41
|
+
throw new Unreachable;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
transferControlToOffscreen() {
|
|
45
|
+
throw new Todo;
|
|
46
|
+
}
|
|
47
|
+
addEventListener(type, listener, options) {
|
|
48
|
+
throw new Todo;
|
|
49
|
+
}
|
|
50
|
+
removeEventListener(type, listener, options) {
|
|
51
|
+
throw new Todo;
|
|
52
|
+
}
|
|
53
|
+
dispatchEvent(event) {
|
|
54
|
+
throw new Todo;
|
|
55
|
+
}
|
|
56
|
+
onclick = null;
|
|
57
|
+
ondblclick = null;
|
|
58
|
+
oninput = null;
|
|
59
|
+
onkeydown = null;
|
|
60
|
+
onkeyup = null;
|
|
61
|
+
onpointerdown = null;
|
|
62
|
+
onpointermove = null;
|
|
63
|
+
onpointerup = null;
|
|
64
|
+
cancelAnimationFrame(handle) {
|
|
65
|
+
throw new Todo;
|
|
66
|
+
}
|
|
67
|
+
requestAnimationFrame(callback) {
|
|
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;
|
|
74
|
+
// TODO: this number should be real
|
|
75
|
+
callback(0);
|
|
76
|
+
// present automatically just like the web
|
|
77
|
+
this._webgpuContext?.present();
|
|
78
|
+
});
|
|
79
|
+
// TODO: this number should be real
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class GPUCanvasContext {
|
|
84
|
+
#canvas;
|
|
85
|
+
constructor(k, canvas) {
|
|
86
|
+
privateConstructorCalled(k);
|
|
87
|
+
this.#canvas = canvas;
|
|
88
|
+
}
|
|
89
|
+
__brand = "GPUCanvasContext";
|
|
90
|
+
get canvas() {
|
|
91
|
+
throw new Todo;
|
|
92
|
+
}
|
|
93
|
+
configure(configuration) {
|
|
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;
|
|
109
|
+
}
|
|
110
|
+
unconfigure() {
|
|
111
|
+
this.#canvas._webgpuContext?.unconfigure();
|
|
112
|
+
this.#canvas._webgpuContext = undefined;
|
|
113
|
+
}
|
|
114
|
+
getConfiguration() {
|
|
115
|
+
throw new Todo;
|
|
116
|
+
}
|
|
117
|
+
getCurrentTexture() {
|
|
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());
|
|
124
|
+
}
|
|
125
|
+
}
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class EventTarget {
|
|
2
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
|
|
3
|
+
dispatchEvent(event: Event): boolean;
|
|
4
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
|
5
|
+
}
|
|
6
|
+
export declare class Todo extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
export declare class Unimplemented extends Error {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
export declare class Unreachable extends Error {
|
|
13
|
+
constructor();
|
|
14
|
+
}
|
|
15
|
+
export declare const inner: unique symbol;
|
|
16
|
+
export declare const key: unique symbol;
|
|
17
|
+
export declare function privateConstructorCalled(k: symbol): void;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// https://dom.spec.whatwg.org/#interface-eventtarget
|
|
2
|
+
export class EventTarget {
|
|
3
|
+
addEventListener(type, callback, options) {
|
|
4
|
+
throw new Todo;
|
|
5
|
+
}
|
|
6
|
+
dispatchEvent(event) {
|
|
7
|
+
throw new Todo;
|
|
8
|
+
}
|
|
9
|
+
removeEventListener(type, callback, options) {
|
|
10
|
+
throw new Todo;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class Todo extends Error {
|
|
14
|
+
constructor() {
|
|
15
|
+
super("TODO: not yet implemented");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class Unimplemented extends Error {
|
|
19
|
+
constructor() {
|
|
20
|
+
super("Unimplemented.");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class Unreachable extends Error {
|
|
24
|
+
constructor() {
|
|
25
|
+
super("Unreachable code reached.");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export const inner = Symbol("inner");
|
|
29
|
+
export const key = Symbol("key");
|
|
30
|
+
export function privateConstructorCalled(k) {
|
|
31
|
+
if (k !== key)
|
|
32
|
+
throw new TypeError("Illegal constructor.");
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function declareGlobals(): void;
|
package/dist/globals.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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";
|
|
2
|
+
class Navigator {
|
|
3
|
+
gpu;
|
|
4
|
+
constructor() {
|
|
5
|
+
this.gpu = getGpu();
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function defineGlobal(name, value) {
|
|
9
|
+
Object.defineProperty(globalThis, name, {
|
|
10
|
+
value,
|
|
11
|
+
writable: true,
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function declareGlobals() {
|
|
17
|
+
defineGlobal("window", globalThis);
|
|
18
|
+
defineGlobal("navigator", new Navigator());
|
|
19
|
+
defineGlobal("GPU", GPU);
|
|
20
|
+
defineGlobal("GPUAdapter", GPUAdapter);
|
|
21
|
+
// defineGlobal("GPUAdapterInfo", GPUAdapterInfo);
|
|
22
|
+
// defineGlobal("GPUSupportedLimits", GPUSupportedLimits);
|
|
23
|
+
// defineGlobal("GPUSupportedFeatures", GPUSupportedFeatures);
|
|
24
|
+
// defineGlobal("GPUDeviceLostInfo", GPUDeviceLostInfo);
|
|
25
|
+
defineGlobal("GPUDevice", GPUDevice);
|
|
26
|
+
defineGlobal("GPUQueue", GPUQueue);
|
|
27
|
+
defineGlobal("GPUBuffer", GPUBuffer);
|
|
28
|
+
defineGlobal("GPUBufferUsage", GPUBufferUsage);
|
|
29
|
+
defineGlobal("GPUMapMode", GPUMapMode);
|
|
30
|
+
defineGlobal("GPUTextureUsage", GPUTextureUsage);
|
|
31
|
+
defineGlobal("GPUTexture", GPUTexture);
|
|
32
|
+
defineGlobal("GPUTextureView", GPUTextureView);
|
|
33
|
+
defineGlobal("GPUSampler", GPUSampler);
|
|
34
|
+
defineGlobal("GPUBindGroupLayout", GPUBindGroupLayout);
|
|
35
|
+
defineGlobal("GPUPipelineLayout", GPUPipelineLayout);
|
|
36
|
+
defineGlobal("GPUBindGroup", GPUBindGroup);
|
|
37
|
+
defineGlobal("GPUShaderModule", GPUShaderModule);
|
|
38
|
+
defineGlobal("GPUShaderStage", GPUShaderStage);
|
|
39
|
+
defineGlobal("GPUComputePipeline", GPUComputePipeline);
|
|
40
|
+
defineGlobal("GPURenderPipeline", GPURenderPipeline);
|
|
41
|
+
defineGlobal("GPUColorWrite", GPUColorWrite);
|
|
42
|
+
defineGlobal("GPUCommandEncoder", GPUCommandEncoder);
|
|
43
|
+
defineGlobal("GPURenderPassEncoder", GPURenderPassEncoder);
|
|
44
|
+
defineGlobal("GPUComputePassEncoder", GPUComputePassEncoder);
|
|
45
|
+
defineGlobal("GPUCommandBuffer", GPUCommandBuffer);
|
|
46
|
+
// defineGlobal("GPURenderBundleEncoder", GPURenderBundleEncoder);
|
|
47
|
+
// defineGlobal("GPURenderBundle", GPURenderBundle);
|
|
48
|
+
defineGlobal("GPUQuerySet", GPUQuerySet);
|
|
49
|
+
// defineGlobal("GPUError", GPUError);
|
|
50
|
+
// defineGlobal("GPUValidationError", GPUValidationError);
|
|
51
|
+
// defineGlobal("GPUOutOfMemoryError", GPUOutOfMemoryError);
|
|
52
|
+
}
|
package/dist/webgpu.d.ts
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
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;
|
|
5
|
+
export declare class GPU implements globalThis.GPU {
|
|
6
|
+
[inner]: gfx.Gpu;
|
|
7
|
+
constructor(k: symbol, i: gfx.Gpu);
|
|
8
|
+
get __brand(): 'GPU';
|
|
9
|
+
get wgslLanguageFeatures(): WGSLLanguageFeatures;
|
|
10
|
+
requestAdapter(descriptor?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
11
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
12
|
+
}
|
|
13
|
+
export declare class GPUAdapter implements globalThis.GPUAdapter {
|
|
14
|
+
#private;
|
|
15
|
+
[inner]: gfx.GpuAdapter;
|
|
16
|
+
constructor(k: symbol, i: gfx.GpuAdapter);
|
|
17
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
18
|
+
requestAdapterInfo(): void;
|
|
19
|
+
get __brand(): 'GPUAdapter';
|
|
20
|
+
get info(): GPUAdapterInfo;
|
|
21
|
+
get features(): GPUSupportedFeatures;
|
|
22
|
+
get limits(): GPUSupportedLimits;
|
|
23
|
+
}
|
|
24
|
+
export declare class GPUSupportedFeatures implements globalThis.GPUSupportedFeatures {
|
|
25
|
+
[inner]: gfx.GpuSupportedFeatures;
|
|
26
|
+
constructor(k: symbol, i: gfx.GpuSupportedFeatures);
|
|
27
|
+
get __brand(): 'GPUSupportedFeatures';
|
|
28
|
+
get size(): number;
|
|
29
|
+
has(value: string): boolean;
|
|
30
|
+
forEach(callbackfn: (value: string, value2: string, set: ReadonlySet<string>) => void, thisArg?: any): void;
|
|
31
|
+
entries(): SetIterator<[string, string]>;
|
|
32
|
+
keys(): SetIterator<string>;
|
|
33
|
+
values(): SetIterator<string>;
|
|
34
|
+
[Symbol.iterator](): SetIterator<string>;
|
|
35
|
+
}
|
|
36
|
+
export declare class GPUSupportedLimits implements globalThis.GPUSupportedLimits {
|
|
37
|
+
[inner]: gfx.GpuSupportedLimits;
|
|
38
|
+
constructor(k: symbol, i: gfx.GpuSupportedLimits);
|
|
39
|
+
get __brand(): 'GPUSupportedLimits';
|
|
40
|
+
get maxTextureDimension1D(): number;
|
|
41
|
+
get maxTextureDimension2D(): number;
|
|
42
|
+
get maxTextureDimension3D(): number;
|
|
43
|
+
get maxTextureArrayLayers(): number;
|
|
44
|
+
get maxBindGroups(): number;
|
|
45
|
+
get maxBindGroupsPlusVertexBuffers(): number;
|
|
46
|
+
get maxImmediateSize(): number;
|
|
47
|
+
get maxBindingsPerBindGroup(): number;
|
|
48
|
+
get maxDynamicUniformBuffersPerPipelineLayout(): number;
|
|
49
|
+
get maxDynamicStorageBuffersPerPipelineLayout(): number;
|
|
50
|
+
get maxSampledTexturesPerShaderStage(): number;
|
|
51
|
+
get maxSamplersPerShaderStage(): number;
|
|
52
|
+
get maxStorageBuffersPerShaderStage(): number;
|
|
53
|
+
get maxStorageTexturesPerShaderStage(): number;
|
|
54
|
+
get maxUniformBuffersPerShaderStage(): number;
|
|
55
|
+
get maxUniformBufferBindingSize(): number;
|
|
56
|
+
get maxStorageBufferBindingSize(): number;
|
|
57
|
+
get minUniformBufferOffsetAlignment(): number;
|
|
58
|
+
get minStorageBufferOffsetAlignment(): number;
|
|
59
|
+
get maxVertexBuffers(): number;
|
|
60
|
+
get maxBufferSize(): number;
|
|
61
|
+
get maxVertexAttributes(): number;
|
|
62
|
+
get maxVertexBufferArrayStride(): number;
|
|
63
|
+
get maxInterStageShaderVariables(): number;
|
|
64
|
+
get maxColorAttachments(): number;
|
|
65
|
+
get maxColorAttachmentBytesPerSample(): number;
|
|
66
|
+
get maxComputeWorkgroupStorageSize(): number;
|
|
67
|
+
get maxComputeInvocationsPerWorkgroup(): number;
|
|
68
|
+
get maxComputeWorkgroupSizeX(): number;
|
|
69
|
+
get maxComputeWorkgroupSizeY(): number;
|
|
70
|
+
get maxComputeWorkgroupSizeZ(): number;
|
|
71
|
+
get maxComputeWorkgroupsPerDimension(): number;
|
|
72
|
+
}
|
|
73
|
+
export declare class GPUAdapterInfo implements globalThis.GPUAdapterInfo {
|
|
74
|
+
[inner]: gfx.GpuAdapterInfo;
|
|
75
|
+
constructor(k: symbol, i: gfx.GpuAdapterInfo);
|
|
76
|
+
get __brand(): 'GPUAdapterInfo';
|
|
77
|
+
get vendor(): string;
|
|
78
|
+
get architecture(): string;
|
|
79
|
+
get device(): string;
|
|
80
|
+
get description(): string;
|
|
81
|
+
get isFallbackAdapter(): boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare class GPUDevice extends EventTarget implements globalThis.GPUDevice {
|
|
84
|
+
#private;
|
|
85
|
+
[inner]: gfx.GpuDevice;
|
|
86
|
+
constructor(k: symbol, i: gfx.GpuDevice);
|
|
87
|
+
get __brand(): 'GPUDevice';
|
|
88
|
+
get label(): string;
|
|
89
|
+
set label(value: string);
|
|
90
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
91
|
+
get features(): GPUSupportedFeatures;
|
|
92
|
+
get limits(): GPUSupportedLimits;
|
|
93
|
+
get queue(): GPUQueue;
|
|
94
|
+
get adapterInfo(): GPUAdapterInfo;
|
|
95
|
+
destroy(): undefined;
|
|
96
|
+
createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer;
|
|
97
|
+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
|
|
98
|
+
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
|
|
99
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
100
|
+
createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout;
|
|
101
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
102
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
103
|
+
createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline;
|
|
104
|
+
createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
105
|
+
createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>;
|
|
106
|
+
createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
|
|
107
|
+
createCommandEncoder(descriptor?: GPUCommandEncoderDescriptor): GPUCommandEncoder;
|
|
108
|
+
createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
|
|
109
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
110
|
+
pushErrorScope(filter: GPUErrorFilter): undefined;
|
|
111
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
112
|
+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
|
|
113
|
+
onuncapturederror: ((this: globalThis.GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
|
|
114
|
+
}
|
|
115
|
+
export declare class GPURenderBundleEncoder implements globalThis.GPURenderBundleEncoder {
|
|
116
|
+
[inner]: gfx.GpuRenderBundleEncoder;
|
|
117
|
+
constructor(k: symbol, i: gfx.GpuRenderBundleEncoder);
|
|
118
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
119
|
+
get __brand(): 'GPURenderBundleEncoder';
|
|
120
|
+
get label(): string;
|
|
121
|
+
set label(value: string);
|
|
122
|
+
finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle;
|
|
123
|
+
pushDebugGroup(groupLabel: string): undefined;
|
|
124
|
+
popDebugGroup(): undefined;
|
|
125
|
+
insertDebugMarker(markerLabel: string): undefined;
|
|
126
|
+
setBindGroup(index: unknown, bindGroup: unknown, dynamicOffsetsData?: unknown, dynamicOffsetsDataStart?: unknown, dynamicOffsetsDataLength?: unknown): undefined;
|
|
127
|
+
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
128
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
129
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null | undefined, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
130
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32, firstVertex?: GPUSize32, firstInstance?: GPUSize32): undefined;
|
|
131
|
+
drawIndexed(indexCount: GPUSize32, instanceCount?: GPUSize32, firstIndex?: GPUSize32, baseVertex?: GPUSignedOffset32, firstInstance?: GPUSize32): undefined;
|
|
132
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
133
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
134
|
+
}
|
|
135
|
+
export declare class GPURenderBundle implements globalThis.GPURenderBundle {
|
|
136
|
+
[inner]: gfx.GpuRenderBundle;
|
|
137
|
+
constructor(k: symbol, i: gfx.GpuRenderBundle);
|
|
138
|
+
get __brand(): 'GPURenderBundle';
|
|
139
|
+
get label(): string;
|
|
140
|
+
set label(value: string);
|
|
141
|
+
}
|
|
142
|
+
export declare class GPUShaderModule implements globalThis.GPUShaderModule {
|
|
143
|
+
[inner]: gfx.GpuShaderModule;
|
|
144
|
+
constructor(k: symbol, i: gfx.GpuShaderModule);
|
|
145
|
+
get __brand(): 'GPUShaderModule';
|
|
146
|
+
get label(): string;
|
|
147
|
+
set label(value: string);
|
|
148
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
149
|
+
}
|
|
150
|
+
export declare class GPUCompilationInfo implements globalThis.GPUCompilationInfo {
|
|
151
|
+
[inner]: gfx.GpuCompilationInfo;
|
|
152
|
+
constructor(k: symbol, i: gfx.GpuCompilationInfo);
|
|
153
|
+
get __brand(): 'GPUCompilationInfo';
|
|
154
|
+
get messages(): GPUCompilationMessage[];
|
|
155
|
+
}
|
|
156
|
+
export declare class GPUCompilationMessage implements globalThis.GPUCompilationMessage {
|
|
157
|
+
[inner]: gfx.GpuCompilationMessage;
|
|
158
|
+
constructor(k: symbol, i: gfx.GpuCompilationMessage);
|
|
159
|
+
get __brand(): 'GPUCompilationMessage';
|
|
160
|
+
get message(): string;
|
|
161
|
+
get type(): GPUCompilationMessageType;
|
|
162
|
+
get lineNum(): number;
|
|
163
|
+
get linePos(): number;
|
|
164
|
+
get offset(): number;
|
|
165
|
+
get length(): number;
|
|
166
|
+
}
|
|
167
|
+
export declare class GPUComputePipeline implements globalThis.GPUComputePipeline {
|
|
168
|
+
[inner]: gfx.GpuComputePipeline;
|
|
169
|
+
constructor(k: symbol, i: gfx.GpuComputePipeline);
|
|
170
|
+
get __brand(): 'GPUComputePipeline';
|
|
171
|
+
get label(): string;
|
|
172
|
+
set label(value: string);
|
|
173
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
174
|
+
}
|
|
175
|
+
export declare class GPUPipelineLayout implements globalThis.GPUPipelineLayout {
|
|
176
|
+
[inner]: gfx.GpuPipelineLayout;
|
|
177
|
+
constructor(k: symbol, i: gfx.GpuPipelineLayout);
|
|
178
|
+
get __brand(): 'GPUPipelineLayout';
|
|
179
|
+
get label(): string;
|
|
180
|
+
set label(value: string);
|
|
181
|
+
}
|
|
182
|
+
export declare class GPURenderPipeline implements globalThis.GPURenderPipeline {
|
|
183
|
+
[inner]: gfx.GpuRenderPipeline;
|
|
184
|
+
constructor(k: symbol, i: gfx.GpuRenderPipeline);
|
|
185
|
+
get __brand(): 'GPURenderPipeline';
|
|
186
|
+
get label(): string;
|
|
187
|
+
set label(value: string);
|
|
188
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
189
|
+
}
|
|
190
|
+
export declare class GPUBuffer implements globalThis.GPUBuffer {
|
|
191
|
+
[inner]: gfx.GpuBuffer;
|
|
192
|
+
_mappedRangeBuffer: Uint8Array<ArrayBuffer> | undefined;
|
|
193
|
+
_mappedRangeOffset: bigint | undefined;
|
|
194
|
+
_mappedRangeSize: bigint | undefined;
|
|
195
|
+
constructor(k: symbol, i: gfx.GpuBuffer);
|
|
196
|
+
get __brand(): 'GPUBuffer';
|
|
197
|
+
get label(): string;
|
|
198
|
+
set label(value: string);
|
|
199
|
+
get size(): GPUSize64Out;
|
|
200
|
+
get usage(): GPUFlagsConstant;
|
|
201
|
+
get mapState(): GPUBufferMapState;
|
|
202
|
+
mapAsync(mode: GPUMapModeFlags, offset?: GPUSize64, size?: GPUSize64): Promise<undefined>;
|
|
203
|
+
getMappedRange(offset?: GPUSize64, size?: GPUSize64): ArrayBuffer;
|
|
204
|
+
unmap(): undefined;
|
|
205
|
+
destroy(): undefined;
|
|
206
|
+
}
|
|
207
|
+
export declare class GPUQueue implements globalThis.GPUQueue {
|
|
208
|
+
[inner]: gfx.GpuQueue;
|
|
209
|
+
constructor(k: symbol, i: gfx.GpuQueue);
|
|
210
|
+
get __brand(): 'GPUQueue';
|
|
211
|
+
get label(): string;
|
|
212
|
+
set label(value: string);
|
|
213
|
+
submit(commandBuffers: Iterable<GPUCommandBuffer>): undefined;
|
|
214
|
+
onSubmittedWorkDone(): Promise<undefined>;
|
|
215
|
+
writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource | SharedArrayBuffer, dataOffset?: GPUSize64, size?: GPUSize64): undefined;
|
|
216
|
+
writeTexture(destination: GPUTexelCopyTextureInfo, data: BufferSource | SharedArrayBuffer, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D): undefined;
|
|
217
|
+
copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D): undefined;
|
|
218
|
+
}
|
|
219
|
+
export declare class GPUBindGroupLayout implements globalThis.GPUBindGroupLayout {
|
|
220
|
+
[inner]: gfx.GpuBindGroupLayout;
|
|
221
|
+
constructor(k: symbol, i: gfx.GpuBindGroupLayout);
|
|
222
|
+
get __brand(): 'GPUBindGroupLayout';
|
|
223
|
+
get label(): string;
|
|
224
|
+
set label(value: string);
|
|
225
|
+
}
|
|
226
|
+
export declare class GPUBindGroup implements globalThis.GPUBindGroup {
|
|
227
|
+
[inner]: gfx.GpuBindGroup;
|
|
228
|
+
constructor(k: symbol, i: gfx.GpuBindGroup);
|
|
229
|
+
get __brand(): 'GPUBindGroup';
|
|
230
|
+
get label(): string;
|
|
231
|
+
set label(value: string);
|
|
232
|
+
}
|
|
233
|
+
export declare class GPUSampler implements globalThis.GPUSampler {
|
|
234
|
+
[inner]: gfx.GpuSampler;
|
|
235
|
+
constructor(k: symbol, i: gfx.GpuSampler);
|
|
236
|
+
get __brand(): 'GPUSampler';
|
|
237
|
+
get label(): string;
|
|
238
|
+
set label(value: string);
|
|
239
|
+
}
|
|
240
|
+
export declare class GPUTextureView implements globalThis.GPUTextureView {
|
|
241
|
+
[inner]: gfx.GpuTextureView;
|
|
242
|
+
constructor(k: symbol, i: gfx.GpuTextureView);
|
|
243
|
+
get __brand(): 'GPUTextureView';
|
|
244
|
+
get label(): string;
|
|
245
|
+
set label(value: string);
|
|
246
|
+
}
|
|
247
|
+
export declare class GPUTexture implements globalThis.GPUTexture {
|
|
248
|
+
[inner]: gfx.GpuTexture;
|
|
249
|
+
constructor(k: symbol, i: gfx.GpuTexture);
|
|
250
|
+
get __brand(): 'GPUTexture';
|
|
251
|
+
get label(): string;
|
|
252
|
+
set label(value: string);
|
|
253
|
+
get width(): number;
|
|
254
|
+
get height(): number;
|
|
255
|
+
get depthOrArrayLayers(): number;
|
|
256
|
+
get mipLevelCount(): number;
|
|
257
|
+
get sampleCount(): number;
|
|
258
|
+
get dimension(): GPUTextureDimension;
|
|
259
|
+
get format(): GPUTextureFormat;
|
|
260
|
+
get usage(): number;
|
|
261
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
262
|
+
destroy(): undefined;
|
|
263
|
+
}
|
|
264
|
+
export declare class GPUCommandEncoder implements globalThis.GPUCommandEncoder {
|
|
265
|
+
[inner]: gfx.GpuCommandEncoder;
|
|
266
|
+
constructor(k: symbol, i: gfx.GpuCommandEncoder);
|
|
267
|
+
get __brand(): 'GPUCommandEncoder';
|
|
268
|
+
get label(): string;
|
|
269
|
+
set label(value: string);
|
|
270
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
271
|
+
beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
|
|
272
|
+
copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): undefined;
|
|
273
|
+
copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): undefined;
|
|
274
|
+
copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): undefined;
|
|
275
|
+
copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): undefined;
|
|
276
|
+
copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): undefined;
|
|
277
|
+
clearBuffer(buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
278
|
+
resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): undefined;
|
|
279
|
+
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
280
|
+
pushDebugGroup(groupLabel: string): undefined;
|
|
281
|
+
popDebugGroup(): undefined;
|
|
282
|
+
insertDebugMarker(markerLabel: string): undefined;
|
|
283
|
+
}
|
|
284
|
+
export declare class GPUComputePassEncoder implements globalThis.GPUComputePassEncoder {
|
|
285
|
+
[inner]: gfx.GpuComputePassEncoder;
|
|
286
|
+
constructor(k: symbol, i: gfx.GpuComputePassEncoder);
|
|
287
|
+
get __brand(): 'GPUComputePassEncoder';
|
|
288
|
+
get label(): string;
|
|
289
|
+
set label(value: string);
|
|
290
|
+
setPipeline(pipeline: GPUComputePipeline): undefined;
|
|
291
|
+
dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY?: GPUSize32, workgroupCountZ?: GPUSize32): undefined;
|
|
292
|
+
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
293
|
+
end(): undefined;
|
|
294
|
+
pushDebugGroup(groupLabel: string): undefined;
|
|
295
|
+
popDebugGroup(): undefined;
|
|
296
|
+
insertDebugMarker(markerLabel: string): undefined;
|
|
297
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetsData?: Iterable<GPUBufferDynamicOffset> | Uint32Array, dynamicOffsetsDataStart?: GPUSize64, dynamicOffsetsDataLength?: GPUSize32): undefined;
|
|
298
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
299
|
+
}
|
|
300
|
+
export declare class GPURenderPassEncoder implements globalThis.GPURenderPassEncoder {
|
|
301
|
+
[inner]: gfx.GpuRenderPassEncoder;
|
|
302
|
+
constructor(k: symbol, i: gfx.GpuRenderPassEncoder);
|
|
303
|
+
get __brand(): 'GPURenderPassEncoder';
|
|
304
|
+
get label(): string;
|
|
305
|
+
set label(value: string);
|
|
306
|
+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): undefined;
|
|
307
|
+
setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): undefined;
|
|
308
|
+
setBlendConstant(color: GPUColor): undefined;
|
|
309
|
+
setStencilReference(reference: GPUStencilValue): undefined;
|
|
310
|
+
beginOcclusionQuery(queryIndex: GPUSize32): undefined;
|
|
311
|
+
endOcclusionQuery(): undefined;
|
|
312
|
+
executeBundles(bundles: Iterable<GPURenderBundle>): undefined;
|
|
313
|
+
end(): undefined;
|
|
314
|
+
pushDebugGroup(groupLabel: string): undefined;
|
|
315
|
+
popDebugGroup(): undefined;
|
|
316
|
+
insertDebugMarker(markerLabel: string): undefined;
|
|
317
|
+
setBindGroup(index: unknown, bindGroup: unknown, dynamicOffsetsData?: unknown, dynamicOffsetsDataStart?: unknown, dynamicOffsetsDataLength?: unknown): undefined;
|
|
318
|
+
setImmediates(rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, dataSize?: GPUSize64): undefined;
|
|
319
|
+
setPipeline(pipeline: GPURenderPipeline): undefined;
|
|
320
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
321
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64, size?: GPUSize64): undefined;
|
|
322
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32, firstVertex?: GPUSize32, firstInstance?: GPUSize32): undefined;
|
|
323
|
+
drawIndexed(indexCount: GPUSize32, instanceCount?: GPUSize32, firstIndex?: GPUSize32, baseVertex?: GPUSignedOffset32, firstInstance?: GPUSize32): undefined;
|
|
324
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
325
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): undefined;
|
|
326
|
+
}
|
|
327
|
+
export declare class GPUQuerySet implements globalThis.GPUQuerySet {
|
|
328
|
+
[inner]: gfx.GpuQuerySet;
|
|
329
|
+
constructor(k: symbol, i: gfx.GpuQuerySet);
|
|
330
|
+
destroy(): undefined;
|
|
331
|
+
get __brand(): 'GPUQuerySet';
|
|
332
|
+
get label(): string;
|
|
333
|
+
set label(value: string);
|
|
334
|
+
get type(): GPUQueryType;
|
|
335
|
+
get count(): number;
|
|
336
|
+
}
|
|
337
|
+
export declare class GPUCommandBuffer implements globalThis.GPUCommandBuffer {
|
|
338
|
+
[inner]: gfx.GpuCommandBuffer;
|
|
339
|
+
constructor(k: symbol, i: gfx.GpuCommandBuffer);
|
|
340
|
+
get __brand(): 'GPUCommandBuffer';
|
|
341
|
+
get label(): string;
|
|
342
|
+
set label(value: string);
|
|
343
|
+
}
|
|
344
|
+
export declare function getGpu(): GPU;
|
|
345
|
+
export declare const GPUBufferUsage: {
|
|
346
|
+
MAP_READ: number;
|
|
347
|
+
MAP_WRITE: number;
|
|
348
|
+
COPY_SRC: number;
|
|
349
|
+
COPY_DST: number;
|
|
350
|
+
INDEX: number;
|
|
351
|
+
VERTEX: number;
|
|
352
|
+
UNIFORM: number;
|
|
353
|
+
STORAGE: number;
|
|
354
|
+
INDIRECT: number;
|
|
355
|
+
QUERY_RESOLVE: number;
|
|
356
|
+
};
|
|
357
|
+
export declare const GPUMapMode: {
|
|
358
|
+
READ: number;
|
|
359
|
+
WRITE: number;
|
|
360
|
+
};
|
|
361
|
+
export declare const GPUTextureUsage: {
|
|
362
|
+
COPY_SRC: number;
|
|
363
|
+
COPY_DST: number;
|
|
364
|
+
TEXTURE_BINDING: number;
|
|
365
|
+
STORAGE_BINDING: number;
|
|
366
|
+
RENDER_ATTACHMENT: number;
|
|
367
|
+
TRANSIENT_ATTACHMENT: number;
|
|
368
|
+
};
|
|
369
|
+
export declare const GPUShaderStage: {
|
|
370
|
+
VERTEX: number;
|
|
371
|
+
FRAGMENT: number;
|
|
372
|
+
COMPUTE: number;
|
|
373
|
+
};
|
|
374
|
+
export declare const GPUColorWrite: {
|
|
375
|
+
RED: number;
|
|
376
|
+
GREEN: number;
|
|
377
|
+
BLUE: number;
|
|
378
|
+
ALPHA: number;
|
|
379
|
+
ALL: number;
|
|
380
|
+
};
|