Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
graph_panel.h
Go to the documentation of this file.
1// graph_panel.h — エディタの「Work Graphs と性能」のパネル(T-0143、docs/design/14 §2・16 §1)。
2//
3// データの流れ: シミュのリストの待たない読み戻し(sim/probe_sim の ProbeFrameReadback: 単位ごとのタイムスタンプ・伝導のグラフのノードのカウンタ)
4// → フレームのループが 1 秒ずつ足す(frame_loop の Stats)→ GraphPanelStatus に詰める → BuildGraphPanel が表にする(読むだけ)。
5// Work Graphs はノードごとの時間を測れない(タイムスタンプは DispatchGraph の前後にしか打てない)ので、時間は単位(= DispatchGraph 1 回)ごと、
6// ノードごとは起動・レコードの数と上限の余裕を出す(16 §1・T-0008 のカウンタ)。
7#pragma once
8
9#include <cstdint>
10#include <string>
11#include <vector>
12
14
15namespace bicameral::editor {
16
17 // 刻みの中の単位 1 種の GPU 時間
18 struct UnitTime {
19 std::string name;
20 bool workGraph = false; // Work Graph の単位(DispatchGraph)か
21 double millisecondsPerTick = 0.0; // 1 刻みあたり(直近 1 秒の平均)
22 };
23
25 const gpu::GraphStatsLayout* layout = nullptr; // 伝導のグラフのノードと計器の名前・上限(ProbeSim が持つ)
26 gpu::GraphStatsSnapshot stats; // 直近 1 秒の合計(数は足し、最大は最大)
27 uint64_t ticks = 0; // その間に終えた刻み(1 刻みあたりにするため)
28 std::vector<UnitTime> units; // 刻みの中の順
29 };
30
31 // ImGui の窓「Work Graphs と性能」を作る(EditorOverlay::Build の中で呼ぶ)
32 void BuildGraphPanel(const GraphPanelStatus& status);
33
34} // namespace bicameral::editor
void BuildGraphPanel(const GraphPanelStatus &status)
const gpu::GraphStatsLayout * layout
Definition graph_panel.h:25
std::vector< UnitTime > units
Definition graph_panel.h:28
gpu::GraphStatsSnapshot stats
Definition graph_panel.h:26