@@ -451,9 +451,9 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonDrawCallInfo(const Vu
451
451
auto & drawcall_json_entries =
452
452
!options_.dump_resources_json_per_command ? current_block[" drawCallCommands" ] : current_block;
453
453
454
- static uint64_t unique_json_entry = 0 ;
455
- auto & draw_call_entry =
456
- !options_.dump_resources_json_per_command ? drawcall_json_entries[unique_json_entry++ ] : drawcall_json_entries;
454
+ const uint32_t draw_call_json_entry = dump_json_. FetchAndAddDrawCallsEntryIndex () ;
455
+ auto & draw_call_entry =
456
+ !options_.dump_resources_json_per_command ? drawcall_json_entries[draw_call_json_entry ] : drawcall_json_entries;
457
457
458
458
draw_call_entry[" drawIndex" ] = draw_call_info.cmd_index ;
459
459
draw_call_entry[" beginCommandBufferIndex" ] = draw_call_info.bcb_index ;
@@ -1271,9 +1271,10 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonDispatchInfo(const Vu
1271
1271
auto & dispatch_json_entries =
1272
1272
!options_.dump_resources_json_per_command ? current_block[" dispatchCommands" ] : dump_json_.GetData ();
1273
1273
1274
- static uint64_t unique_json_entry = 0 ;
1275
- auto & dispatch_json_entry =
1276
- !options_.dump_resources_json_per_command ? dispatch_json_entries[unique_json_entry++] : dump_json_.GetData ();
1274
+ const uint32_t dispatch_json_entry_index = dump_json_.FetchAndAddDispatchEntryIndex ();
1275
+ auto & dispatch_json_entry = !options_.dump_resources_json_per_command
1276
+ ? dispatch_json_entries[dispatch_json_entry_index]
1277
+ : dump_json_.GetData ();
1277
1278
1278
1279
dispatch_json_entry[" dispatchIndex" ] = draw_call_info.cmd_index ;
1279
1280
dispatch_json_entry[" beginCommandBufferIndex" ] = draw_call_info.bcb_index ;
@@ -1736,9 +1737,9 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonTraceRaysIndex(const
1736
1737
dump_json_.BlockStart ();
1737
1738
}
1738
1739
1739
- static uint64_t unique_json_entry = 0 ;
1740
- auto & tr_entry =
1741
- !options_.dump_resources_json_per_command ? tr_json_entries[unique_json_entry++ ] : dump_json_.GetData ();
1740
+ const uint32_t trace_rays_json_entry_index = dump_json_. FetchAndAddTraceRaysEntryIndex () ;
1741
+ auto & tr_entry =
1742
+ !options_.dump_resources_json_per_command ? tr_json_entries[trace_rays_json_entry_index ] : dump_json_.GetData ();
1742
1743
1743
1744
tr_entry[" traceRaysIndex" ] = draw_call_info.cmd_index ;
1744
1745
tr_entry[" beginCommandBufferIndex" ] = draw_call_info.bcb_index ;
0 commit comments