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
13
#include "
gpu/work_graph_stats.h
"
14
15
namespace
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
24
struct
GraphPanelStatus
{
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
bicameral::editor
Definition
editor_overlay.cpp:25
bicameral::editor::BuildGraphPanel
void BuildGraphPanel(const GraphPanelStatus &status)
Definition
graph_panel.cpp:115
bicameral::editor::GraphPanelStatus
Definition
graph_panel.h:24
bicameral::editor::GraphPanelStatus::layout
const gpu::GraphStatsLayout * layout
Definition
graph_panel.h:25
bicameral::editor::GraphPanelStatus::ticks
uint64_t ticks
Definition
graph_panel.h:27
bicameral::editor::GraphPanelStatus::units
std::vector< UnitTime > units
Definition
graph_panel.h:28
bicameral::editor::GraphPanelStatus::stats
gpu::GraphStatsSnapshot stats
Definition
graph_panel.h:26
bicameral::editor::UnitTime
Definition
graph_panel.h:18
bicameral::editor::UnitTime::millisecondsPerTick
double millisecondsPerTick
Definition
graph_panel.h:21
bicameral::editor::UnitTime::workGraph
bool workGraph
Definition
graph_panel.h:20
bicameral::editor::UnitTime::name
std::string name
Definition
graph_panel.h:19
bicameral::gpu::GraphStatsLayout
Definition
work_graph_stats.h:41
bicameral::gpu::GraphStatsSnapshot
Definition
work_graph_stats.h:66
work_graph_stats.h
engine
src
editor
graph_panel.h
Generated by
1.15.0