pngine 3.0.0 → 3.0.1
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/dist/dev.d.ts +13 -0
- package/dist/index.d.ts +26 -1
- package/dist/mini-no-audio.d.ts +6 -0
- package/dist/mini.d.ts +6 -0
- package/dist/viewer.d.ts +26 -1
- package/package.json +7 -7
- package/schema/pngine.sjon +1 -1
- package/src/init.js +4 -0
- package/src/viewer-init.js +4 -0
- package/wasm/pngine-compiler.wasm +0 -0
package/dist/dev.d.ts
CHANGED
|
@@ -3,8 +3,21 @@ export interface DevOptions {
|
|
|
3
3
|
canvas?: HTMLCanvasElement;
|
|
4
4
|
debug?: boolean;
|
|
5
5
|
dpr?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Leave the canvas CSS size to the page and keep the backing store synced to
|
|
8
|
+
* its rendered size (responsive). Off by default (fixed size); a DPR change
|
|
9
|
+
* re-sharpens the backing store either way.
|
|
10
|
+
*/
|
|
11
|
+
autoResize?: boolean;
|
|
6
12
|
wasmUrl?: string | URL;
|
|
7
13
|
onError?: (error: Error) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Receives the contents of every `map-read` buffer the frame copies into,
|
|
16
|
+
* once per submit, as one number per 64-bit lane. The path was written for
|
|
17
|
+
* timestamp and occlusion query results, which are 64-bit; a compute readback
|
|
18
|
+
* has to write 64-bit lanes, `vec2u(value, 0u)`, to survive it.
|
|
19
|
+
*/
|
|
20
|
+
onQueryResult?: (values: number[]) => void;
|
|
8
21
|
}
|
|
9
22
|
|
|
10
23
|
export function pngine(
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,36 @@ export interface ViewerOptions {
|
|
|
3
3
|
canvas: HTMLCanvasElement;
|
|
4
4
|
debug?: boolean;
|
|
5
5
|
dpr?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Leave the canvas CSS size to the page and keep the backing store synced to
|
|
8
|
+
* its rendered size (responsive). Off by default (fixed size); a DPR change
|
|
9
|
+
* re-sharpens the backing store either way.
|
|
10
|
+
*/
|
|
11
|
+
autoResize?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* REJECTED at runtime, and declared here deliberately. The viewer throws
|
|
14
|
+
* Error("viewer pngine() does not support wasmUrl; use embedded executor
|
|
15
|
+
* payloads"). A caller moving over from pngine/dev needs that message, not an
|
|
16
|
+
* excess-property error from their bundler, so the rejection is part of this
|
|
17
|
+
* interface rather than hidden from it.
|
|
18
|
+
*/
|
|
19
|
+
wasmUrl?: string | URL;
|
|
6
20
|
onError?: (error: Error) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Receives the contents of every `map-read` buffer the frame copies into,
|
|
23
|
+
* once per submit, as one number per 64-bit lane. The path was written for
|
|
24
|
+
* timestamp and occlusion query results, which are 64-bit; a compute readback
|
|
25
|
+
* has to write 64-bit lanes, `vec2u(value, 0u)`, to survive it.
|
|
26
|
+
*/
|
|
27
|
+
onQueryResult?: (values: number[]) => void;
|
|
7
28
|
}
|
|
8
29
|
|
|
9
30
|
export function pngine(
|
|
10
|
-
|
|
31
|
+
// HTMLImageElement is in the union for the reason wasmUrl is in the options:
|
|
32
|
+
// the viewer rejects it at runtime with a message naming pngine/dev, and that
|
|
33
|
+
// message is more use to a caller than a compile error. A CSS-selector string
|
|
34
|
+
// is rejected the same way and needs no arm of its own, being a string.
|
|
35
|
+
source: ArrayBuffer | Uint8Array | Blob | string | HTMLImageElement,
|
|
11
36
|
options: ViewerOptions
|
|
12
37
|
): Promise<PngineInstance>;
|
|
13
38
|
|
package/dist/mini-no-audio.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
export interface MiniOptions {
|
|
3
3
|
autoplay?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime faults after the promise resolves (an undecodable opcode mid-frame,
|
|
6
|
+
* a WebGPU validation error, device loss). Setup failures reject instead.
|
|
7
|
+
* Without a handler they are console.error'd.
|
|
8
|
+
*/
|
|
9
|
+
onError?: (error: Error) => void;
|
|
4
10
|
}
|
|
5
11
|
|
|
6
12
|
export interface MiniInstance {
|
package/dist/mini.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
export interface MiniOptions {
|
|
3
3
|
autoplay?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime faults after the promise resolves (an undecodable opcode mid-frame,
|
|
6
|
+
* a WebGPU validation error, device loss). Setup failures reject instead.
|
|
7
|
+
* Without a handler they are console.error'd.
|
|
8
|
+
*/
|
|
9
|
+
onError?: (error: Error) => void;
|
|
4
10
|
}
|
|
5
11
|
|
|
6
12
|
export interface MiniInstance {
|
package/dist/viewer.d.ts
CHANGED
|
@@ -3,11 +3,36 @@ export interface ViewerOptions {
|
|
|
3
3
|
canvas: HTMLCanvasElement;
|
|
4
4
|
debug?: boolean;
|
|
5
5
|
dpr?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Leave the canvas CSS size to the page and keep the backing store synced to
|
|
8
|
+
* its rendered size (responsive). Off by default (fixed size); a DPR change
|
|
9
|
+
* re-sharpens the backing store either way.
|
|
10
|
+
*/
|
|
11
|
+
autoResize?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* REJECTED at runtime, and declared here deliberately. The viewer throws
|
|
14
|
+
* Error("viewer pngine() does not support wasmUrl; use embedded executor
|
|
15
|
+
* payloads"). A caller moving over from pngine/dev needs that message, not an
|
|
16
|
+
* excess-property error from their bundler, so the rejection is part of this
|
|
17
|
+
* interface rather than hidden from it.
|
|
18
|
+
*/
|
|
19
|
+
wasmUrl?: string | URL;
|
|
6
20
|
onError?: (error: Error) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Receives the contents of every `map-read` buffer the frame copies into,
|
|
23
|
+
* once per submit, as one number per 64-bit lane. The path was written for
|
|
24
|
+
* timestamp and occlusion query results, which are 64-bit; a compute readback
|
|
25
|
+
* has to write 64-bit lanes, `vec2u(value, 0u)`, to survive it.
|
|
26
|
+
*/
|
|
27
|
+
onQueryResult?: (values: number[]) => void;
|
|
7
28
|
}
|
|
8
29
|
|
|
9
30
|
export function pngine(
|
|
10
|
-
|
|
31
|
+
// HTMLImageElement is in the union for the reason wasmUrl is in the options:
|
|
32
|
+
// the viewer rejects it at runtime with a message naming pngine/dev, and that
|
|
33
|
+
// message is more use to a caller than a compile error. A CSS-selector string
|
|
34
|
+
// is rejected the same way and needs no arm of its own, being a string.
|
|
35
|
+
source: ArrayBuffer | Uint8Array | Blob | string | HTMLImageElement,
|
|
11
36
|
options: ViewerOptions
|
|
12
37
|
): Promise<PngineInstance>;
|
|
13
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pngine",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "WebGPU spec mapped 1:1 to s-expressions that can be packed in a png",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"./schema/pngine.sjon": "./schema/pngine.sjon"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"@pngine/darwin-arm64": "3.0.
|
|
93
|
-
"@pngine/darwin-x64": "3.0.
|
|
94
|
-
"@pngine/linux-x64": "3.0.
|
|
95
|
-
"@pngine/linux-arm64": "3.0.
|
|
96
|
-
"@pngine/win32-x64": "3.0.
|
|
97
|
-
"@pngine/win32-arm64": "3.0.
|
|
92
|
+
"@pngine/darwin-arm64": "3.0.1",
|
|
93
|
+
"@pngine/darwin-x64": "3.0.1",
|
|
94
|
+
"@pngine/linux-x64": "3.0.1",
|
|
95
|
+
"@pngine/linux-arm64": "3.0.1",
|
|
96
|
+
"@pngine/win32-x64": "3.0.1",
|
|
97
|
+
"@pngine/win32-arm64": "3.0.1"
|
|
98
98
|
},
|
|
99
99
|
"files": ["dist/", "bin/", "src/", "wasm/", "schema/", "README.md"],
|
|
100
100
|
"keywords": [
|
package/schema/pngine.sjon
CHANGED
|
@@ -1073,7 +1073,7 @@
|
|
|
1073
1073
|
; The element is `count` — a literal, a bounded expression, or a bare
|
|
1074
1074
|
; `(define …)` name — since 3.0.0 (`[WG 1 1]` works; it used to
|
|
1075
1075
|
; be `count-value`, literals and expressions only, because the element
|
|
1076
|
-
; reader resolved no symbols
|
|
1076
|
+
; reader resolved no symbols).
|
|
1077
1077
|
(value-kind :name dispatch-size
|
|
1078
1078
|
:description "Compute dispatch in workgroups as [x], [x y] or [x y z]; the missing dimensions default to 1. Elements are literals, expressions, or (define …) names."
|
|
1079
1079
|
:underlying vector :vector (vector-shape :element count :min-len 1 :max-len 3))
|
package/src/init.js
CHANGED
|
@@ -28,6 +28,10 @@ let workerUrl = null;
|
|
|
28
28
|
* @param {(err: Error) => void} [options.onError] - Receives worker errors,
|
|
29
29
|
* WGSL compilation errors (name "PngineShaderError", with lineNum/linePos/context),
|
|
30
30
|
* and WebGPU uncaptured errors (name "PngineGPUError")
|
|
31
|
+
* @param {(values: number[]) => void} [options.onQueryResult] - Receives the
|
|
32
|
+
* contents of every `map-read` buffer the frame copies into, once per submit,
|
|
33
|
+
* as one number per 64-bit lane. Written for timestamp and occlusion query
|
|
34
|
+
* results; a compute readback has to write 64-bit lanes to survive it.
|
|
31
35
|
* @returns {Promise<Pngine>}
|
|
32
36
|
*/
|
|
33
37
|
export async function pngine(source, options = {}) {
|
package/src/viewer-init.js
CHANGED
|
@@ -43,6 +43,10 @@ let workerUrl = null;
|
|
|
43
43
|
* @param {(err: Error) => void} [options.onError] - Receives worker errors,
|
|
44
44
|
* WGSL compilation errors (name "PngineShaderError", with lineNum/linePos/context),
|
|
45
45
|
* and WebGPU uncaptured errors (name "PngineGPUError")
|
|
46
|
+
* @param {(values: number[]) => void} [options.onQueryResult] - Receives the
|
|
47
|
+
* contents of every `map-read` buffer the frame copies into, once per submit,
|
|
48
|
+
* as one number per 64-bit lane. Written for timestamp and occlusion query
|
|
49
|
+
* results; a compute readback has to write 64-bit lanes to survive it.
|
|
46
50
|
* @returns {Promise<Pngine>}
|
|
47
51
|
*/
|
|
48
52
|
export async function pngine(source, options = {}) {
|
|
Binary file
|