Skip to content

Commit f33ce7c

Browse files
committed
Incorporate json indexing fix from dev
1 parent 336ba65 commit f33ce7c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

framework/decode/vulkan_replay_dump_resources_delegate.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,9 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonDrawCallInfo(const Vu
451451
auto& drawcall_json_entries =
452452
!options_.dump_resources_json_per_command ? current_block["drawCallCommands"] : current_block;
453453

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;
457457

458458
draw_call_entry["drawIndex"] = draw_call_info.cmd_index;
459459
draw_call_entry["beginCommandBufferIndex"] = draw_call_info.bcb_index;
@@ -1271,9 +1271,10 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonDispatchInfo(const Vu
12711271
auto& dispatch_json_entries =
12721272
!options_.dump_resources_json_per_command ? current_block["dispatchCommands"] : dump_json_.GetData();
12731273

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();
12771278

12781279
dispatch_json_entry["dispatchIndex"] = draw_call_info.cmd_index;
12791280
dispatch_json_entry["beginCommandBufferIndex"] = draw_call_info.bcb_index;
@@ -1736,9 +1737,9 @@ void DefaultVulkanDumpResourcesDelegate::GenerateOutputJsonTraceRaysIndex(const
17361737
dump_json_.BlockStart();
17371738
}
17381739

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();
17421743

17431744
tr_entry["traceRaysIndex"] = draw_call_info.cmd_index;
17441745
tr_entry["beginCommandBufferIndex"] = draw_call_info.bcb_index;

0 commit comments

Comments
 (0)