@moku-labs/game 0.14.13 → 0.15.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/app/page.d.mts +1 -1
- package/dist/app/page.mjs +2 -2
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/cli.mjs +75 -36
- package/dist/{commands-DAETmK86.d.mts → commands-BynjWVVy.d.mts} +7 -6
- package/dist/control.d.mts +30 -18
- package/dist/control.mjs +2 -2
- package/dist/{define-BASd9ZUh.d.mts → define-Ckj_TMWu.d.mts} +2 -2
- package/dist/{dev-DbHgx-R-.mjs → dev-BNndV-hU.mjs} +4 -4
- package/dist/{headless-cFveciuY.d.mts → headless-B0mH9qYg.d.mts} +1 -1
- package/dist/{index-DedbED3T.d.mts → index-CCiTo1_3.d.mts} +16 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +6 -6
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/project.d.mts +4 -4
- package/dist/project.mjs +1 -1
- package/dist/{run-BbipFRc6.mjs → run-C07NXds7.mjs} +35 -25
- package/dist/{runtime-DoSlRx8X.d.mts → runtime-BV3xv6gx.d.mts} +1 -1
- package/dist/{sources-Cdvb0rOS.mjs → sources-OvHvyeJS.mjs} +1 -1
- package/dist/{src-BEbJ_sSx.mjs → src-CwVzErzN.mjs} +1921 -652
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-GHE4J5Uf.d.mts → types-Bw-qLjFZ.d.mts} +2 -2
- package/dist/{types-C73hbmxi.d.mts → types-CpdkyhaC.d.mts} +4 -4
- package/dist/{types-DngFQJro.d.mts → types-D44EL4gT.d.mts} +2 -2
- package/dist/{types-BGcda5Le.d.mts → types-E2ykwIUO.d.mts} +556 -42
- package/dist/{types-7GXcXxxv.d.mts → types-G3ZAAsbd.d.mts} +20 -1
- package/dist/{visual-_XhoGeIC.d.mts → visual-DoHwXeQi.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +2 -2
- package/dist/{watch-BEdrp80i.mjs → watch-BSgptowj.mjs} +16 -6
- package/llms.txt +6 -4
- package/package.json +1 -1
|
@@ -189,11 +189,16 @@ type ThermalStatus = "none" | "light" | "moderate" | "severe" | "critical" | "em
|
|
|
189
189
|
*
|
|
190
190
|
* @example
|
|
191
191
|
* ```ts
|
|
192
|
-
* app.time.rate(); // { fps: 60, mode: "auto", reason: "missed", displayHz: 120, ladder: [120, 60], thermal: "none" }
|
|
192
|
+
* app.time.rate(); // { fps: 60, mode: "auto", reason: "missed", displayHz: 120, ladder: [120, 60], thermal: "none", asked: null, heldBy: null }
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
195
|
type FrameRate = {
|
|
196
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Frames per second the loop really runs at, the idle cap left out: the cap on the known display. A cap above the
|
|
198
|
+
* display's rate runs at the display's rate (`heldBy: "panel"`); a cap between two vsyncs runs at the next divisor
|
|
199
|
+
* below it (60 on a 144 Hz panel runs at 48). The cap itself while the display is unknown.
|
|
200
|
+
*/
|
|
201
|
+
fps: number; /** Who decides the rate. */
|
|
197
202
|
mode: RateMode; /** Why the rate is what it is. */
|
|
198
203
|
reason: RateReason;
|
|
199
204
|
/**
|
|
@@ -204,6 +209,17 @@ type FrameRate = {
|
|
|
204
209
|
displayHz: number | null; /** The rates the adaptive rule chooses from, highest first; empty until `displayHz` is known, and without `adaptive`. */
|
|
205
210
|
ladder: readonly number[]; /** The native shell's last thermal status; `null` without a shell, before its first reading, and without `adaptive`. */
|
|
206
211
|
thermal: ThermalStatus | null;
|
|
212
|
+
/**
|
|
213
|
+
* The rate the loop is told to hold: `maxFps` in mode `"fixed"`, the `setRate` value in mode `"forced"` (never above
|
|
214
|
+
* `maxFps`); `null` in mode `"auto"`, where the adaptive rule decides.
|
|
215
|
+
*/
|
|
216
|
+
asked: Exclude<RateChoice, "auto"> | null;
|
|
217
|
+
/**
|
|
218
|
+
* `"panel"` when the asked rate is above the known `displayHz` (120 asked on a 60 Hz panel): the loop cannot run
|
|
219
|
+
* faster than the panel, and `fps` is the panel's rate. `null` otherwise, in mode `"auto"` and while the display is
|
|
220
|
+
* unknown.
|
|
221
|
+
*/
|
|
222
|
+
heldBy: "panel" | null;
|
|
207
223
|
};
|
|
208
224
|
/**
|
|
209
225
|
* Payload of `time:rate`: a change of the loop's rate or of its mode, with the evidence the rule read.
|
|
@@ -241,7 +257,12 @@ type FrameMeasure = {
|
|
|
241
257
|
/** `Time.frame` of the measured frame. */frame: number; /** Start of the frame on the page clock (`performance` timeline), ms: the `requestAnimationFrame` timestamp, or the moment `step()` began. */
|
|
242
258
|
at: number; /** `at` minus `at` of the previous measured frame; `NaN` for the first frame, the first after `resume()`, and a stepped frame. */
|
|
243
259
|
gapMs: number; /** `1000 / cap` of this frame: the loop's rate, or `idleFps` while idle. */
|
|
244
|
-
capMs: number;
|
|
260
|
+
capMs: number;
|
|
261
|
+
/**
|
|
262
|
+
* One frame of the cap of the loop's rate in this frame, the idle cap left out: `1000 / time.rate().asked` in mode
|
|
263
|
+
* `"fixed"` and `"forced"`, the adaptive rule's rate in `"auto"`. Equal to `1000 / time.rate().fps` while the cap is
|
|
264
|
+
* a divisor of the display rate.
|
|
265
|
+
*/
|
|
245
266
|
rateMs: number;
|
|
246
267
|
/**
|
|
247
268
|
* One period of the display, `1000 / time.rate().displayHz`, ms; `NaN` until the display rate is known. No frame
|
|
@@ -610,6 +631,24 @@ type Api$7 = {
|
|
|
610
631
|
* ```
|
|
611
632
|
*/
|
|
612
633
|
wakes(): number;
|
|
634
|
+
/**
|
|
635
|
+
* How many `onFrame` callbacks are registered now, over the six phases. The measure listeners of `measure` are not
|
|
636
|
+
* counted. A number, no allocation: a leak check reads it once a second, and a count that grows each time a screen
|
|
637
|
+
* is entered and left is a callback nobody unsubscribed.
|
|
638
|
+
*
|
|
639
|
+
* @returns The count.
|
|
640
|
+
* @example
|
|
641
|
+
* ```ts
|
|
642
|
+
* // The renderer's monitor reads it once a second for the leak counts of a debug build.
|
|
643
|
+
* const time = ctx.require(timePlugin);
|
|
644
|
+
* const before = time.frameListeners();
|
|
645
|
+
* const off = time.onFrame("animate", frame => counter.advance(frame.delta));
|
|
646
|
+
* time.frameListeners() - before; // 1
|
|
647
|
+
* off();
|
|
648
|
+
* time.frameListeners() - before; // 0
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
frameListeners(): number;
|
|
613
652
|
/**
|
|
614
653
|
* Hands what `time` measured of every frame to `listener`, after the `render` phase: the gap, the skipped ticks, the
|
|
615
654
|
* six phase durations and the whole work. Agent builds only (`__MOKU_GAME_AGENT__`, true in dev and `--debug`
|
|
@@ -659,13 +698,18 @@ type Api$7 = {
|
|
|
659
698
|
* adaptive rule chooses from, and the native shell's thermal status. One frozen object, the same until something in
|
|
660
699
|
* it changes: cheap to read every frame.
|
|
661
700
|
*
|
|
701
|
+
* `fps` is the rate the loop really runs at; `asked` the rate it is told to hold outside the adaptive rule, and
|
|
702
|
+
* `heldBy: "panel"` says the panel is slower than that.
|
|
703
|
+
*
|
|
662
704
|
* @returns The frame rate.
|
|
663
705
|
* @example
|
|
664
706
|
* ```ts
|
|
665
707
|
* // The settings screen shows the rate the game runs at on this phone.
|
|
666
|
-
* app.time.rate(); // { fps: 120, mode: "auto", reason: "start", displayHz: 120, ladder: [120, 60], thermal: "none" }
|
|
708
|
+
* app.time.rate(); // { fps: 120, mode: "auto", reason: "start", displayHz: 120, ladder: [120, 60], thermal: "none", asked: null, heldBy: null }
|
|
667
709
|
* // on the memory screen of a weak phone, a second later:
|
|
668
|
-
* app.time.rate(); // { fps: 60, mode: "auto", reason: "missed", displayHz: 120, ladder: [120, 60], thermal: "none" }
|
|
710
|
+
* app.time.rate(); // { fps: 60, mode: "auto", reason: "missed", displayHz: 120, ladder: [120, 60], thermal: "none", asked: null, heldBy: null }
|
|
711
|
+
* // a game with maxFps 120 and no adaptive, on a 60 Hz phone:
|
|
712
|
+
* app.time.rate(); // { fps: 60, mode: "fixed", reason: "start", displayHz: 60, ladder: [], thermal: null, asked: 120, heldBy: "panel" }
|
|
669
713
|
* ```
|
|
670
714
|
*/
|
|
671
715
|
rate(): Readonly<FrameRate>;
|
|
@@ -682,9 +726,11 @@ type Api$7 = {
|
|
|
682
726
|
* @example
|
|
683
727
|
* ```ts
|
|
684
728
|
* // The player picked "60" in the settings to save battery.
|
|
685
|
-
* app.time.setRate(60); // { fps: 60, mode: "forced", reason: "forced", displayHz: 120, ladder: [120, 60], thermal: "none" }
|
|
729
|
+
* app.time.setRate(60); // { fps: 60, mode: "forced", reason: "forced", displayHz: 120, ladder: [120, 60], thermal: "none", asked: 60, heldBy: null }
|
|
686
730
|
* // …and later "Auto" again, on a 120 Hz phone:
|
|
687
|
-
* app.time.setRate("auto"); // { fps: 120, mode: "auto", reason: "auto", displayHz: 120, ladder: [120, 60], thermal: "none" }
|
|
731
|
+
* app.time.setRate("auto"); // { fps: 120, mode: "auto", reason: "auto", displayHz: 120, ladder: [120, 60], thermal: "none", asked: null, heldBy: null }
|
|
732
|
+
* // A pin of 120 on a 60 Hz phone runs at the panel's rate:
|
|
733
|
+
* app.time.setRate(120); // { fps: 60, mode: "forced", reason: "forced", displayHz: 60, ladder: [60], thermal: "none", asked: 120, heldBy: "panel" }
|
|
688
734
|
* ```
|
|
689
735
|
*/
|
|
690
736
|
setRate(choice: RateChoice): Readonly<FrameRate>;
|
|
@@ -1736,6 +1782,40 @@ type Api$4 = {
|
|
|
1736
1782
|
* ```
|
|
1737
1783
|
*/
|
|
1738
1784
|
dueAt(): number | undefined;
|
|
1785
|
+
/**
|
|
1786
|
+
* How many scheduled timers are not yet due. The clock holds one pending moment, so the answer
|
|
1787
|
+
* is 0 or 1: a moment a screen scheduled and never cancelled reads 1 after the screen closed,
|
|
1788
|
+
* where the count was 0 before it opened. It allocates nothing; the renderer's monitor reads it
|
|
1789
|
+
* once a second in a debug build.
|
|
1790
|
+
*
|
|
1791
|
+
* @returns 1 while a moment is scheduled, else 0.
|
|
1792
|
+
* @example
|
|
1793
|
+
* ```ts
|
|
1794
|
+
* app.clock.pending(); // 0
|
|
1795
|
+
* app.clock.scheduleAt(app.clock.now() + 60_000);
|
|
1796
|
+
* app.clock.pending(); // 1
|
|
1797
|
+
* app.clock.scheduleAt(undefined);
|
|
1798
|
+
* app.clock.pending(); // 0
|
|
1799
|
+
* ```
|
|
1800
|
+
*/
|
|
1801
|
+
pending(): number;
|
|
1802
|
+
/**
|
|
1803
|
+
* How many `onElapsed` listeners are registered. A screen that registers one on every visit and
|
|
1804
|
+
* never calls the remover adds one per visit; a screen that cleans up leaves the count where it
|
|
1805
|
+
* was. It allocates nothing; the renderer's monitor reads it once a second in a debug build.
|
|
1806
|
+
*
|
|
1807
|
+
* @returns The number of registered listeners.
|
|
1808
|
+
* @example
|
|
1809
|
+
* ```ts
|
|
1810
|
+
* // A leak check over one visit of the screen that shows the refill timer.
|
|
1811
|
+
* const before = app.clock.listeners();
|
|
1812
|
+
* const off = app.clock.onElapsed(({ now }) => refillTimer.update(now));
|
|
1813
|
+
* app.clock.listeners() - before; // 1
|
|
1814
|
+
* off(); // the screen closed
|
|
1815
|
+
* app.clock.listeners() - before; // 0
|
|
1816
|
+
* ```
|
|
1817
|
+
*/
|
|
1818
|
+
listeners(): number;
|
|
1739
1819
|
};
|
|
1740
1820
|
/**
|
|
1741
1821
|
* Domain context of the clock plugin.
|
|
@@ -5689,6 +5769,24 @@ type EcsApi = {
|
|
|
5689
5769
|
* ```
|
|
5690
5770
|
*/
|
|
5691
5771
|
ownerOf(entity: Entity): Owner | undefined;
|
|
5772
|
+
/**
|
|
5773
|
+
* How many entities live now: every id `spawn` handed out that no despawn took back, the views
|
|
5774
|
+
* of the projections and the layers included. It reads a size the world keeps, so it allocates
|
|
5775
|
+
* nothing and a monitor may call it every second. A screen entered and left returns the count to
|
|
5776
|
+
* where it was; a count that grows with every visit is a leak.
|
|
5777
|
+
*
|
|
5778
|
+
* @returns The number of live entities.
|
|
5779
|
+
* @example
|
|
5780
|
+
* ```ts
|
|
5781
|
+
* // A test that spawns an entity sees it counted until the despawn.
|
|
5782
|
+
* const before = app.world.ecs.count();
|
|
5783
|
+
* const coin = app.world.ecs.spawn({ kind: "plugin", name: "test" }, [Transform({ x: 10 })]);
|
|
5784
|
+
* app.world.ecs.count(); // before + 1
|
|
5785
|
+
* app.world.ecs.despawn(coin);
|
|
5786
|
+
* app.world.ecs.count(); // before
|
|
5787
|
+
* ```
|
|
5788
|
+
*/
|
|
5789
|
+
count(): number;
|
|
5692
5790
|
/**
|
|
5693
5791
|
* The whole world as plain JSON, sorted by entity index. A component value that is not JSON is
|
|
5694
5792
|
* left out and its name is listed in `skipped`.
|
|
@@ -5781,6 +5879,8 @@ type EcsInternal = {
|
|
|
5781
5879
|
//#region src/plugins/world/ecs/systems.d.ts
|
|
5782
5880
|
/**
|
|
5783
5881
|
* Time each world system took in the current frame of an agent build: names by registration index, ms in the same order.
|
|
5882
|
+
* `names` is a new array each time a system of a new name registers and the same array otherwise, so a reader that
|
|
5883
|
+
* kept it sees growth by identity.
|
|
5784
5884
|
*
|
|
5785
5885
|
* @example
|
|
5786
5886
|
* ```ts
|
|
@@ -5789,7 +5889,7 @@ type EcsInternal = {
|
|
|
5789
5889
|
*/
|
|
5790
5890
|
type SystemTiming = {
|
|
5791
5891
|
readonly clock: () => number;
|
|
5792
|
-
|
|
5892
|
+
names: readonly string[];
|
|
5793
5893
|
ms: Float64Array;
|
|
5794
5894
|
};
|
|
5795
5895
|
declare namespace types_d_exports$3 {
|
|
@@ -5858,7 +5958,8 @@ type Api$2 = {
|
|
|
5858
5958
|
*
|
|
5859
5959
|
* A live view, not a copy: the table is the world's own, the same object every call, and the next frame zeroes and
|
|
5860
5960
|
* rewrites `ms` in place. The monitor reads it every frame of an agent build without allocating, which a copy would
|
|
5861
|
-
* break.
|
|
5961
|
+
* break. `names` is replaced by a new array when a system of a new name registers, and only then: a reader that kept
|
|
5962
|
+
* the array tells a new system by `names !== kept`. A caller that keeps numbers past the frame copies them (`[...systems.ms]`); a write into it changes what the
|
|
5862
5963
|
* monitor logs.
|
|
5863
5964
|
*
|
|
5864
5965
|
* @returns The live timing table, or `undefined`.
|
|
@@ -6373,7 +6474,12 @@ type KeptInternal = {
|
|
|
6373
6474
|
stats(): KeptStats; /** The takes since the last call; the monitor's window close. */
|
|
6374
6475
|
drainTakes(): number; /** The stage-3-only redos since the last call. */
|
|
6375
6476
|
drainRefreshes(): number; /** Dev and agent builds only: every record and range drawn live for one extract, and back. */
|
|
6376
|
-
bypass(on: boolean): void;
|
|
6477
|
+
bypass(on: boolean): void;
|
|
6478
|
+
/**
|
|
6479
|
+
* Dev and agent builds only: runs `draw` with every kept record drawn live and every range's entries lifted (its
|
|
6480
|
+
* sprite hidden), then puts every picture back: the live render of the pixel leg and of the overdraw map.
|
|
6481
|
+
*/
|
|
6482
|
+
live<Result>(draw: () => Result): Result; /** The debug switch: false draws every view live from the next drawn frame. */
|
|
6377
6483
|
enabled(on: boolean): void; /** Whether the switch is on (and `keptMb` above 0). */
|
|
6378
6484
|
isOn(): boolean; /** Every record back to live, every texture destroyed: device loss, rebuild, stop. */
|
|
6379
6485
|
reset(): void;
|
|
@@ -6406,7 +6512,12 @@ type KeptRecord = {
|
|
|
6406
6512
|
readonly matrix: PixiMatrix; /** Drawn frames without a stage-1 change (live), stage-1 retakes in a row (kept), and whether calm is needed. */
|
|
6407
6513
|
still: number;
|
|
6408
6514
|
churn: number;
|
|
6409
|
-
calm: boolean;
|
|
6515
|
+
calm: boolean;
|
|
6516
|
+
/**
|
|
6517
|
+
* Drawn frames in a row its subtree did not change (no stage-1 mark), whether it may be kept or not: the monitor's
|
|
6518
|
+
* `filter-still` rule reads it.
|
|
6519
|
+
*/
|
|
6520
|
+
quiet: number; /** Drawn-frame number of the last frame its quad was drawn; the LRU key of P6. */
|
|
6410
6521
|
lastDrawn: number; /** Depth of the top under the stage, for the inner-first order (P5.2). */
|
|
6411
6522
|
depth: number; /** Bytes of s1, s2, s3 (estimate, P6.1). */
|
|
6412
6523
|
bytes: number; /** A settle retake is owed: the view came to rest off its picture's grid (P2.5). */
|
|
@@ -7203,17 +7314,19 @@ type FiltersApi = {
|
|
|
7203
7314
|
warm(filter: PixiFilter): Promise<boolean>;
|
|
7204
7315
|
};
|
|
7205
7316
|
/**
|
|
7206
|
-
* The debug switches of the renderer: the nine-slice outline, the pixel check of skipped frames
|
|
7317
|
+
* The debug switches of the renderer: the nine-slice outline, the pixel check of skipped frames, the kept pictures and
|
|
7318
|
+
* the overdraw heat map.
|
|
7207
7319
|
*
|
|
7208
7320
|
* @example
|
|
7209
7321
|
* ```ts
|
|
7210
|
-
* const switches: DebugSwitches = { nineSlice: true, verifyFrames: false, kept: true };
|
|
7322
|
+
* const switches: DebugSwitches = { nineSlice: true, verifyFrames: false, kept: true, overdraw: false };
|
|
7211
7323
|
* ```
|
|
7212
7324
|
*/
|
|
7213
7325
|
type DebugSwitches = {
|
|
7214
7326
|
nineSlice: boolean;
|
|
7215
7327
|
verifyFrames: boolean;
|
|
7216
7328
|
kept: boolean;
|
|
7329
|
+
overdraw: boolean;
|
|
7217
7330
|
};
|
|
7218
7331
|
/**
|
|
7219
7332
|
* The debug drawing of the renderer, `app.renderer.sync.debug`. The switch outlines every
|
|
@@ -7224,7 +7337,7 @@ type DebugSwitches = {
|
|
|
7224
7337
|
* ```ts
|
|
7225
7338
|
* // Check where every panel of the open popup is cut: cyan lines, red where corners overlap.
|
|
7226
7339
|
* app.renderer.sync.debug.nineSlice(true);
|
|
7227
|
-
* app.renderer.sync.debug.state(); // { nineSlice: true, verifyFrames: false, kept: true }
|
|
7340
|
+
* app.renderer.sync.debug.state(); // { nineSlice: true, verifyFrames: false, kept: true, overdraw: false }
|
|
7228
7341
|
* ```
|
|
7229
7342
|
*/
|
|
7230
7343
|
type DebugApi = {
|
|
@@ -7257,7 +7370,7 @@ type DebugApi = {
|
|
|
7257
7370
|
* ```ts
|
|
7258
7371
|
* // The visual runner checks every stepped frame of a test in the browser.
|
|
7259
7372
|
* app.renderer.sync.debug.verifyFrames(true);
|
|
7260
|
-
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: true, kept: true }
|
|
7373
|
+
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: true, kept: true, overdraw: false }
|
|
7261
7374
|
* ```
|
|
7262
7375
|
*/
|
|
7263
7376
|
verifyFrames(on: boolean): void;
|
|
@@ -7271,10 +7384,29 @@ type DebugApi = {
|
|
|
7271
7384
|
* ```ts
|
|
7272
7385
|
* // The editor's tools page compares the memory screen with and without kept pictures.
|
|
7273
7386
|
* app.renderer.sync.debug.kept(false);
|
|
7274
|
-
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: false, kept: false }
|
|
7387
|
+
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: false, kept: false, overdraw: false }
|
|
7275
7388
|
* ```
|
|
7276
7389
|
*/
|
|
7277
7390
|
kept(on: boolean): void;
|
|
7391
|
+
/**
|
|
7392
|
+
* Draws every frame as the overdraw heat map (true) or as the game (false): a pixel's brightness counts the layers
|
|
7393
|
+
* drawn there, 1/16 white for one, white for sixteen and more. While it is on every frame is drawn (also with
|
|
7394
|
+
* `onDemand`), kept pictures are drawn live and filters are off, so the map shows what a frame would draw without
|
|
7395
|
+
* them; the frames of the performance log are marked (`debug` event, header `debug.overdraw`), so a recording is not
|
|
7396
|
+
* read as real cost. Only the stage pass changes: between frames every view keeps its own alpha, blend mode and
|
|
7397
|
+
* filters, and off draws the game again from the next frame. A texel a texture leaves transparent counts nothing.
|
|
7398
|
+
* Dev and debug builds only; elsewhere the switch stays off.
|
|
7399
|
+
*
|
|
7400
|
+
* @param on - True to draw the heat map.
|
|
7401
|
+
* @example
|
|
7402
|
+
* ```ts
|
|
7403
|
+
* // The editor's Mission control shows where the board stacks its layers: three full-screen backdrops show 3/16 white.
|
|
7404
|
+
* app.renderer.sync.debug.overdraw(true);
|
|
7405
|
+
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: false, kept: true, overdraw: true }
|
|
7406
|
+
* app.renderer.sync.debug.overdraw(false); // the next frame draws the board as before
|
|
7407
|
+
* ```
|
|
7408
|
+
*/
|
|
7409
|
+
overdraw(on: boolean): void;
|
|
7278
7410
|
/**
|
|
7279
7411
|
* What every overlay does this frame, bottom first: its phase, its mode, its level, how many entries its range has
|
|
7280
7412
|
* and whether a picture holds them. The level and the landing are the engine's state of the overlay, read here. For
|
|
@@ -7296,7 +7428,7 @@ type DebugApi = {
|
|
|
7296
7428
|
* @example
|
|
7297
7429
|
* ```ts
|
|
7298
7430
|
* // An e2e test makes sure no outline is drawn before it compares a screenshot.
|
|
7299
|
-
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: false, kept: true }
|
|
7431
|
+
* app.renderer.sync.debug.state(); // { nineSlice: false, verifyFrames: false, kept: true, overdraw: false }
|
|
7300
7432
|
* ```
|
|
7301
7433
|
*/
|
|
7302
7434
|
state(): DebugSwitches;
|
|
@@ -7419,7 +7551,7 @@ type SyncApi = {
|
|
|
7419
7551
|
* ```ts
|
|
7420
7552
|
* // Check where every panel of the open popup is cut: cyan lines, red where corners overlap.
|
|
7421
7553
|
* app.renderer.sync.debug.nineSlice(true);
|
|
7422
|
-
* app.renderer.sync.debug.state(); // { nineSlice: true, verifyFrames: false, kept: true }
|
|
7554
|
+
* app.renderer.sync.debug.state(); // { nineSlice: true, verifyFrames: false, kept: true, overdraw: false }
|
|
7423
7555
|
* ```
|
|
7424
7556
|
*/
|
|
7425
7557
|
debug: DebugApi;
|
|
@@ -7565,6 +7697,27 @@ type SyncInternal = {
|
|
|
7565
7697
|
* @param fn - Called with the probe draws made since the queue last started.
|
|
7566
7698
|
*/
|
|
7567
7699
|
onWarm(fn: WarmListener): void;
|
|
7700
|
+
/**
|
|
7701
|
+
* Whether the overdraw heat map draws: the frame then asks to be drawn, and the stage pass goes through
|
|
7702
|
+
* `drawOverdraw`.
|
|
7703
|
+
*
|
|
7704
|
+
* @returns True while `debug.overdraw` is on.
|
|
7705
|
+
*/
|
|
7706
|
+
overdrawing(): boolean;
|
|
7707
|
+
/**
|
|
7708
|
+
* Draws the stage pass as the overdraw heat map and puts every node back after it (`overdraw.ts`).
|
|
7709
|
+
*
|
|
7710
|
+
* @param render - The stage pass, `host.render`.
|
|
7711
|
+
* @returns What `render` answered.
|
|
7712
|
+
*/
|
|
7713
|
+
drawOverdraw(render: () => boolean): boolean;
|
|
7714
|
+
/**
|
|
7715
|
+
* Subscribes to a move of the overdraw switch (the monitor of an agent build writes the `debug` event line).
|
|
7716
|
+
* Emptied by `stopSync`.
|
|
7717
|
+
*
|
|
7718
|
+
* @param fn - Called with the switch, when it moved.
|
|
7719
|
+
*/
|
|
7720
|
+
onOverdraw(fn: (on: boolean) => void): void;
|
|
7568
7721
|
/**
|
|
7569
7722
|
* Gives the view of an entity its wrapper before the kept cache takes its first picture (spec 23 D4), so the
|
|
7570
7723
|
* picture's root is a plain container; marks nothing, since the wrapper draws the same pixels. The wrapper stays
|
|
@@ -7810,10 +7963,16 @@ type SyncState = {
|
|
|
7810
7963
|
* parent's view (spec 16 U2.4).
|
|
7811
7964
|
*/
|
|
7812
7965
|
orphans: Set<Entity>; /** Entities the tree check of a dev or agent build already reported, so each is reported once (spec 16 U2.5). */
|
|
7813
|
-
mismatched: Set<Entity>;
|
|
7966
|
+
mismatched: Set<Entity>;
|
|
7967
|
+
/**
|
|
7968
|
+
* The nine-slice and overdraw switches, from `config.debug` and `debug.nineSlice` / `debug.overdraw`; the pixel check
|
|
7969
|
+
* lives in `demand`, the kept switch in `kept`.
|
|
7970
|
+
*/
|
|
7814
7971
|
debug: {
|
|
7815
7972
|
nineSlice: boolean;
|
|
7816
|
-
|
|
7973
|
+
overdraw: boolean;
|
|
7974
|
+
}; /** The restore table of the overdraw stage pass, its matrix and the listeners of the switch. */
|
|
7975
|
+
overdraw: OverdrawState; /** The nine-slice switch moved: the next pass writes every nine-slice again. */
|
|
7817
7976
|
outlinesStale: boolean; /** The filters `effects` set per entity, kept while the entity lives, view or not. */
|
|
7818
7977
|
filters: Map<Entity, readonly FilterSlot[]>; /** The filter area `effects` set per entity, kept like its filters (B4). */
|
|
7819
7978
|
areas: Map<Entity, AreaEntry>;
|
|
@@ -7828,7 +7987,12 @@ type SyncState = {
|
|
|
7828
7987
|
* The kind of each Pixi filter a slot named, for the performance log of an agent build; a
|
|
7829
7988
|
* blur's two passes are filters of their own and are in it too. Empty in a production build.
|
|
7830
7989
|
*/
|
|
7831
|
-
filterKinds: WeakMap<object, string>;
|
|
7990
|
+
filterKinds: WeakMap<object, string>;
|
|
7991
|
+
/**
|
|
7992
|
+
* The entity each Pixi filter a slot hangs on (its stages and a blur's pass filters too), for the passes of the
|
|
7993
|
+
* performance log; the slot set last wins. Empty in a production build.
|
|
7994
|
+
*/
|
|
7995
|
+
filterOwners: WeakMap<object, Entity>; /** Hidden masks of engine objects that are no view (an overlay's dim, a kept quad). */
|
|
7832
7996
|
objectHidden: WeakMap<PixiContainer, number>; /** The view whose top (`wrapper ?? object`) a node is, for the hidden masks (O15; skeleton choice, confirmed in LEAD-FIXES-3). */
|
|
7833
7997
|
viewOfTop: WeakMap<PixiContainer, View>; /** The overlays, their ranges, dims and HUD parts (spec 22). */
|
|
7834
7998
|
overlay: OverlayState; /** `Graphics` paths drawn since the monitor last took them: shapes, clip masks, outlines (spec 26 R2.3). */
|
|
@@ -7840,6 +8004,19 @@ type SyncState = {
|
|
|
7840
8004
|
held: Map<Entity, Unseen>;
|
|
7841
8005
|
cleanups: Array<() => void>;
|
|
7842
8006
|
};
|
|
8007
|
+
/**
|
|
8008
|
+
* The overdraw heat map's state: the restore table of one stage pass (a node, its alpha, its blend mode, its filters
|
|
8009
|
+
* or `undefined` for none), the root's own filters, the matrix made once, and who hears a move of the switch.
|
|
8010
|
+
*/
|
|
8011
|
+
type OverdrawState = {
|
|
8012
|
+
nodes: PixiContainer[];
|
|
8013
|
+
alphas: number[];
|
|
8014
|
+
blends: Array<PixiContainer["blendMode"]>;
|
|
8015
|
+
filters: Array<readonly PixiFilter[] | undefined>;
|
|
8016
|
+
rootFilters: readonly PixiFilter[] | undefined;
|
|
8017
|
+
matrix: PixiFilter | undefined;
|
|
8018
|
+
listeners: Array<(on: boolean) => void>;
|
|
8019
|
+
};
|
|
7843
8020
|
//#endregion
|
|
7844
8021
|
//#region src/plugins/renderer/monitor/log-types.d.ts
|
|
7845
8022
|
/**
|
|
@@ -7887,7 +8064,9 @@ type FrameColumns = {
|
|
|
7887
8064
|
fltApplies: Uint16Array;
|
|
7888
8065
|
fltMpx: Float32Array; /** Kept pictures drawn in the frame (spec 23); NaN before attach. */
|
|
7889
8066
|
kept: Float32Array; /** Kept pictures and range pictures taken in the frame; refreshes go to the per-second count only. */
|
|
7890
|
-
retakes: Float32Array;
|
|
8067
|
+
retakes: Float32Array; /** Render targets Pixi created in the frame (WebGPU, counted on the texture system); NaN where not counted. */
|
|
8068
|
+
targetsCreated: Float32Array; /** Render targets Pixi destroyed in the frame (a pool trim, a resize); NaN where not counted. */
|
|
8069
|
+
targetsDestroyed: Float32Array;
|
|
7891
8070
|
};
|
|
7892
8071
|
/**
|
|
7893
8072
|
* What `read` did: one object owned by the ring, rewritten by every call (copy the numbers you keep).
|
|
@@ -7919,6 +8098,11 @@ type FrameReadout = Partial<FrameColumns> & {
|
|
|
7919
8098
|
* ```ts
|
|
7920
8099
|
* const ring = app.renderer.monitor.frames();
|
|
7921
8100
|
* ring.size; // 1024 after nine seconds at 120 fps; 0 in a production build
|
|
8101
|
+
* // The filter of the newest pass, from the pass ring: `kind2` is 1-based, 0 is "no filter".
|
|
8102
|
+
* const kind2 = ring.passes.kind2[ring.passes.newest] ?? 0; // 2
|
|
8103
|
+
* kind2 === 0 ? null : ring.kindNames[kind2 - 1]; // "fog.blur"
|
|
8104
|
+
* // The world systems the `sysIdx` column indexes; a new system makes a new array.
|
|
8105
|
+
* ring.systemNames[ring.columns.sysIdx[ring.newest * 5] ?? 0]; // "board.looks"
|
|
7922
8106
|
* ```
|
|
7923
8107
|
*/
|
|
7924
8108
|
type FrameRing = {
|
|
@@ -7939,9 +8123,20 @@ type FrameRing = {
|
|
|
7939
8123
|
width: Uint16Array;
|
|
7940
8124
|
height: Uint16Array;
|
|
7941
8125
|
gpuMs: Float32Array; /** Pre-sized; references, never copies. */
|
|
7942
|
-
label: (string | null)[];
|
|
8126
|
+
label: (string | null)[]; /** The entity whose filter drew the pass; 0 for none (the canvas, a texture pass, a filter no view hangs). */
|
|
8127
|
+
owner: Uint32Array; /** The filter kind of a filter pass, 1-based into `kindNames` (`kindNames[kind2 - 1]`); 0 for none. */
|
|
8128
|
+
kind2: Uint8Array; /** The draw count of the frame when the pass began: a pass drew up to the next one's (WebGPU; 0 on WebGL). */
|
|
8129
|
+
drawsAt: Uint16Array; /** The target's texture format (`"rgba8unorm"`), by reference; `null` when unknown. */
|
|
8130
|
+
format: (string | null)[]; /** The target's resolution; NaN when unknown. */
|
|
8131
|
+
resolution: Float32Array;
|
|
7943
8132
|
}; /** Path id → flow path. */
|
|
7944
8133
|
readonly paths: readonly string[];
|
|
8134
|
+
/**
|
|
8135
|
+
* The interned filter kinds, `"other"` first: `fltKind` and the passes' `kind2` index it 1-based
|
|
8136
|
+
* (`kindNames[kind - 1]`), 0 is none. It only grows, at most 32 names.
|
|
8137
|
+
*/
|
|
8138
|
+
readonly kindNames: readonly string[]; /** The world's system names by registration index (`sysIdx`); a registration makes a new array. */
|
|
8139
|
+
readonly systemNames: readonly string[];
|
|
7945
8140
|
/**
|
|
7946
8141
|
* Copies the frames committed after the cursor `since` (a `written` value read earlier), oldest first, into the
|
|
7947
8142
|
* columns `into` provides (`phaseMs` takes 6 values a frame), at most `into.length` of the newest of them. Allocates
|
|
@@ -7977,7 +8172,7 @@ type PerfLine<Kind extends string> = {
|
|
|
7977
8172
|
/**
|
|
7978
8173
|
* What an agent build could measure on this page; the header lists it.
|
|
7979
8174
|
*/
|
|
7980
|
-
type PerfMeasured = "gpu" | "passes" | "stencilPasses" | "draws" | "filters" | "uploads" | "compiles" | "marks" | "rebuilds" | "longFrames" | "heap" | "systems" | "kept";
|
|
8175
|
+
type PerfMeasured = "gpu" | "passes" | "stencilPasses" | "draws" | "filters" | "uploads" | "compiles" | "marks" | "rebuilds" | "longFrames" | "heap" | "systems" | "kept" | "targets";
|
|
7981
8176
|
/**
|
|
7982
8177
|
* What the screen is: in the header and in every `display` event.
|
|
7983
8178
|
*/
|
|
@@ -8044,6 +8239,21 @@ type PerfHeaderLine = PerfLine<"header"> & {
|
|
|
8044
8239
|
frames: number;
|
|
8045
8240
|
};
|
|
8046
8241
|
measured: readonly PerfMeasured[];
|
|
8242
|
+
/**
|
|
8243
|
+
* The bundle identifier of the app, `"com.mokulabs.timber.debug"` in a native debug build (`__MOKU_GAME_APP__`), so a
|
|
8244
|
+
* device stream pairs with its project; `null` on a page without one. The engine always writes it; optional for a
|
|
8245
|
+
* reader of an older log.
|
|
8246
|
+
*/
|
|
8247
|
+
app?: {
|
|
8248
|
+
id: string | null;
|
|
8249
|
+
};
|
|
8250
|
+
/**
|
|
8251
|
+
* The debug drawing at the moment of the header: `overdraw` true while the overdraw heat map draws, so the frames that
|
|
8252
|
+
* follow are not read as real cost (a `debug` event marks a switch later). Optional for a reader of an older log.
|
|
8253
|
+
*/
|
|
8254
|
+
debug?: {
|
|
8255
|
+
overdraw: boolean;
|
|
8256
|
+
};
|
|
8047
8257
|
};
|
|
8048
8258
|
/**
|
|
8049
8259
|
* One Long Animation Frame (or long task) of the page.
|
|
@@ -8102,6 +8312,28 @@ type MeanMax = {
|
|
|
8102
8312
|
mean: number;
|
|
8103
8313
|
max: number;
|
|
8104
8314
|
};
|
|
8315
|
+
/**
|
|
8316
|
+
* The live object counts of a sample, read once a second: a count that grows each time a screen is entered and left
|
|
8317
|
+
* is a leak. `entities` are the world's live entities, `views` the display objects `sync` holds, `timers` the clock's
|
|
8318
|
+
* scheduled moments not yet due, `frameListeners` the `time.onFrame` callbacks, `clockListeners` the `clock.onElapsed`
|
|
8319
|
+
* listeners; every count a plugin registered through `monitor.counts.register` sits beside them by its name
|
|
8320
|
+
* (`inputListeners`).
|
|
8321
|
+
*
|
|
8322
|
+
* @example
|
|
8323
|
+
* ```ts
|
|
8324
|
+
* const counts: PerfCounts = {
|
|
8325
|
+
* entities: 412, views: 180, timers: 1, frameListeners: 9, clockListeners: 2, inputListeners: 6
|
|
8326
|
+
* };
|
|
8327
|
+
* ```
|
|
8328
|
+
*/
|
|
8329
|
+
type PerfCounts = {
|
|
8330
|
+
readonly entities: number;
|
|
8331
|
+
readonly views: number;
|
|
8332
|
+
readonly timers: number;
|
|
8333
|
+
readonly frameListeners: number;
|
|
8334
|
+
readonly clockListeners: number;
|
|
8335
|
+
readonly [registered: string]: number;
|
|
8336
|
+
};
|
|
8105
8337
|
/**
|
|
8106
8338
|
* One second of frames.
|
|
8107
8339
|
*/
|
|
@@ -8184,7 +8416,16 @@ type PerfSampleLine = PerfLine<"sample"> & {
|
|
|
8184
8416
|
pooled: number;
|
|
8185
8417
|
resolution: number;
|
|
8186
8418
|
monitorMs: number;
|
|
8187
|
-
spikes: number;
|
|
8419
|
+
spikes: number; /** The live object counts of the moment (U3); optional for a reader of an older log. */
|
|
8420
|
+
counts?: PerfCounts;
|
|
8421
|
+
/**
|
|
8422
|
+
* Render targets Pixi created and destroyed in the second (WebGPU); `null` where they are not counted. Not the
|
|
8423
|
+
* texture memory of `textures.targets`. Optional for a reader of an older log.
|
|
8424
|
+
*/
|
|
8425
|
+
targets?: {
|
|
8426
|
+
created: number;
|
|
8427
|
+
destroyed: number;
|
|
8428
|
+
} | null;
|
|
8188
8429
|
};
|
|
8189
8430
|
/**
|
|
8190
8431
|
* Why a frame is a spike: a rule (`gap`, `js`, `gpu`) or an annotation of a spike. `compile` is a compile in the frame or,
|
|
@@ -8279,7 +8520,8 @@ type FrameRecord = {
|
|
|
8279
8520
|
*/
|
|
8280
8521
|
type PassKind = "canvas" | "texture" | "filter";
|
|
8281
8522
|
/**
|
|
8282
|
-
* One render pass of a spike frame.
|
|
8523
|
+
* One render pass of a spike frame. The fields after `gpuMs` came with the 0.15 telemetry; a reader of an older log
|
|
8524
|
+
* finds them absent.
|
|
8283
8525
|
*/
|
|
8284
8526
|
type PassRecord = {
|
|
8285
8527
|
index: number;
|
|
@@ -8288,7 +8530,14 @@ type PassRecord = {
|
|
|
8288
8530
|
stencil: boolean | null;
|
|
8289
8531
|
w: number;
|
|
8290
8532
|
h: number;
|
|
8291
|
-
gpuMs: number | null;
|
|
8533
|
+
gpuMs: number | null; /** The entity whose filter drew the pass; `null` for the canvas, a texture pass and a filter no view hangs. */
|
|
8534
|
+
owner?: Entity | null; /** The label of the owner's view when the line was built; `null` without an owner or once the view left. */
|
|
8535
|
+
view?: string | null; /** The kind id of the filter that drew it (`"fog.blur"`), `"other"` for a filter without one; `null` otherwise. */
|
|
8536
|
+
filter?: string | null; /** The draws issued in the pass (WebGPU); `null` where draws are not counted. */
|
|
8537
|
+
draws?: number | null; /** The target's texture format; `null` when unknown. */
|
|
8538
|
+
format?: string | null; /** The target's resolution; `null` when unknown. */
|
|
8539
|
+
resolution?: number | null; /** The pass took or refreshed a kept picture (its label starts with `kept:`). */
|
|
8540
|
+
kept?: boolean;
|
|
8292
8541
|
};
|
|
8293
8542
|
/**
|
|
8294
8543
|
* A frame over the budget, with its detail.
|
|
@@ -8322,7 +8571,7 @@ type PerfLongFrameLine = PerfLine<"longFrame"> & LongFrameEntry & {
|
|
|
8322
8571
|
* it on the 2b debug build; `"pool-trim"` is the pool trim of spec 25, detail `PoolTrimDetail`; `"warm"` is the end of
|
|
8323
8572
|
* a pipeline warm-up run of spec 27, detail `WarmDetail`).
|
|
8324
8573
|
*/
|
|
8325
|
-
type PerfEventName = "scene" | "overlay" | "bundle" | "compile" | "upload" | "resolution" | "device-lost" | "device-restored" | "pause" | "resume" | "switch" | "display" | "command" | "recorder" | "rate" | "devtools" | "pool-trim" | "warm";
|
|
8574
|
+
type PerfEventName = "scene" | "overlay" | "bundle" | "compile" | "upload" | "resolution" | "device-lost" | "device-restored" | "pause" | "resume" | "switch" | "display" | "command" | "recorder" | "rate" | "devtools" | "pool-trim" | "warm" | "shader" | "problem" | "debug";
|
|
8326
8575
|
/**
|
|
8327
8576
|
* What an `overlay` event line says happened to an overlay (spec 22 O10.2): it opened, landed (its enter motion is
|
|
8328
8577
|
* over), started to leave, is gone, or its range went live or was kept again (the live fallback).
|
|
@@ -8375,6 +8624,113 @@ type PoolTrimDetail = {
|
|
|
8375
8624
|
type WarmDetail = {
|
|
8376
8625
|
draws: number;
|
|
8377
8626
|
};
|
|
8627
|
+
/**
|
|
8628
|
+
* What a `shader` event line reports, in its `what`: a render pipeline (WebGPU) or a program (WebGL) created, or a
|
|
8629
|
+
* WebGPU shader module compiled. New values are only ever appended.
|
|
8630
|
+
*
|
|
8631
|
+
* @example
|
|
8632
|
+
* ```ts
|
|
8633
|
+
* // The editor counts the pipelines of a recording without a switch over strings it does not know.
|
|
8634
|
+
* const pipelines = lines.filter(line => line.kind === "event" && line.name === "shader" && line.detail.what === SHADER_WHATS[0]).length; // 14
|
|
8635
|
+
* ```
|
|
8636
|
+
*/
|
|
8637
|
+
declare const SHADER_WHATS: readonly ["compile", "module"];
|
|
8638
|
+
/**
|
|
8639
|
+
* One value of `SHADER_WHATS`.
|
|
8640
|
+
*
|
|
8641
|
+
* @example
|
|
8642
|
+
* ```ts
|
|
8643
|
+
* const what: ShaderWhat = "module";
|
|
8644
|
+
* ```
|
|
8645
|
+
*/
|
|
8646
|
+
type ShaderWhat = (typeof SHADER_WHATS)[number];
|
|
8647
|
+
/**
|
|
8648
|
+
* The detail of a `shader` event line: one pipeline or program created, or one shader module compiled, in the frame
|
|
8649
|
+
* `frame`, written at the flush of its second. `boot` is true up to the first drawn frame (the warm-up and the first
|
|
8650
|
+
* screen); `during` names where it happened: the index of the pass of the frame, and the filter, its entity and the
|
|
8651
|
+
* label of that entity's view when a filter was applying. A compile of a plain batch has no filter: `owner: null`.
|
|
8652
|
+
*
|
|
8653
|
+
* @example
|
|
8654
|
+
* ```ts
|
|
8655
|
+
* // The fog blur of the memory screen compiled its pipeline while it applied on the board's fog layer.
|
|
8656
|
+
* const detail: ShaderEventDetail = {
|
|
8657
|
+
* what: "compile", label: "PIXI Pipeline (blur-pass-filter)", ms: 4.2, frame: 1824, boot: false,
|
|
8658
|
+
* during: { pass: 2, filter: "fog.blur", owner: 1_048_601, view: "Sprite#1048601 board.fog:fog" }
|
|
8659
|
+
* };
|
|
8660
|
+
* ```
|
|
8661
|
+
*/
|
|
8662
|
+
type ShaderEventDetail = {
|
|
8663
|
+
what: ShaderWhat;
|
|
8664
|
+
label: string | null;
|
|
8665
|
+
ms: number;
|
|
8666
|
+
frame: number;
|
|
8667
|
+
boot: boolean;
|
|
8668
|
+
during: {
|
|
8669
|
+
pass: number | null;
|
|
8670
|
+
filter: string | null;
|
|
8671
|
+
owner: Entity | null;
|
|
8672
|
+
view: string | null;
|
|
8673
|
+
};
|
|
8674
|
+
};
|
|
8675
|
+
/**
|
|
8676
|
+
* The rules of the `problem` event lines, judged once a second: `filter-still` (a filtered view stood still and was
|
|
8677
|
+
* filtered again in every drawn frame), `target-churn` (render targets made and dropped all the time, or right after a
|
|
8678
|
+
* pool trim, or while idle), `retakes` (a kept view taken again and again). New rules are only ever appended.
|
|
8679
|
+
*
|
|
8680
|
+
* @example
|
|
8681
|
+
* ```ts
|
|
8682
|
+
* // The editor reads the rule of the first problem a recording opened: a fog blur filtered again on a still board.
|
|
8683
|
+
* const problems = lines.filter((line): line is PerfEventLine => line.kind === "event" && line.name === "problem");
|
|
8684
|
+
* const opened = problems.find(line => line.detail.cleared !== true);
|
|
8685
|
+
* PROBLEM_RULES.find(rule => rule === opened?.detail.rule); // "filter-still"
|
|
8686
|
+
* ```
|
|
8687
|
+
*/
|
|
8688
|
+
declare const PROBLEM_RULES: readonly ["filter-still", "target-churn", "retakes"];
|
|
8689
|
+
/**
|
|
8690
|
+
* One value of `PROBLEM_RULES`.
|
|
8691
|
+
*
|
|
8692
|
+
* @example
|
|
8693
|
+
* ```ts
|
|
8694
|
+
* const rule: ProblemRule = "target-churn";
|
|
8695
|
+
* ```
|
|
8696
|
+
*/
|
|
8697
|
+
type ProblemRule = (typeof PROBLEM_RULES)[number];
|
|
8698
|
+
/**
|
|
8699
|
+
* The detail of a `problem` event line: a rule crossed its threshold. Written once per crossing; the line with
|
|
8700
|
+
* `cleared: true` follows when the condition stops. `value` is in the rule's unit (still frames, targets made and
|
|
8701
|
+
* dropped per second, takes in two seconds), `since` the frame the run began, `frames` the frames it covers. `reason`
|
|
8702
|
+
* says why a still filtered view is not kept (`"budget"`: its take was refused for the kept budget, `"not-eligible"`:
|
|
8703
|
+
* the kept policy may not keep it) and which clause of `target-churn` fired (`"rate"`, `"idle"`, `"after-trim"`).
|
|
8704
|
+
*
|
|
8705
|
+
* @example
|
|
8706
|
+
* ```ts
|
|
8707
|
+
* // The fog of the board is blurred again in every frame of a still screen: the budget refused its picture.
|
|
8708
|
+
* const opened: ProblemEventDetail = {
|
|
8709
|
+
* rule: "filter-still", severity: "warn", owner: 1_048_601, view: "Sprite#1048601 board.fog:fog",
|
|
8710
|
+
* filter: "fog.blur", value: 75, threshold: 60, since: 1700, frames: 75, reason: "budget"
|
|
8711
|
+
* };
|
|
8712
|
+
* const closed: ProblemEventDetail = {
|
|
8713
|
+
* rule: "filter-still", cleared: true, owner: 1_048_601, view: "Sprite#1048601 board.fog:fog"
|
|
8714
|
+
* };
|
|
8715
|
+
* ```
|
|
8716
|
+
*/
|
|
8717
|
+
type ProblemEventDetail = {
|
|
8718
|
+
rule: ProblemRule;
|
|
8719
|
+
severity: "info" | "warn";
|
|
8720
|
+
owner: Entity | null;
|
|
8721
|
+
view: string | null;
|
|
8722
|
+
filter: string | null;
|
|
8723
|
+
value: number;
|
|
8724
|
+
threshold: number;
|
|
8725
|
+
since: number;
|
|
8726
|
+
frames: number;
|
|
8727
|
+
reason?: "budget" | "not-eligible" | "rate" | "idle" | "after-trim";
|
|
8728
|
+
} | {
|
|
8729
|
+
rule: ProblemRule;
|
|
8730
|
+
cleared: true;
|
|
8731
|
+
owner: Entity | null;
|
|
8732
|
+
view: string | null;
|
|
8733
|
+
};
|
|
8378
8734
|
/**
|
|
8379
8735
|
* Something that happened, at the frame it happened in.
|
|
8380
8736
|
*/
|
|
@@ -8417,6 +8773,30 @@ type PerfCollectorLine = PerfLine<"gfx"> & {
|
|
|
8417
8773
|
p99: number;
|
|
8418
8774
|
hist: Readonly<Record<string, number>>;
|
|
8419
8775
|
};
|
|
8776
|
+
/**
|
|
8777
|
+
* A line the editor's collector writes into the computer's copy of a device log for lines the device lost before it
|
|
8778
|
+
* sent them; the engine never produces it.
|
|
8779
|
+
*/
|
|
8780
|
+
type PerfGapLine = PerfLine<"gap"> & {
|
|
8781
|
+
/** Computer epoch ms at receipt. */rx: number;
|
|
8782
|
+
device: string | null; /** Lines lost. */
|
|
8783
|
+
lines: number;
|
|
8784
|
+
};
|
|
8785
|
+
/**
|
|
8786
|
+
* A line of wired device telemetry (GPU clock and load, CPU and memory per process, heap samples) the editor's
|
|
8787
|
+
* collector writes into the computer's copy of a device log while it records; the engine never produces it. The
|
|
8788
|
+
* readings are the editor's `DeviceTelemetry` fields as it defines them: the engine passes them as JSON.
|
|
8789
|
+
*/
|
|
8790
|
+
type PerfTelemetryLine = PerfLine<"telemetry"> & {
|
|
8791
|
+
/** Computer epoch ms at receipt. */rx: number;
|
|
8792
|
+
device: string;
|
|
8793
|
+
serial: string | null;
|
|
8794
|
+
wired: boolean;
|
|
8795
|
+
gpu: Json;
|
|
8796
|
+
cpu: Json;
|
|
8797
|
+
memory: Json;
|
|
8798
|
+
heap: Json;
|
|
8799
|
+
};
|
|
8420
8800
|
/**
|
|
8421
8801
|
* One line of the performance log.
|
|
8422
8802
|
*
|
|
@@ -8425,7 +8805,7 @@ type PerfCollectorLine = PerfLine<"gfx"> & {
|
|
|
8425
8805
|
* const off = app.renderer.monitor.stream((line: PerfLogLine) => lines.push(line));
|
|
8426
8806
|
* ```
|
|
8427
8807
|
*/
|
|
8428
|
-
type PerfLogLine = PerfHeaderLine | PerfStartupLine | PerfSampleLine | PerfSpikeLine | PerfLongFrameLine | PerfEventLine | PerfMarkLine | PerfThermalLine | PerfCollectorLine;
|
|
8808
|
+
type PerfLogLine = PerfHeaderLine | PerfStartupLine | PerfSampleLine | PerfSpikeLine | PerfLongFrameLine | PerfEventLine | PerfMarkLine | PerfThermalLine | PerfCollectorLine | PerfGapLine | PerfTelemetryLine;
|
|
8429
8809
|
//#endregion
|
|
8430
8810
|
//#region src/plugins/renderer/host/resolution.d.ts
|
|
8431
8811
|
/**
|
|
@@ -8930,6 +9310,11 @@ type RenderStats = {
|
|
|
8930
9310
|
* rebuilds at its start and its end. Dev and debug builds only.
|
|
8931
9311
|
*/
|
|
8932
9312
|
rebuilds?: number;
|
|
9313
|
+
/**
|
|
9314
|
+
* The live object counts of the moment, the same the performance log samples once a second: entities, views, the
|
|
9315
|
+
* clock's timers and listeners, the frame callbacks and every count a plugin registered. Agent builds only.
|
|
9316
|
+
*/
|
|
9317
|
+
counts?: PerfCounts;
|
|
8933
9318
|
};
|
|
8934
9319
|
/**
|
|
8935
9320
|
* The draw-call counter of a dev build: the draws of the frame being drawn and of the last one.
|
|
@@ -8952,23 +9337,40 @@ type CountingClasses = {
|
|
|
8952
9337
|
glTexture: PixiModule["GlTextureSystem"];
|
|
8953
9338
|
};
|
|
8954
9339
|
/**
|
|
8955
|
-
* One pipeline or program compile a wrapper saw: its frame, its label (by reference)
|
|
8956
|
-
* time of the creation call. Not public.
|
|
9340
|
+
* One pipeline or program compile, or one shader module, a wrapper saw: its frame, its label (by reference), the CPU
|
|
9341
|
+
* time of the creation call, and where it happened: the pass of the frame, the filter kind and its owner. Not public.
|
|
8957
9342
|
*/
|
|
8958
9343
|
type CompileRecord = {
|
|
8959
9344
|
frame: number;
|
|
8960
9345
|
label: string | null;
|
|
8961
|
-
ms: number;
|
|
9346
|
+
ms: number; /** A WebGPU shader module, not a pipeline: not a compile of the frame's count. */
|
|
9347
|
+
module: boolean; /** The index of the pass of the frame it happened in; -1 before the first pass or outside a frame. */
|
|
9348
|
+
pass: number; /** The interned kind of the filter applying then, 1-based; 0 without a filter. */
|
|
9349
|
+
kind: number; /** The entity whose filter applied then; 0 without one. */
|
|
9350
|
+
owner: number;
|
|
8962
9351
|
};
|
|
8963
9352
|
/**
|
|
8964
|
-
* The last 64 compiles, in pre-made records written in turn,
|
|
8965
|
-
*
|
|
9353
|
+
* The last 64 compiles and shader modules, in pre-made records written in turn, the shader modules counted for the
|
|
9354
|
+
* header, and how many records were ever written and sent as `shader` events. Not public.
|
|
8966
9355
|
*/
|
|
8967
9356
|
type CompileRing = {
|
|
8968
9357
|
records: CompileRecord[];
|
|
8969
9358
|
next: number;
|
|
8970
9359
|
size: number;
|
|
8971
|
-
shaderModules: number;
|
|
9360
|
+
shaderModules: number; /** Records ever written. */
|
|
9361
|
+
written: number; /** Records sent as `shader` events: the ones from `sent` to `written` wait for a flush with a listener. */
|
|
9362
|
+
sent: number;
|
|
9363
|
+
};
|
|
9364
|
+
/**
|
|
9365
|
+
* The owners of the filter applies of a frame, in a fixed table: the entity, its applies and pixels of the frame
|
|
9366
|
+
* (zeroed in `begin()`) and the kind of its last apply. A slot stays while its owner applies. The entities are held in
|
|
9367
|
+
* a `Float64Array`, exact for every entity, read with `cellF64` like the applies and pixels beside them. Not public.
|
|
9368
|
+
*/
|
|
9369
|
+
type OwnerTable = {
|
|
9370
|
+
ids: Float64Array;
|
|
9371
|
+
applies: Float64Array;
|
|
9372
|
+
pixels: Float64Array;
|
|
9373
|
+
kinds: Uint8Array;
|
|
8972
9374
|
};
|
|
8973
9375
|
/**
|
|
8974
9376
|
* A render target as the pass rules read it: the public fields of Pixi's `RenderTarget`. Not
|
|
@@ -8981,6 +9383,10 @@ type PassTarget = {
|
|
|
8981
9383
|
readonly label?: string | undefined;
|
|
8982
9384
|
readonly colorTexture?: {
|
|
8983
9385
|
readonly label?: string | undefined;
|
|
9386
|
+
readonly source?: {
|
|
9387
|
+
readonly format?: string;
|
|
9388
|
+
readonly resolution?: number;
|
|
9389
|
+
} | undefined;
|
|
8984
9390
|
} | undefined;
|
|
8985
9391
|
};
|
|
8986
9392
|
/**
|
|
@@ -9015,7 +9421,10 @@ type MonitorSinks = {
|
|
|
9015
9421
|
kindNames: string[]; /** Applies of each kind in this frame, zeroed in `begin()`. */
|
|
9016
9422
|
kindApplies: Float64Array; /** Pixels of each kind in this frame, zeroed in `begin()`. */
|
|
9017
9423
|
kindPixels: Float64Array; /** The kind of each Pixi filter, `SyncState.filterKinds`, handed over at attach. */
|
|
9018
|
-
filterKinds: WeakMap<object, string> | undefined;
|
|
9424
|
+
filterKinds: WeakMap<object, string> | undefined; /** The entity each Pixi filter hangs on, `SyncState.filterOwners`, handed over at attach. */
|
|
9425
|
+
filterOwners: WeakMap<object, number> | undefined; /** The entity of the apply running now (0 = none); names the owner of a filter pass. */
|
|
9426
|
+
filterOwner: number; /** The owners of this frame's filter applies (agent builds). */
|
|
9427
|
+
owners: OwnerTable;
|
|
9019
9428
|
compiles: CompileRing; /** The WebGPU pass sink, set at attach. */
|
|
9020
9429
|
passes: PassSink | undefined; /** A pass counter runs (F8): the counting encoder exists, or the WebGL runner items are subscribed. */
|
|
9021
9430
|
measuring: boolean; /** Pixi's instruction rebuilds since the monitor last took them, in a frame or between frames (spec 26 R2.3). */
|
|
@@ -9037,6 +9446,11 @@ type RingPasses = {
|
|
|
9037
9446
|
height: Uint16Array;
|
|
9038
9447
|
gpuMs: Float32Array;
|
|
9039
9448
|
label: (string | null)[];
|
|
9449
|
+
owner: Uint32Array;
|
|
9450
|
+
kind2: Uint8Array;
|
|
9451
|
+
drawsAt: Uint16Array;
|
|
9452
|
+
format: (string | null)[];
|
|
9453
|
+
resolution: Float32Array;
|
|
9040
9454
|
};
|
|
9041
9455
|
/**
|
|
9042
9456
|
* The last 64 changes of a frame that had a subject: a scene switched to, a bundle loaded. Not
|
|
@@ -9060,7 +9474,7 @@ type PerfRing = {
|
|
|
9060
9474
|
written: number;
|
|
9061
9475
|
columns: FrameColumns;
|
|
9062
9476
|
passes: RingPasses;
|
|
9063
|
-
paths: string[]; /** Interned filter kind names, the sinks' list: `fltKind − 1`
|
|
9477
|
+
paths: string[]; /** Interned filter kind names, the sinks' list: `fltKind − 1` and `passes.kind2 − 1` index it. */
|
|
9064
9478
|
kindNames: readonly string[]; /** The world's system names by registration index: `sysIdx` indexes it. */
|
|
9065
9479
|
systemNames: readonly string[]; /** The subjects of the changes of recent frames. */
|
|
9066
9480
|
events: EventRing; /** The one answer `read` rewrites. */
|
|
@@ -9128,6 +9542,50 @@ type TickEstimate = {
|
|
|
9128
9542
|
next: number; /** `[0]`: the period of the display rate the median snaps to, ms; NaN while it snaps to none. */
|
|
9129
9543
|
periodMs: Float64Array;
|
|
9130
9544
|
};
|
|
9545
|
+
/**
|
|
9546
|
+
* The counts plugins registered with `monitor.counts.register`, in a table of `COUNT_SLOTS` read once a second. Not
|
|
9547
|
+
* public.
|
|
9548
|
+
*/
|
|
9549
|
+
type CountTable = {
|
|
9550
|
+
names: string[];
|
|
9551
|
+
reads: Array<() => number>; /** Readers that threw once and were warned about. */
|
|
9552
|
+
failed: Set<string>;
|
|
9553
|
+
};
|
|
9554
|
+
/**
|
|
9555
|
+
* The thresholds of the problem rules, from `renderer.monitor`, defaults filled in. Not public.
|
|
9556
|
+
*/
|
|
9557
|
+
type ProblemThresholds = {
|
|
9558
|
+
stillFrames: number;
|
|
9559
|
+
stillMpx: number;
|
|
9560
|
+
churnPerSecond: number;
|
|
9561
|
+
churnSeconds: number;
|
|
9562
|
+
churnAfterTrimMs: number;
|
|
9563
|
+
};
|
|
9564
|
+
/**
|
|
9565
|
+
* The accumulators of the problem rules: per owner of a filter (the slots of `MonitorSinks.owners`) the drawn frames
|
|
9566
|
+
* in a row it applied in, the frame that run began, its applies and pixels of the second; the render targets of the
|
|
9567
|
+
* second and its churn seconds in a row; the takes of each kept record two flushes back; and the problems open now.
|
|
9568
|
+
* Not public.
|
|
9569
|
+
*/
|
|
9570
|
+
type ProblemState = {
|
|
9571
|
+
thresholds: ProblemThresholds;
|
|
9572
|
+
run: Float64Array;
|
|
9573
|
+
runSince: Float64Array;
|
|
9574
|
+
secFrames: Float64Array;
|
|
9575
|
+
secPixels: Float64Array; /** 1 while the `filter-still` problem of the owner in that slot is open. */
|
|
9576
|
+
stillOpen: Uint8Array; /** Render targets made and dropped this second. */
|
|
9577
|
+
secTargets: number; /** A create in an idle frame, this second. */
|
|
9578
|
+
idleCreate: boolean; /** A create within `churnAfterTrimMs` after a pool trim, this second. */
|
|
9579
|
+
trimCreate: boolean; /** The frame of the first such create of the second. */
|
|
9580
|
+
createFrame: number; /** Page clock of the last pool trim; NaN before one. */
|
|
9581
|
+
trimAt: number; /** Seconds in a row with `churnPerSecond` or more targets made and dropped, and the frame the run began. */
|
|
9582
|
+
churnRun: number;
|
|
9583
|
+
churnSince: number;
|
|
9584
|
+
churnOpen: boolean; /** The stage-1 takes (`s1Version`) of each kept record at the last two flushes, newest first. */
|
|
9585
|
+
takes: [Map<number, number>, Map<number, number>]; /** The frame of each of those two flushes. */
|
|
9586
|
+
takesFrame: [number, number]; /** The owners with an open `retakes` problem. */
|
|
9587
|
+
retakesOpen: Set<number>;
|
|
9588
|
+
};
|
|
9131
9589
|
/**
|
|
9132
9590
|
* What the monitor of an agent build keeps. `undefined` in a build without the flag. Not public.
|
|
9133
9591
|
*/
|
|
@@ -9164,7 +9622,10 @@ type PerfState = {
|
|
|
9164
9622
|
failed: WeakSet<(line: PerfLogLine) => void>; /** Whether the header waits for the native shell. */
|
|
9165
9623
|
shell: "unknown" | "waiting" | "settled";
|
|
9166
9624
|
startup: PerfStartupLine | undefined; /** Page-clock end of the first drawn frame; NaN before. */
|
|
9167
|
-
firstDrawnAt: number;
|
|
9625
|
+
firstDrawnAt: number; /** The number of the first drawn frame; NaN before. A compile up to it is a boot compile. */
|
|
9626
|
+
firstDrawnFrame: number; /** The counts plugins registered. */
|
|
9627
|
+
counts: CountTable; /** The problem rules' accumulators. */
|
|
9628
|
+
problems: ProblemState;
|
|
9168
9629
|
timer: FrameTimer | undefined;
|
|
9169
9630
|
longFrames: LongFrameRing; /** Per-application removers: runners, wrappers, the timer. */
|
|
9170
9631
|
detach: Array<() => void>; /** The first attach registered the time listener and the observer. */
|
|
@@ -9382,6 +9843,51 @@ type PerfMonitorApi = {
|
|
|
9382
9843
|
* ```
|
|
9383
9844
|
*/
|
|
9384
9845
|
setResolution(resolution: number | undefined): number;
|
|
9846
|
+
/**
|
|
9847
|
+
* The live object counts of a debug build: a plugin the renderer cannot depend on (it depends on the renderer)
|
|
9848
|
+
* registers a count here, and the monitor reads it once a second into `sample.counts` and `stats().counts`.
|
|
9849
|
+
*
|
|
9850
|
+
* @example
|
|
9851
|
+
* ```ts
|
|
9852
|
+
* // A game's own pool of particles joins the leak counts of a debug build.
|
|
9853
|
+
* app.renderer.monitor.counts.register("sparks", () => sparkPool.live);
|
|
9854
|
+
* app.renderer.stats().counts?.sparks; // 24
|
|
9855
|
+
* ```
|
|
9856
|
+
*/
|
|
9857
|
+
counts: MonitorCounts;
|
|
9858
|
+
};
|
|
9859
|
+
/**
|
|
9860
|
+
* The count registry of `renderer.monitor.counts`: at most 16 counts, read once a second. Agent builds only.
|
|
9861
|
+
*
|
|
9862
|
+
* @example
|
|
9863
|
+
* ```ts
|
|
9864
|
+
* // A game's pool of sparks joins the leak counts of the sample.
|
|
9865
|
+
* app.renderer.monitor.counts.register("sparks", () => sparkPool.size);
|
|
9866
|
+
* ```
|
|
9867
|
+
*/
|
|
9868
|
+
type MonitorCounts = {
|
|
9869
|
+
/**
|
|
9870
|
+
* Registers a count under a name: `read` is called once a second, at the flush of the sample, and its number goes
|
|
9871
|
+
* into `sample.counts[name]` and `stats().counts[name]`. It must answer a number and allocate nothing. A name already
|
|
9872
|
+
* registered gets the new reader. The renderer's `onStop` drops every registration. Agent builds only: without the
|
|
9873
|
+
* flag nothing is kept and the returned remover does nothing.
|
|
9874
|
+
*
|
|
9875
|
+
* @param name - The count's name in the sample, beside `entities`, `views`, `timers`, `frameListeners` and
|
|
9876
|
+
* `clockListeners`.
|
|
9877
|
+
* @param read - Answers the count now.
|
|
9878
|
+
* @returns The remover; a second call does nothing.
|
|
9879
|
+
* @throws {Error} When 16 counts are registered already: `[game] Monitor count table is full (16).`
|
|
9880
|
+
* @example
|
|
9881
|
+
* ```ts
|
|
9882
|
+
* // A game's pool of sparks joins the leak counts: the reader answers the pool's size, and a pool that grows with
|
|
9883
|
+
* // every visit of the shop shows as a count that grows in every sample.
|
|
9884
|
+
* const off = app.renderer.monitor.counts.register("myPool", () => pool.size);
|
|
9885
|
+
* app.renderer.stats().counts?.myPool; // 24 while the pool holds 24 sparks
|
|
9886
|
+
* off();
|
|
9887
|
+
* app.renderer.stats().counts?.myPool; // undefined
|
|
9888
|
+
* ```
|
|
9889
|
+
*/
|
|
9890
|
+
register(name: string, read: () => number): () => void;
|
|
9385
9891
|
};
|
|
9386
9892
|
/**
|
|
9387
9893
|
* monitor methods the frame and the hooks drive. Not public.
|
|
@@ -9559,7 +10065,7 @@ type PictureRequest = {
|
|
|
9559
10065
|
reject: (error: Error) => void;
|
|
9560
10066
|
};
|
|
9561
10067
|
declare namespace types_d_exports$2 {
|
|
9562
|
-
export { Api$1 as Api, AspectRange, BitmapFontData, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorDeps, MonitorInternal, MonitorModule, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfDisplay, PerfEventLine, PerfEventName, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGraphics, PixiMatrix, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiSprite, PixiTexture, Point, PoolTrim, PoolTrimDetail, Rect, RenderStats, RendererCtx, RendererKind, SafeArea, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail };
|
|
10068
|
+
export { Api$1 as Api, AspectRange, BitmapFontData, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGraphics, PixiMatrix, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiSprite, PixiTexture, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, SafeArea, ShaderEventDetail, ShaderWhat, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail };
|
|
9563
10069
|
}
|
|
9564
10070
|
/**
|
|
9565
10071
|
* The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
|
|
@@ -9776,11 +10282,14 @@ type Config$2 = {
|
|
|
9776
10282
|
warm: number;
|
|
9777
10283
|
};
|
|
9778
10284
|
/**
|
|
9779
|
-
* The performance monitor of an agent build (`__MOKU_GAME_AGENT__`: dev and `--debug` builds)
|
|
10285
|
+
* The performance monitor of an agent build (`__MOKU_GAME_AGENT__`: dev and `--debug` builds): the spike budget, the
|
|
10286
|
+
* ring's frames and the thresholds of the `problem` rules. A threshold left out keeps its default.
|
|
9780
10287
|
*
|
|
9781
10288
|
* @example
|
|
9782
10289
|
* ```ts
|
|
9783
10290
|
* createApp({ pluginConfigs: { renderer: { mount: "#game", monitor: { budgetMs: 8.3, frames: 2048 } } } });
|
|
10291
|
+
* // A game with a large blurred backdrop flags it sooner: 30 still frames over 0.1 Mpx.
|
|
10292
|
+
* createApp({ pluginConfigs: { renderer: { mount: "#game", monitor: { budgetMs: "rate", frames: 1024, stillFrames: 30, stillMpx: 0.1 } } } });
|
|
9784
10293
|
* ```
|
|
9785
10294
|
*/
|
|
9786
10295
|
type MonitorConfig = {
|
|
@@ -9791,7 +10300,12 @@ type MonitorConfig = {
|
|
|
9791
10300
|
* no config change; a number is a fixed budget in ms.
|
|
9792
10301
|
*/
|
|
9793
10302
|
budgetMs: number | "rate"; /** Frames the ring keeps in an agent build, 64 to 16384; render passes keep 4x as many. */
|
|
9794
|
-
frames: number;
|
|
10303
|
+
frames: number; /** `filter-still`: drawn frames a filtered view stands still, filtered in every one. Default 60. */
|
|
10304
|
+
stillFrames?: number; /** `filter-still`: megapixels its filter covers a frame, at least. Default 0.25. */
|
|
10305
|
+
stillMpx?: number; /** `target-churn`: render targets made and dropped a second that count as churn. Default 4. */
|
|
10306
|
+
churnPerSecond?: number; /** `target-churn`: seconds of churn in a row before the problem. Default 3. */
|
|
10307
|
+
churnSeconds?: number; /** `target-churn`: a render target made this many ms after a pool trim is churn at once. Default 1000. */
|
|
10308
|
+
churnAfterTrimMs?: number;
|
|
9795
10309
|
};
|
|
9796
10310
|
/**
|
|
9797
10311
|
* renderer plugin state: one branch per module.
|
|
@@ -11218,4 +11732,4 @@ type BundleCompanion = {
|
|
|
11218
11732
|
unload(bundle: string): void;
|
|
11219
11733
|
};
|
|
11220
11734
|
//#endregion
|
|
11221
|
-
export {
|
|
11735
|
+
export { PerfCause as $, JournalEntry as $n, types_d_exports$3 as $t, PixiSprite as A, Api$3 as An, SnapshotOf as Ar, ViewportSize as At, FrameReadResult as B, defineFlow as Bn, Api$7 as Br, Shape as Bt, State$1 as C, NumericFields as Cn, types_d_exports$6 as Cr, ShaderWhat as Ct, MonitorConfig as D, TrackOptions as Dn, SaveDoc as Dr, FilterSlotInputs as Dt, Config$2 as E, ReducedMotion as En, ProviderCall as Er, FilterSlot as Et, types_d_exports$2 as F, HudKeysOf as Fn, Config$7 as Fr, NineSlice$1 as Ft, OverlayEventDetail as G, FeatureDescription as Gn, ThermalReading as Gr, Transform as Gt, FrameRecord as H, slot as Hn, FrameRate as Hr, Sprite as Ht, Captured as I, Position as In, Events$6 as Ir, NineSliceValue as It, PERF_GAP_BUCKETS as J, AnyFlow as Jn, Config$9 as Jr, DEMAND_REASONS as Jt, OverlayWhat as K, FeaturePlugin as Kn, Time as Kr, TransformValue as Kt, MonitorCounts as L, State$4 as Ln, PauseReason as Lr, Overlay as Lt, PoolTrim as M, Config$4 as Mn, RngApi as Mr, Display as Mt, State$2 as N, EmitterIdOf as Nn, RngState as Nr, HudPart as Nt, PixiFilter as O, TrackSegment as On, SaveUnreadableError as Or, Orientation as Ot, Under as P, GameTypes as Pn, Api$6 as Pr, HudPartValue as Pt, PassRecord as Q, FlowState as Qn, State$3 as Qt, RenderStats as R, TextStylesOf as Rn, State$7 as Rr, OverlayValue as Rt, ScenesApi as S, MotionHandle as Sn, State$6 as Sr, ShaderEventDetail as St, Api$1 as T, ProjectionSpec as Tn, PlayerStateProvider as Tr, DebugSwitches as Tt, FrameRing as U, to as Un, RateChange as Ur, SpriteOptions as Ut, FrameReadout as V, exit as Vn, Config$8 as Vr, ShapeValue as Vt, LongFrameEntry as W, type as Wn, State$8 as Wr, SpriteValue as Wt, PROBLEM_RULES as X, DefineNode as Xn, Require as Xr, Config$3 as Xt, PERF_LOG_VERSION as Y, Bookmark as Yn, Events$8 as Yr, Api$2 as Yt, PassKind as Z, FlowGraph as Zn, Explained as Zt, DefineScene as _, ChangeHook as _n, Api$5 as _r, PerfThermalLine as _t, Config as a, ComponentType as an, Effect as ar, PerfEventLine as at, SceneDefinition as b, Motion as bn, Json as br, ProblemRule as bt, LoadBundles as c, EntitySnapshot as cn, Hint as cr, PerfHeaderLine as ct, Manifest as d, Narrowed as dn, Api$4 as dr, PerfMarkLine as dt, AnyComponent as en, NodeTable as er, PerfChange as et, State as f, QueryTerm as fn, ClockSource as fr, PerfMeasured as ft, AnySceneProjection as g, TagType as gn, types_d_exports$5 as gr, PerfTelemetryLine as gt, types_d_exports as h, SystemFor as hn, State$5 as hr, PerfStartupLine as ht, BundleSpec as i, ComponentSchema as in, Descriptor as ir, PerfDisplay as it, PixiTexture as j, BundlesOf as jn, StoreApi as jr, FilterCache as jt, PixiModule as k, ViewHandle as kn, Snapshot as kr, Point as kt, LoadReason as l, FrameDiff as ln, NodeFx as lr, PerfLogLine as lt, Usage as m, SystemDefinition as mn, FakeClock as mr, PerfSpikeLine as mt, AssetsIo as n, AnyComponentValue as nn, SceneIdOf as nr, PerfCollectorLine as nt, DefineBundles as o, ComponentValue as on, EffectOptions as or, PerfEventName as ot, Tier as p, ResourceType as pn, Config$5 as pr, PerfSampleLine as pt, PERF_CAUSES as q, FeatureTree as qn, types_d_exports$8 as qr, sprite as qt, BundleMap as r, ComponentHandle as rn, TypeTag as rr, PerfCounts as rt, Events as s, Entity as sn, GuideOptions as sr, PerfGapLine as st, Api as t, AnyComponentType as tn, RouteStep as tr, PerfChangeEntry as tt, LoadResult as u, Mut as un, Answer as ur, PerfLongFrameLine as ut, Events$1 as v, DescriptionNode as vn, Config$6 as vr, PoolTrimDetail as vt, types_d_exports$1 as w, ProjectionMotion as wn, Patch as wr, WarmDetail as wt, SceneSpec as x, MotionCause as xn, Root as xr, SHADER_WHATS as xt, LayerMap as y, Ease as yn, Events$5 as yr, ProblemEventDetail as yt, FrameColumns as z, types_d_exports$4 as zn, types_d_exports$7 as zr, Parent as zt };
|