Skip to content

Commit

Permalink
Vulkan dump resources: Multiple cbs from same qs
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Dec 11, 2024
1 parent ce13272 commit b395947
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
16 changes: 2 additions & 14 deletions framework/decode/vulkan_replay_dump_resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1994,25 +1994,13 @@ bool VulkanReplayDumpResourcesBase::UpdateRecordingStatus(VkCommandBuffer origin
{
assert(recording_);

const DrawCallsDumpingContext* dc_context = FindDrawCallCommandBufferContext(original_command_buffer);
if (dc_context != nullptr && dc_context->IsRecording())
{
return true;
}
recording_ = !QueueSubmit_indices_.empty();

const DispatchTraceRaysDumpingContext* dr_context = FindDispatchRaysCommandBufferContext(original_command_buffer);
if (dr_context != nullptr && dr_context->IsRecording())
{
return true;
}

recording_ = false;
return false;
return recording_;
}

bool VulkanReplayDumpResourcesBase::MustDumpQueueSubmitIndex(uint64_t index) const
{
// Indices should be sorted
return QueueSubmit_indices_.find(index) != QueueSubmit_indices_.end();
}

Expand Down
5 changes: 4 additions & 1 deletion framework/decode/vulkan_replay_dump_resources_draw_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,10 @@ void DrawCallsDumpingContext::GenerateOutputJsonDrawCallInfo(

auto& current_block = dump_json.GetCurrentSubEntry();
auto& drawcall_json_entries = !output_json_per_command ? current_block["drawCallCommands"] : current_block;
auto& draw_call_entry = !output_json_per_command ? drawcall_json_entries[cmd_buf_index] : drawcall_json_entries;

static uint64_t unique_json_entry = 0;
auto& draw_call_entry =
!output_json_per_command ? drawcall_json_entries[unique_json_entry++] : drawcall_json_entries;

const auto& dc_param_entry = draw_call_params.find(dc_index);
assert(dc_param_entry != draw_call_params.end());
Expand Down
16 changes: 6 additions & 10 deletions tools/replay/parse_dump_resources_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,15 @@ static bool CheckIndicesForErrors(const gfxrecon::decode::VulkanReplayOptions& v
}
}

// The number of BeginCommandBuffer and QueueSubmit entries must be more than
// zero, and there must be the same number of them.
// At least one BeginCommandBuffer and one QueueSubmit indices must be provided
if ((vulkan_replay_options.BeginCommandBuffer_Indices.size() == 0 &&
vulkan_replay_options.QueueSubmit_Indices.size() == 0) ||
((vulkan_replay_options.BeginCommandBuffer_Indices.size() ||
vulkan_replay_options.QueueSubmit_Indices.size()) &&
(vulkan_replay_options.BeginCommandBuffer_Indices.size() != vulkan_replay_options.QueueSubmit_Indices.size())))
vulkan_replay_options.QueueSubmit_Indices.size() == 0))
{
GFXRECON_LOG_ERROR("ERROR - incomplete --dump-resources parameters");
GFXRECON_LOG_ERROR("Number of BeginCommandBuffer and QueueSubmit indices must be equal and greater than "
"zero (%zu and %zu respectively)",
vulkan_replay_options.BeginCommandBuffer_Indices.size(),
vulkan_replay_options.QueueSubmit_Indices.size())
GFXRECON_LOG_ERROR(
"At least one BeginCommandBuffer and one QueueSubmit indices must be provided (%zu and %zu respectively)",
vulkan_replay_options.BeginCommandBuffer_Indices.size(),
vulkan_replay_options.QueueSubmit_Indices.size())
return true;
}

Expand Down

0 comments on commit b395947

Please sign in to comment.