build profiler as panel

This commit is contained in:
jacob 2026-04-03 07:43:20 -05:00
parent 346b6ebaac
commit 48eb87aec8
5 changed files with 1304 additions and 1268 deletions

View File

@ -24,7 +24,7 @@
//~ Settings
#define PROFILING_ENABLED 0
#define PROFILING_ENABLED 1

File diff suppressed because it is too large Load Diff

View File

@ -288,9 +288,8 @@ Struct(V_ZoneTrack)
Struct(V_Profiler)
{
Vec2 graph_dims;
b32 is_showing;
b32 snap;
b32 unsnap;
f64 target_view_ns;
f64 view_ns;
@ -310,92 +309,44 @@ Struct(V_Profiler)
f64 drag_cursor_px;
};
////////////////////////////////////////////////////////////
//~ Panel types
Enum(V_PanelFlag)
{
V_PanelFlag_None = 0,
V_PanelFlag_Spawn = (1 << 0),
V_PanelFlag_Profiler = (1 << 1),
};
Struct(V_Panel)
{
V_Panel *parent;
V_Panel *next;
V_Panel *prev;
V_Panel *first;
V_Panel *last;
//- Panel layout
Axis axis;
UI_Key box;
UI_Key contents_box;
UI_Key resizer_box;
f32 pct;
f32 drag_resize_pct;
f32 drag_resize_pct_per_px;
b32 is_organizational;
//- Panel contents
// ////////////////////////////////////////////////////////////
// //~ Window types
// // TODO: Remove this
// // TODO: Move boolean fields into bitwise property flags
// Struct(V_Panel)
// {
// V_Panel *parent;
// V_Panel *next;
// V_Panel *prev;
// V_Panel *first;
// V_Panel *last;
// i64 count;
// UI_Key key;
// UI_Key divider_key;
// f32 pref_ratio;
// b32 resizing;
// Axis axis;
// b32 is_organizing_panel;
// b32 is_vis_ui_panel;
// b32 is_editor_panel;
// i64 active_window_idx;
// i64 windows_count;
// struct V_Window *first_window;
// struct V_Window *last_window;
// };
// Struct(V_Window)
// {
// V_Panel *panel;
// V_Window *next_in_panel;
// V_Window *prev_in_panel;
// UI_Key key;
// b32 is_tile_window;
// b32 is_prefab_window;
// };
V_PanelFlag flags;
V_Profiler profiler;
};
////////////////////////////////////////////////////////////
//~ Draw types
@ -466,7 +417,6 @@ Struct(V_Frame)
Button held_buttons[Button_COUNT]; // User input state captured for gameplay
Button real_held_buttons[Button_COUNT]; // Actual state of user input regardless of keyboard / mouse focus
V_Palette palette;
V_Profiler profiler;
UI_Key text_input_focus;
@ -505,10 +455,7 @@ Struct(V_Ctx)
// i64 panels_count;
// i64 windows_count;
// V_Panel *root_panel;
// V_Window *dragging_window;
V_Panel *root_panel;
@ -532,6 +479,7 @@ Struct(V_Ctx)
Atomic32 shutdown;
Fence shutdown_complete;
Vec2 profiler_graph_dims;
u64 profiler_frame_seq;
V_ProfilerFrame *profiler_frames;

View File

@ -822,8 +822,8 @@ UI_Frame *UI_BeginFrame(UI_FrameFlag frame_flags)
}
if (box->desc.flags & UI_BoxFlag_CaptureThroughChildren)
{
box->mouse_hovered = box->child_mouse_hovered || box->mouse_captured;
box->mouse_captured = box->child_mouse_captured || box->mouse_hovered;
box->mouse_hovered = box->child_mouse_hovered || box->mouse_hovered;
box->mouse_captured = box->child_mouse_captured || box->mouse_captured;
}
feedback->active_absolute = box->mouse_captured;

View File

@ -102,16 +102,19 @@ Enum(UI_BoxFlag)
Enum(UI_DebugBreakFlag)
{
UI_DebugBreakFlag_None = 0,
UI_DebugBreakFlag_CheckCursorHover = (1 << 0),
UI_DebugBreakFlag_BuildFeedback = (1 << 1),
UI_DebugBreakFlag_PrepLayout = (1 << 2),
UI_DebugBreakFlag_IndependentSolve = (1 << 3),
UI_DebugBreakFlag_UpwardsDependentSolveLayoutAxis = (1 << 4),
UI_DebugBreakFlag_DownwardsDependentSolve = (1 << 5),
UI_DebugBreakFlag_UpwardsDependentSolveNonLayoutAxis = (1 << 6),
UI_DebugBreakFlag_SolveViolations = (1 << 7),
UI_DebugBreakFlag_FinalSolve = (1 << 8),
UI_DebugBreakFlag_BuildGpuData = (1 << 9),
UI_DebugBreakFlag_Misc = (1 << 0),
UI_DebugBreakFlag_CheckCursorHover = (1 << 1),
UI_DebugBreakFlag_BuildFeedback = (1 << 2),
UI_DebugBreakFlag_PrepLayout = (1 << 3),
UI_DebugBreakFlag_IndependentSolve = (1 << 4),
UI_DebugBreakFlag_UpwardsDependentSolveLayoutAxis = (1 << 5),
UI_DebugBreakFlag_DownwardsDependentSolve = (1 << 6),
UI_DebugBreakFlag_UpwardsDependentSolveNonLayoutAxis = (1 << 7),
UI_DebugBreakFlag_SolveViolations = (1 << 8),
UI_DebugBreakFlag_FinalSolve = (1 << 9),
UI_DebugBreakFlag_BuildGpuData = (1 << 10),
UI_DebugBreakFlag_All = 0xFFFFFFFF
};