collapse query/hover-eval building paths into single floating-view-build path

This commit is contained in:
Ryan Fleury
2025-03-19 10:30:50 -07:00
parent eaa3711405
commit 7d4d8762b7
3 changed files with 421 additions and 439 deletions
+411 -430
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -571,8 +571,8 @@ struct RD_WindowState
Vec2F32 hover_eval_spawn_pos;
String8 hover_eval_string;
String8 hover_eval_view_rules;
U64 hover_eval_first_frame_idx;
U64 hover_eval_last_frame_idx;
U64 hover_eval_firstt_us;
U64 hover_eval_lastt_us;
// rjf: error state
U8 error_buffer[512];
@@ -708,6 +708,7 @@ struct RD_State
U64 frame_time_us_history[64];
U64 num_frames_requested;
F64 time_in_seconds;
U64 time_in_us;
// rjf: frame parameters
F32 frame_dt;
@@ -1084,7 +1085,7 @@ internal String8 rd_value_string_from_eval(Arena *arena, String8 filter, EV_Stri
////////////////////////////////
//~ rjf: Hover Eval
internal void rd_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string, String8 view_rules);
internal void rd_set_hover_eval(Vec2F32 pos, String8 string, String8 view_rules);
////////////////////////////////
//~ rjf: Lister Functions
+6 -6
View File
@@ -1388,7 +1388,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: interactions
if(ui_hovering(thread_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
}
if(ui_right_clicked(thread_sig))
@@ -1540,7 +1540,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: interactions
if(ui_hovering(thread_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
}
if(ui_right_clicked(thread_sig))
@@ -1619,7 +1619,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: bp hovering
if(ui_hovering(bp_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(bp_box->rect.x0, bp_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, push_str8f(scratch.arena, "$%I64u", bp->id), str8_zero());
rd_set_hover_eval(v2f32(bp_box->rect.x0, bp_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64u", bp->id), str8_zero());
RD_RegsScope(.cfg = bp->id) rd_set_hover_regs(RD_RegSlot_Cfg);
}
@@ -1681,7 +1681,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: watch hovering
if(ui_hovering(pin_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, push_str8f(scratch.arena, "$%I64u", pin->id), str8_zero());
rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64u", pin->id), str8_zero());
RD_RegsScope(.cfg = pin->id) rd_set_hover_regs(RD_RegSlot_Cfg);
}
@@ -1939,7 +1939,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
UI_Signal pin_sig = ui_signal_from_box(pin_box);
if(ui_key_match(pin_box_key, ui_hot_key()))
{
rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(1, 1), 0, pin_expr, pin_view_rule);
rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), pin_expr, pin_view_rule);
}
}
}
@@ -2262,7 +2262,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
U64 line_idx = mouse_pt.line-params->line_num_range.min;
line_vaddr = params->line_vaddrs[line_idx];
}
rd_set_hover_eval(mouse_expr_baseline_pos, rd_regs()->file_path, mouse_pt, line_vaddr, mouse_expr, str8_zero());
rd_set_hover_eval(mouse_expr_baseline_pos, mouse_expr, str8_zero());
}
}