styling
This commit is contained in:
parent
3b8362143d
commit
13c3bc0df4
@ -5720,6 +5720,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
|
||||
u64 start_sample_idx = 0;
|
||||
samples_count = MinU64(samples_count, 512);
|
||||
// samples_count = MinU64(samples_count, Kibi(16));
|
||||
|
||||
|
||||
|
||||
@ -5749,6 +5750,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
// V_ZoneDesc *zones = PushStructs(frame->arena, V_ZoneDesc, zones_count);
|
||||
|
||||
//- Create zones
|
||||
ProfZoneDF("Create zones")
|
||||
{
|
||||
// FIXME: Clamp depth
|
||||
// u64 zone_idx = 0;
|
||||
@ -5848,7 +5850,8 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
UI_SetNext(BackgroundColor, main_color);
|
||||
UI_SetNext(Height, main_height);
|
||||
UI_SetNext(Rounding, UI_Rpx(4));
|
||||
UI_SetNext(Flags, UI_BoxFlag_CaptureMouse | UI_BoxFlag_CaptureThroughChildren | UI_BoxFlag_Scissor);
|
||||
// UI_SetNext(Flags, UI_BoxFlag_CaptureMouse | UI_BoxFlag_CaptureThroughChildren | UI_BoxFlag_Scissor);
|
||||
UI_SetNext(Flags, UI_BoxFlag_CaptureMouse | UI_BoxFlag_CaptureThroughChildren);
|
||||
// UI_SetNext(Flags, UI_BoxFlag_CaptureMouse);
|
||||
UI_SetDF(Parent, UI_BuildColumnEx(main_box))
|
||||
{
|
||||
@ -5932,6 +5935,9 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
|
||||
|
||||
|
||||
// FIXME: Remove this
|
||||
f64 view_range_len_px = DimsFromRng2(UI_Rect(main_box)).x;
|
||||
f64 view_range_len_ns = view_range_len_px * profiler->ns_per_px;
|
||||
|
||||
|
||||
|
||||
@ -5947,10 +5953,14 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
UI_SetDF(Parent, UI_BuildRow())
|
||||
{
|
||||
//- Zones in row
|
||||
u64 zone_idx = 0;
|
||||
for (V_ZoneDesc *zone = row->first_zone; zone; zone = zone->next_in_row)
|
||||
{
|
||||
if (zone->end_ns > zone->start_ns)
|
||||
// FIXME: Clamp to end of timeline
|
||||
i64 visual_start_ns = MaxI64(zone->start_ns, profiler->view_ns);
|
||||
i64 visual_end_ns = MinI64(zone->end_ns, profiler->view_ns + view_range_len_ns);
|
||||
f64 visual_len_px = (visual_end_ns - visual_start_ns) / profiler->ns_per_px;
|
||||
|
||||
if (visual_len_px > 1)
|
||||
{
|
||||
UI_Key zone_box = UI_KeyF("Zone %F", FmtUint(zone->id));
|
||||
if (UI_HotAbsolute(zone_box))
|
||||
@ -5981,20 +5991,42 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
// zone_color_bd = LerpSrgb(zone_color_bd, theme.col.button_active, UI_Hot(zone_box));
|
||||
zone_color_bd = LerpSrgb(zone_color_bd, Color_White, UI_Hot(zone_box));
|
||||
|
||||
f64 zone_len_ns = zone->end_ns - zone->start_ns;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
f64 zone_offset_px = (visual_start_ns - profiler->view_ns) / profiler->ns_per_px;
|
||||
f64 zone_len_ns = visual_end_ns - visual_start_ns;
|
||||
f64 zone_len_px = zone_len_ns / profiler->ns_per_px;
|
||||
|
||||
f32 zone_offset_px = (zone->start_ns - profiler->view_ns) / profiler->ns_per_px;
|
||||
|
||||
|
||||
|
||||
|
||||
// f64 zone_len_ns = zone->end_ns - zone->start_ns;
|
||||
// f64 zone_len_px = zone_len_ns / profiler->ns_per_px;
|
||||
// f64 zone_offset_px = (zone->end_ns - profiler->view_ns) / profiler->ns_per_px;
|
||||
|
||||
// // f64 zone_len_ns = zone->end_ns - zone->start_ns;
|
||||
// // f64 zone_len_px = zone_len_ns / profiler->ns_per_px;
|
||||
// // f32 zone_offset_px = (zone->start_ns - profiler->view_ns) / profiler->ns_per_px;
|
||||
|
||||
|
||||
Vec2 zone_pos = VEC2(zone_offset_px, 0);
|
||||
UI_Size zone_width = UI_Px(zone_len_px, 1);
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: Remove this
|
||||
UI_SetNext(Text, StringF(frame->arena, "ZONE %F", FmtUint(zone_idx)));
|
||||
UI_SetNext(Text, StringF(frame->arena, "ZONE %F", FmtUint(zone->id)));
|
||||
|
||||
|
||||
// if (do_break && UI_IsMouseHovered(zone_box))
|
||||
if (do_break && zone_idx == 0)
|
||||
if (do_break && zone->id == 0)
|
||||
{
|
||||
// UI_SetNext(DebugBreakFlags, UI_DebugBreakFlag_BuildFeedback | UI_DebugBreakFlag_CheckCursorHover);
|
||||
}
|
||||
@ -6012,10 +6044,14 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
// UI_SetNext(Flags, UI_BoxFlag_Floating | UI_BoxFlag_DontClampFloatingX | UI_BoxFlag_DontClampFloatingY);
|
||||
UI_SetDF(Parent, UI_BuildRowEx(zone_box))
|
||||
{
|
||||
UI_BuildSpacer(UI_Px(zone_text_padding_px, 0.25), Axis_X);
|
||||
// UI_BuildSpacer(UI_Px(zone_text_padding_px, 0.25), Axis_X);
|
||||
// UI_BuildSpacer(UI_Px(zone_text_padding_px, 0), Axis_X);
|
||||
// UI_BuildSpacer(UI_Grow(1, 0), Axis_X);
|
||||
|
||||
UI_SetNext(Width, UI_Shrink(1, 0));
|
||||
UI_SetNext(ChildAlignment, UI_Region_Left);
|
||||
UI_SetNext(Width, UI_Shrink(0, 1));
|
||||
// UI_SetNext(Width, UI_Grow(1, 1));
|
||||
UI_SetNext(ChildAlignment, UI_Region_Center);
|
||||
// UI_SetNext(ChildAlignment, UI_Region_Left);
|
||||
UI_SetNext(FontSize, UI_Top(FontSize) * theme.h5);
|
||||
UI_SetNext(TextColor, zone_text_color);
|
||||
UI_SetNext(Text, zone->name);
|
||||
@ -6023,13 +6059,13 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
// UI_SetNext(Flags, UI_BoxFlag_DrawText);
|
||||
UI_BuildRow();
|
||||
|
||||
UI_BuildSpacer(UI_Px(zone_text_padding_px, 1), Axis_X);
|
||||
// UI_BuildSpacer(UI_Px(zone_text_padding_px, 1), Axis_X);
|
||||
// UI_BuildSpacer(UI_Px(zone_text_padding_px, 0), Axis_X);
|
||||
// UI_BuildSpacer(UI_Grow(1, 0), Axis_X);
|
||||
}
|
||||
zone_idx += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -6435,7 +6471,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, UI_Top(FontSize) * theme.h2);
|
||||
UI_BuildLabelF("CpU:");
|
||||
UI_BuildLabelF("Cpu:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtSint(GetGstat(NumArenas)));
|
||||
@ -6446,7 +6482,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
{
|
||||
{
|
||||
UI_Push(FontSize, UI_Top(FontSize) * theme.h2);
|
||||
UI_BuildLabelF("GPU:");
|
||||
UI_BuildLabelF("Gpu:");
|
||||
UI_Pop(FontSize);
|
||||
}
|
||||
UI_BuildLabelF(" Arenas: %F", FmtUint(gpu_stats.arenas_count));
|
||||
|
||||
@ -1977,8 +1977,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
||||
} break;
|
||||
}
|
||||
baseline = CeilVec2(baseline);
|
||||
baseline.x = MaxF32(baseline.x, 0);
|
||||
baseline.y = MaxF32(baseline.y, 0);
|
||||
baseline.x = MaxF32(baseline.x, box->screen_rect.p0.x);
|
||||
|
||||
// Push text rects
|
||||
for (u64 rect_idx = 0; rect_idx < final_rects_count; ++rect_idx)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user