Optimize mover rendering and segment plan pipeline

This commit is contained in:
scamiv
2026-03-02 21:27:50 +01:00
parent 9703fecab8
commit 2cda35fb40
17 changed files with 924 additions and 354 deletions
+14
View File
@@ -484,9 +484,15 @@ export class GameRenderer {
}
const tickLayerDurations: Record<string, number> = {};
const layerCounters: Record<string, Record<string, number>> = {};
for (const layer of this.layers) {
if (!layer.tick) {
const counters = layer.getPerfCounters?.();
if (counters && Object.keys(counters).length > 0) {
const label = layer.constructor?.name ?? "UnknownLayer";
layerCounters[label] = counters;
}
continue;
}
@@ -510,8 +516,16 @@ export class GameRenderer {
const label = layer.constructor?.name ?? "UnknownLayer";
tickLayerDurations[label] = (tickLayerDurations[label] ?? 0) + duration;
}
const counters = layer.getPerfCounters?.();
if (counters && Object.keys(counters).length > 0) {
const label = layer.constructor?.name ?? "UnknownLayer";
layerCounters[label] = counters;
}
}
this.performanceOverlay.updateLayerCounters(layerCounters);
if (shouldProfileTick) {
this.performanceOverlay.updateTickLayerMetrics(tickLayerDurations);
}