animader-cli 0.4.0 → 0.6.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/adapters/webaudio.mjs +6 -4
- package/hello/run.js +82 -16
- package/lib/routes.mjs +1 -1
- package/lib/show.mjs +186 -11
- package/package.json +4 -4
- package/player/boot.mjs +467 -15
- package/player/controller.mjs +593 -22
- package/player/devchannel.mjs +15 -10
- package/player/index.html +4 -0
- package/player/page.mjs +6 -0
- package/player/player.css +682 -5
- package/player/transport.mjs +1445 -0
- package/resources/editor/.animader/schemas/metadata.json +3 -3
- package/resources/editor/.animader/schemas/pngine.sjon +128 -7
- package/src/commands/dev.mjs +3 -2
- package/toolchain/manifest.json +17 -17
- package/toolchain/uniform-type-name.js +17 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"producers": {
|
|
4
4
|
"animader": { "version": "0.0.0" },
|
|
5
5
|
"tempura": { "version": "0.1.0" },
|
|
6
|
-
"pngine": { "version": "4.
|
|
6
|
+
"pngine": { "version": "4.3.1" }
|
|
7
7
|
},
|
|
8
8
|
"sources": [
|
|
9
9
|
{
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"file": "pngine.sjon",
|
|
84
84
|
"owner": "pngine",
|
|
85
85
|
"optional": true,
|
|
86
|
-
"bytes":
|
|
87
|
-
"sha256": "
|
|
86
|
+
"bytes": 195316,
|
|
87
|
+
"sha256": "ac873a5674d33fe9bf5f0372a7b2172b62d181dd90e0ce17ac43fec5e3de8150"
|
|
88
88
|
}
|
|
89
89
|
],
|
|
90
90
|
"bundles": [
|
|
@@ -402,6 +402,7 @@
|
|
|
402
402
|
(member :name pngine-inputs :description "16 B: time, canvasWidth, canvasHeight, aspect (all f32). Runtime-provided; there is no authored document declaration to navigate to.")
|
|
403
403
|
(member :name scene-time-inputs :description "12 B: time, canvasWidth, canvasHeight (all f32) — the first 12 bytes of pngine-inputs. True scene timing is not modelled yet. Runtime-provided; there is no authored document declaration to navigate to.")
|
|
404
404
|
(member :name pngine-frame-inputs :description "20 B: the 16 B of pngine-inputs, then frameIndex (u32) — the executor's frame counter, which is also the ping-pong pool phase. For a jitter sequence (TAA) or any per-frame rotation. Runtime-provided; there is no authored document declaration to navigate to.")
|
|
405
|
+
(member :name control-inputs :description "4 B per declared `(control …)`, in declaration order; the frame's own `write-buffer` carries them, so a guard and a shader read one value.")
|
|
405
406
|
(member :name pointer-inputs :description "48 B: x, y, clickX, clickY, dx, dy, buttons, pressure, modifiers, scrollX, scrollY, _pad (all f32). Runtime-provided; there is no authored document declaration to navigate to.")))
|
|
406
407
|
; The two ref arms are ONE cross-ref target group, never a union of two ref
|
|
407
408
|
; kinds: a union resolves first-match while the emitter looks the name up in
|
|
@@ -417,6 +418,28 @@
|
|
|
417
418
|
:underlying union
|
|
418
419
|
:union (union-shape :alternatives [builtin-data-source data-or-wasm-ref]))
|
|
419
420
|
|
|
421
|
+
; ---- the guard subject: a builtin control or a declared one ----
|
|
422
|
+
; A `(step-group :when …)` names ONE thing, and the two things it can name
|
|
423
|
+
; live in different tables. The union of a member set and a reference kind is
|
|
424
|
+
; `write-buffer-source`'s shape, not a second mechanism: the arms overlap on
|
|
425
|
+
; the symbol shape, so a name neither accepts reports
|
|
426
|
+
; `union_no_branch_matched` naming both explanations, and a name only the
|
|
427
|
+
; reference arm could mean reports that arm's own `not_cross_ref`. Splitting
|
|
428
|
+
; it into two keys would let an author write both spellings at once.
|
|
429
|
+
(value-kind :name builtin-control
|
|
430
|
+
:description "A control the engine provides every frame. Runtime-provided; there is no authored document declaration to navigate to."
|
|
431
|
+
:underlying symbol
|
|
432
|
+
:members (member-set
|
|
433
|
+
(member :name time :description "The built-in control the engine sets every frame: seconds since the frame program started. Needs no (control …) declaration; the compiler reserves the name, so a declared control cannot shadow it.")))
|
|
434
|
+
(value-kind :name control-ref
|
|
435
|
+
:description "Reference to a declared (control :name …)."
|
|
436
|
+
:underlying symbol
|
|
437
|
+
:cross-ref (cross-ref :target [pngine/control]))
|
|
438
|
+
(value-kind :name control-source
|
|
439
|
+
:description "The subject of a guard: the builtin control time, or a name declared by (control …)."
|
|
440
|
+
:underlying union
|
|
441
|
+
:union (union-shape :alternatives [builtin-control control-ref]))
|
|
442
|
+
|
|
420
443
|
; `byte-size` was `[byte-count data-ref]` — a union whose ref arm meant "size
|
|
421
444
|
; this buffer from that data without filling it". Every corpus use of it also
|
|
422
445
|
; carried `:mapped-at-creation <the same data>`, naming one thing twice, and
|
|
@@ -1071,13 +1094,14 @@
|
|
|
1071
1094
|
; `duplicate_cross_ref_target` at the declaration, so a step can never be
|
|
1072
1095
|
; ambiguous. A named graph is in the list because the frame names it in the
|
|
1073
1096
|
; AUTHORED aggregate, where it is a `(pass-graph …)` / `(draw-graph …)` and
|
|
1074
|
-
; not yet the `(step-group …)` its hook emits
|
|
1097
|
+
; not yet the `(step-group …)` its hook emits; a `(select …)` joins for the
|
|
1098
|
+
; same reason (2089e59's fix, applied to the fourth member).
|
|
1075
1099
|
; (It used to be a union tried in order, while the emitter kept
|
|
1076
1100
|
; one table for both pass kinds — a collision silently dropped the render pass.)
|
|
1077
1101
|
(value-kind :name frame-step
|
|
1078
|
-
:description "One frame step: a render-pass, compute-pass or queue name, a named pass-graph/draw-graph (a step group),
|
|
1102
|
+
:description "One frame step: a render-pass, compute-pass or queue name, a named pass-graph/draw-graph (a step group), a step-group name, or a select name (one namespace across the forms)."
|
|
1079
1103
|
:underlying symbol
|
|
1080
|
-
:cross-ref (cross-ref :target [render-pass compute-pass queue step-group pass-graph draw-graph]))
|
|
1104
|
+
:cross-ref (cross-ref :target [render-pass compute-pass queue step-group pass-graph draw-graph select]))
|
|
1081
1105
|
(value-kind :name frame-step-list
|
|
1082
1106
|
:description "Passes and queues run every frame, in order."
|
|
1083
1107
|
:underlying vector :vector (vector-shape :element frame-step :max-len 2048))
|
|
@@ -1672,7 +1696,7 @@
|
|
|
1672
1696
|
; document said twice what the widened union now says once, and the
|
|
1673
1697
|
; exclusive-group existed to stop an author saying both.
|
|
1674
1698
|
(key :name data :type write-buffer-source
|
|
1675
|
-
:description "Source: a (data …) ref, a (wasm-call …) whose result is written each frame, or a runtime builtin — pngine-inputs (16B time/width/height/aspect), scene-time-inputs (12B), pngine-frame-inputs (20B, + frameIndex), pointer-inputs (48B)."))
|
|
1699
|
+
:description "Source: a (data …) ref, a (wasm-call …) whose result is written each frame, or a runtime builtin — pngine-inputs (16B time/width/height/aspect), scene-time-inputs (12B), pngine-frame-inputs (20B, + frameIndex), pointer-inputs (48B), control-inputs (4B per declared (control …) in declaration order)."))
|
|
1676
1700
|
|
|
1677
1701
|
; Both ends of a copy are dictionaries in the IDL
|
|
1678
1702
|
; (GPUTexelCopyTextureInfo / GPUCopyExternalImageSourceInfo), so they are
|
|
@@ -2313,6 +2337,20 @@
|
|
|
2313
2337
|
(key :name index-buffer :type buffer-ref :optional true
|
|
2314
2338
|
:description "Index buffer when the bundle draws indexed."))
|
|
2315
2339
|
|
|
2340
|
+
; A host-settable f32. It is one value with two readers: a guard compares it
|
|
2341
|
+
; before a group runs, and a shader samples the same slot through
|
|
2342
|
+
; `control-inputs`, so the branch and the draw cannot disagree. The schema
|
|
2343
|
+
; carries what it can (a unique name, a real default); the rest are compiler
|
|
2344
|
+
; checks and the description says so rather than implying enforcement here:
|
|
2345
|
+
; `time` is reserved, the name must be a WGSL identifier because it becomes a
|
|
2346
|
+
; struct member, and it must not collide with a reflected uniform field
|
|
2347
|
+
; because the host addresses both by bare name.
|
|
2348
|
+
(form :name control
|
|
2349
|
+
:description "A named f32 the host sets, readable by guards and by shaders through control-inputs. `time` is reserved by the compiler. The name must be a WGSL identifier and must not collide with a reflected uniform field — both are compiler checks, not schema rules."
|
|
2350
|
+
(key :name name :type symbol
|
|
2351
|
+
:description "Control name, unique among controls. It names a WGSL struct member in control-inputs, so it must be a WGSL identifier, and the host addresses it and reflected uniforms by bare name, so it must not collide with one (both compiler checks).")
|
|
2352
|
+
(key :name default :type real :default 0
|
|
2353
|
+
:description "Initial value: a literal, a bounded expression, or a bare (define …) name. Omitted, it is 0. The compiler rejects a value that is not finite after f32 rounding."))
|
|
2316
2354
|
; A named sequence of frame steps, expanded WHERE IT IS NAMED. This is what a
|
|
2317
2355
|
; `(draw-graph …)` or `(pass-graph …)` with a `:name` emits instead of a
|
|
2318
2356
|
; frame: a graph is several passes, so without a name for the set there is no
|
|
@@ -2320,11 +2358,34 @@
|
|
|
2320
2358
|
; document's only frame and refuse the other. Nothing reaches the wire — the
|
|
2321
2359
|
; emitter inlines a group's steps into the frame that names it, so a frame
|
|
2322
2360
|
; over groups emits exactly the ops the same frame written out by hand does.
|
|
2361
|
+
;
|
|
2362
|
+
; The guard keys are shaped so the schema can carry the rules (plan 4.6):
|
|
2363
|
+
; `:when` is one union slot, each comparison is the existing `real` kind,
|
|
2364
|
+
; and `:requires [when]` turns a comparison or `:else` written without a
|
|
2365
|
+
; subject into a located reject instead of inert input. Which key means what
|
|
2366
|
+
; is in each description; holding TWO comparisons is a window, which is why
|
|
2367
|
+
; that sentence sits on the comparison keys rather than in one shared place.
|
|
2323
2368
|
(form :name step-group
|
|
2324
|
-
:description "A named sequence of frame steps, inlined wherever a (frame …) or another group names it. Emitted by a named (draw-graph …) / (pass-graph …); writable by hand to name a sequence once and run it in several frames."
|
|
2369
|
+
:description "A named sequence of frame steps, inlined wherever a (frame …) or another group names it. Emitted by a named (draw-graph …) / (pass-graph …); writable by hand to name a sequence once and run it in several frames. With :when the group runs only when every comparison key holds (no comparison key = nonzero), and :else names the steps that run otherwise; without :when the group behaves exactly as today."
|
|
2325
2370
|
(key :name name :type symbol)
|
|
2326
2371
|
(key :name perform :type frame-step-list
|
|
2327
|
-
:description "The steps this group stands for, in order.")
|
|
2372
|
+
:description "The steps this group stands for, in order.")
|
|
2373
|
+
(key :name when :type control-source :optional true
|
|
2374
|
+
:description "The guard's subject: the builtin control time, or a (control …) name. The group runs only when every comparison key holds; with no comparison key it runs when the control is nonzero.")
|
|
2375
|
+
(key :name is :type real :optional true :requires [when]
|
|
2376
|
+
:description "Holds when the control equals this value (an exact f32 comparison). Written beside another comparison key, both must hold — two keys make a window.")
|
|
2377
|
+
(key :name is-not :type real :optional true :requires [when]
|
|
2378
|
+
:description "Holds when the control does not equal this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2379
|
+
(key :name below :type real :optional true :requires [when]
|
|
2380
|
+
:description "Holds when the control is less than this value. Written beside another comparison key, both must hold — two keys make a window, as in :at-least 10 :below 10.5.")
|
|
2381
|
+
(key :name above :type real :optional true :requires [when]
|
|
2382
|
+
:description "Holds when the control is greater than this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2383
|
+
(key :name at-least :type real :optional true :requires [when]
|
|
2384
|
+
:description "Holds when the control is greater than or equal to this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2385
|
+
(key :name at-most :type real :optional true :requires [when]
|
|
2386
|
+
:description "Holds when the control is less than or equal to this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2387
|
+
(key :name else :type frame-step-list :optional true :requires [when]
|
|
2388
|
+
:description "The steps that run when the guard does not hold. Needs :when; a group without a guard has nothing to be the alternative to."))
|
|
2328
2389
|
(form :name frame
|
|
2329
2390
|
:description "Frame program: what runs each frame, in order."
|
|
2330
2391
|
(key :name name :type symbol)
|
|
@@ -2335,6 +2396,66 @@
|
|
|
2335
2396
|
(key :name perform :type frame-step-list
|
|
2336
2397
|
:description "Passes and queues run every frame, in order."))
|
|
2337
2398
|
|
|
2399
|
+
; =====================================================================
|
|
2400
|
+
; `(select …)` sugar — lowered to a chain of guarded step-groups by
|
|
2401
|
+
; pngine/select-v1 (plan frame-program §4.3)
|
|
2402
|
+
; =====================================================================
|
|
2403
|
+
; `select` picks the first case whose comparison holds, and the whole thing
|
|
2404
|
+
; is sugar: the hook lowers it to the chain of guarded `(step-group …)`
|
|
2405
|
+
; forms a hand-written document would spell out. The schema carries what it
|
|
2406
|
+
; can (the case count, the `:on` union, the comparison keys as `real`); the
|
|
2407
|
+
; one rule no key-set can express — "a case carries at least one comparison
|
|
2408
|
+
; key", because a key-set has no min-children — is the hook's, refused on
|
|
2409
|
+
; the case's own span. The default belongs in `:else`.
|
|
2410
|
+
;
|
|
2411
|
+
; The count bound is head-set bounds on the slot-local `case` form: below
|
|
2412
|
+
; the floor `positional_missing` (on the select's head), above the ceiling
|
|
2413
|
+
; `positional_too_many` (on the 65th child) — the same per-head cardinality
|
|
2414
|
+
; mechanism the pipeline sections use.
|
|
2415
|
+
(value-kind :name select-section :underlying form :heads (head-set
|
|
2416
|
+
(head :name case :min 1 :max 64)))
|
|
2417
|
+
; One case. The comparison keys are the six a `(step-group …)` guard takes,
|
|
2418
|
+
; with the same meanings (every key written must hold, so two keys make a
|
|
2419
|
+
; window); the subject is the select's `:on`, written once, which is why
|
|
2420
|
+
; these carry no `:requires`. No `:name` — a case is a positional arm, not a
|
|
2421
|
+
; target, and the group the hook builds for it is named after the SELECT.
|
|
2422
|
+
(form :name case
|
|
2423
|
+
:description "One case of a (select …): at least one comparison key (the default belongs in the select's :else), and the steps to perform when it is the first case that holds."
|
|
2424
|
+
(key :name is :type real :optional true
|
|
2425
|
+
:description "Holds when the control equals this value (an exact f32 comparison). Written beside another comparison key, both must hold — two keys make a window.")
|
|
2426
|
+
(key :name is-not :type real :optional true
|
|
2427
|
+
:description "Holds when the control does not equal this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2428
|
+
(key :name below :type real :optional true
|
|
2429
|
+
:description "Holds when the control is less than this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2430
|
+
(key :name above :type real :optional true
|
|
2431
|
+
:description "Holds when the control is greater than this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2432
|
+
(key :name at-least :type real :optional true
|
|
2433
|
+
:description "Holds when the control is greater than or equal to this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2434
|
+
(key :name at-most :type real :optional true
|
|
2435
|
+
:description "Holds when the control is less than or equal to this value. Written beside another comparison key, both must hold — two keys make a window.")
|
|
2436
|
+
(key :name perform :type frame-step-list
|
|
2437
|
+
:description "The steps this case performs when it is the first case that holds."))
|
|
2438
|
+
; The chain's shape, for the reader: `(select :name backdrop :on scene (case
|
|
2439
|
+
; :is 0 :perform [linePass]) (case :is 1 :perform [gatesPass]) :else
|
|
2440
|
+
; [ringPass])` lowers to
|
|
2441
|
+
; (step-group :name backdrop :when scene :is 0 :perform [linePass] :else [backdrop__case1])
|
|
2442
|
+
; (step-group :name backdrop__case1 :when scene :is 1 :perform [gatesPass] :else [ringPass])
|
|
2443
|
+
; — the first group keeps the select's name (so a frame names `backdrop`
|
|
2444
|
+
; either way), continuations follow the hooks' double-underscore convention,
|
|
2445
|
+
; and the last case's `:else` is the select's `:else`.
|
|
2446
|
+
(form :name select
|
|
2447
|
+
:description "Pick the first case whose comparison holds. Sugar: pngine/select-v1 lowers it to a chain of guarded (step-group …) forms, so a frame names the select exactly as it names a group. Cases are tried in source order and the first match wins (overlap is legal — that is what makes a :below cascade work); no match and no :else, the select does nothing."
|
|
2448
|
+
:lowering (lowering :hook pngine/select-v1
|
|
2449
|
+
:produces [step-group])
|
|
2450
|
+
:positional select-section
|
|
2451
|
+
(key :name name :type symbol
|
|
2452
|
+
:description "Select name — the first group of the lowered chain keeps it, so a (frame …) names the select itself, and the continuation groups are <name>__caseN.")
|
|
2453
|
+
(key :name on :type control-source
|
|
2454
|
+
:description "The control every case compares — the builtin time, or a name declared by (control …). Becomes :when on every group the lowering emits.")
|
|
2455
|
+
(key :name else :type frame-step-list :optional true
|
|
2456
|
+
:description "The steps that run when no case holds. Becomes the last group's :else, so it is the chain's fallback arm."))
|
|
2457
|
+
|
|
2458
|
+
|
|
2338
2459
|
; ---- init sugar: lowered to compute-pipeline + bind-group + compute-pass ----
|
|
2339
2460
|
(form :name init
|
|
2340
2461
|
:description "One-shot compute init of a storage buffer (first frame only)."
|
|
@@ -2416,7 +2537,7 @@
|
|
|
2416
2537
|
:positional pass-section
|
|
2417
2538
|
(key :name name :type symbol)
|
|
2418
2539
|
(key :name code :type string
|
|
2419
|
-
:description "WGSL fragment (or compute) source; the hook injects the binding prelude (pngine uniforms, pointer, sampler, dep/feedback textures, D0… data buffers). Required — the hook always refused its absence.")
|
|
2540
|
+
:description "WGSL fragment (or compute) source; the hook injects the binding prelude (pngine uniforms, pointer, sampler, dep/feedback textures, D0… data buffers, and — when the document declares (control …) forms and the code names `controls` — the ControlInputs struct, one f32 member per control in declaration order, on the next binding, with a graph-shared buffer and one control-inputs write per frame). Required — the hook always refused its absence.")
|
|
2420
2541
|
(key :name feedback :type boolean :optional true
|
|
2421
2542
|
:description "Ping-pong texture pair for feedback; the previous frame is readable as prev_<name>.")
|
|
2422
2543
|
; The intermediate's texel format, which is ONE value in WebGPU terms: the
|
package/src/commands/dev.mjs
CHANGED
|
@@ -126,8 +126,9 @@ export function devCommandUsageText() {
|
|
|
126
126
|
'tree (kernels and nested assets included; out/ and dist/ excluded)',
|
|
127
127
|
'and rebuilds on edits: bursts coalesce, a change during a build',
|
|
128
128
|
'discards that candidate and queues exactly one rebuild, and the page',
|
|
129
|
-
'is told to reload only on a successful build — a full reload
|
|
130
|
-
'
|
|
129
|
+
'is told to reload only on a successful build — a full reload that',
|
|
130
|
+
'returns paused at the moment it left (a `?t=<seconds>` URL moment wins;',
|
|
131
|
+
'the release player carries no session store). A failed build keeps',
|
|
131
132
|
'serving the last successful generation and reports the error; before',
|
|
132
133
|
'the first successful build the root serves an error/recovery page.',
|
|
133
134
|
'',
|
package/toolchain/manifest.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "animader-toolchain/1",
|
|
3
|
-
"toolchainVersion": "0.
|
|
3
|
+
"toolchainVersion": "0.6.0",
|
|
4
4
|
"target": {
|
|
5
5
|
"os": "darwin",
|
|
6
6
|
"arch": "arm64"
|
|
7
7
|
},
|
|
8
|
-
"createdAt": "2026-11-
|
|
8
|
+
"createdAt": "2026-11-13T23:17:57.521Z",
|
|
9
9
|
"producers": {
|
|
10
10
|
"animader": {
|
|
11
|
-
"version": "0.
|
|
12
|
-
"revision": "
|
|
11
|
+
"version": "0.6.0",
|
|
12
|
+
"revision": "bc34e4050ac75813dac5c6eba71f948d9d473d96"
|
|
13
13
|
},
|
|
14
14
|
"pngine": {
|
|
15
|
-
"version": "4.
|
|
16
|
-
"revision": "
|
|
15
|
+
"version": "4.3.1",
|
|
16
|
+
"revision": "10f7a26362aa471c83ddfdfd43b953d3fcbacf67"
|
|
17
17
|
},
|
|
18
18
|
"pacer": {
|
|
19
19
|
"version": "0.2.0",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"path": "animader/animader.wasm",
|
|
29
29
|
"package": "animader",
|
|
30
30
|
"spec": "animader/wasm",
|
|
31
|
-
"sha256": "
|
|
32
|
-
"bytes":
|
|
31
|
+
"sha256": "22d474da64ec6c64ece9bb574951c4e17e50f6cf6e0ed87839d69d250f586ea5",
|
|
32
|
+
"bytes": 1177425
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "animader/index.js",
|
|
@@ -177,21 +177,21 @@
|
|
|
177
177
|
"path": "pngine.mjs",
|
|
178
178
|
"package": "pngine",
|
|
179
179
|
"spec": "pngine/viewer",
|
|
180
|
-
"sha256": "
|
|
181
|
-
"bytes":
|
|
180
|
+
"sha256": "b7117348bf7500e6831c3be5b3a17bb7b75c574608496f56fcb820b247bde9fe",
|
|
181
|
+
"bytes": 63956
|
|
182
182
|
}
|
|
183
183
|
],
|
|
184
184
|
"pngineCore": {
|
|
185
185
|
"spec": "pngine/core",
|
|
186
|
-
"sha256": "
|
|
187
|
-
"bytes":
|
|
186
|
+
"sha256": "0777b7722c9a96be724ab8a1b1375c8780b616a4dd14c09a32c6205135ace8ee",
|
|
187
|
+
"bytes": 32261
|
|
188
188
|
},
|
|
189
189
|
"tools": {
|
|
190
190
|
"pngineCli": {
|
|
191
191
|
"package": "@pngine/darwin-arm64",
|
|
192
192
|
"file": "bin/pngine",
|
|
193
|
-
"sha256": "
|
|
194
|
-
"bytes":
|
|
193
|
+
"sha256": "4ee656c5c39ce15505054dd827ae0f04e9936867de7f41d34f67a21ff5e205a0",
|
|
194
|
+
"bytes": 4724104
|
|
195
195
|
},
|
|
196
196
|
"pacerCli": {
|
|
197
197
|
"package": "@mr_hugo/pacer-darwin-arm64",
|
|
@@ -204,9 +204,9 @@
|
|
|
204
204
|
"uniformTypeName": {
|
|
205
205
|
"file": "toolchain/uniform-type-name.js",
|
|
206
206
|
"source": "pngine npm/pngine/src/uniform-convert.js",
|
|
207
|
-
"sha256": "
|
|
208
|
-
"bytes":
|
|
207
|
+
"sha256": "a99ae669ad1e306e531a4261eae3403b1b92ed41ea37556cc25ab41f5911037b",
|
|
208
|
+
"bytes": 9018
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
|
-
"digest": "
|
|
211
|
+
"digest": "646d2b186989c2b0a967ee3326de3cf2131da025dee6b7b15bfcabf731851fd7"
|
|
212
212
|
}
|
|
@@ -62,19 +62,32 @@ export function uniformTypeName(tag) {
|
|
|
62
62
|
* block's base. `buffer` is null when the payload names nothing: one minted
|
|
63
63
|
* before the buffer-name block (3.0.1 and earlier), or a buffer the block
|
|
64
64
|
* does not list.
|
|
65
|
-
*
|
|
65
|
+
*
|
|
66
|
+
* A control entry (parseUniformTable marks them) describes with the same key
|
|
67
|
+
* set as every field and `control: true`: type "f32", no buffer — its value
|
|
68
|
+
* reaches the GPU through the frame's own control-inputs write, so no host
|
|
69
|
+
* writeBuffer can name it — offset 0, elemCount 0 (§6.1).
|
|
70
|
+
* @param {Map<string, {bufferId: number, offset: number, size: number, type: number, elemCount: number, control?: boolean, slot?: number}>} uniforms
|
|
66
71
|
* @param {Map<string, {id: number, pool?: number}>} buffers - the buffer-name block
|
|
67
|
-
* @returns {Record<string, {type: string, size: number, buffer: string | null, offset: number, elemCount: number}>}
|
|
72
|
+
* @returns {Record<string, {type: string, size: number, buffer: string | null, offset: number, elemCount: number, control: boolean}>}
|
|
68
73
|
*/
|
|
69
74
|
export function describeUniforms(uniforms, buffers) {
|
|
70
75
|
const nameOf = (id) => {
|
|
71
76
|
for (const [name, b] of buffers) if (id >= b.id && id < b.id + (b.pool || 1)) return name;
|
|
72
77
|
return null;
|
|
73
78
|
};
|
|
74
|
-
/** @type {Record<string, {type: string, size: number, buffer: string | null, offset: number, elemCount: number}>} */
|
|
79
|
+
/** @type {Record<string, {type: string, size: number, buffer: string | null, offset: number, elemCount: number, control: boolean}>} */
|
|
75
80
|
const out = {};
|
|
76
81
|
for (const [name, info] of uniforms) {
|
|
77
|
-
|
|
82
|
+
const control = info.control === true;
|
|
83
|
+
out[name] = {
|
|
84
|
+
type: uniformTypeName(info.type),
|
|
85
|
+
size: info.size,
|
|
86
|
+
buffer: control ? null : nameOf(info.bufferId),
|
|
87
|
+
offset: info.offset,
|
|
88
|
+
elemCount: info.elemCount,
|
|
89
|
+
control,
|
|
90
|
+
};
|
|
78
91
|
}
|
|
79
92
|
return out;
|
|
80
93
|
}
|