re-add id stability to top-level-cfg evaluation expansions

This commit is contained in:
Ryan Fleury
2025-02-10 15:51:36 -08:00
parent f3c17a4e2c
commit 428617de91
3 changed files with 41 additions and 3 deletions
@@ -770,7 +770,7 @@ internal EV_BlockRange
ev_block_range_from_num(EV_BlockRangeList *block_ranges, U64 num)
{
EV_BlockRange result = {&ev_nil_block};
U64 base_num = 0;
U64 base_num = 1;
for(EV_BlockRangeNode *n = block_ranges->first; n != 0; n = n->next)
{
U64 range_size = n->v.block->single_item ? 1 : dim_1u64(n->v.range);
+36 -2
View File
@@ -8932,12 +8932,46 @@ E_LOOKUP_RANGE_FUNCTION_DEF(top_level_cfg)
E_LOOKUP_ID_FROM_NUM_FUNCTION_DEF(top_level_cfg)
{
return num;
U64 id = 0;
RD_TopLevelCfgLookupAccel *accel = (RD_TopLevelCfgLookupAccel *)user_data;
if(num != 0)
{
U64 idx = num-1;
if(contains_1u64(accel->cfgs_idx_range, idx))
{
RD_Cfg *cfg = accel->cfgs.v[idx - accel->cfgs_idx_range.min];
id = cfg->id;
}
else if(contains_1u64(accel->cmds_idx_range, idx))
{
id = num;
id |= (1ull<<63);
}
}
return id;
}
E_LOOKUP_NUM_FROM_ID_FUNCTION_DEF(top_level_cfg)
{
return id;
U64 num = 0;
RD_TopLevelCfgLookupAccel *accel = (RD_TopLevelCfgLookupAccel *)user_data;
if(id != 0)
{
if(id & (1ull<<63))
{
num = id;
num &= ~(1ull<<63);
}
else for EachIndex(idx, accel->cfgs.count)
{
if(accel->cfgs.v[idx]->id == id)
{
num = idx + accel->cfgs_idx_range.min + 1;
break;
}
}
}
return num;
}
//- rjf: threads / callstacks
+4
View File
@@ -2319,6 +2319,10 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
{
E_Type *block_type = e_type_from_key__cached(block_type_key);
group_cfg_name = rd_singular_from_code_name_plural(block_type->name);
if(group_cfg_name.size == 0)
{
group_cfg_name = block_type->name;
}
}
}