From 8e52d95af2daae57c0a09b817dd6371bee9ad5ed Mon Sep 17 00:00:00 2001 From: Qining Date: Wed, 11 Oct 2017 17:38:47 -0400 Subject: [PATCH] Fix crashes when tracing vkCmdExecuteCommands (#1187) --- gapis/api/vulkan/footprint_builder.go | 6 +++--- gapis/api/vulkan/vulkan.api | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gapis/api/vulkan/footprint_builder.go b/gapis/api/vulkan/footprint_builder.go index 2964d5b24a..110b3fd4e3 100644 --- a/gapis/api/vulkan/footprint_builder.go +++ b/gapis/api/vulkan/footprint_builder.go @@ -2341,6 +2341,9 @@ func (vb *FootprintBuilder) BuildFootprint(ctx context.Context, read(ctx, bh, vkHandle(vkCb)) read(ctx, bh, vb.commandBuffers[vkCb].end) for k, cbc := range vb.commands[vkCb] { + fci := api.SubCmdIdx{uint64(id), uint64(i), uint64(j), uint64(k)} + submittedCmd := newSubmittedCommand(fci, cbc, nil) + vb.submitInfos[id].pendingCommands = append(vb.submitInfos[id].pendingCommands, submittedCmd) if cbc.isCmdExecuteCommands { for scbi, scb := range cbc.secondaryCommandBuffers { read(ctx, bh, vb.commandBuffers[scb].end) @@ -2351,9 +2354,6 @@ func (vb *FootprintBuilder) BuildFootprint(ctx context.Context, } } } - fci := api.SubCmdIdx{uint64(id), uint64(i), uint64(j), uint64(k)} - submittedCmd := newSubmittedCommand(fci, cbc, nil) - vb.submitInfos[id].pendingCommands = append(vb.submitInfos[id].pendingCommands, submittedCmd) } } waitSemaphoreCount := uint64(submit.WaitSemaphoreCount) diff --git a/gapis/api/vulkan/vulkan.api b/gapis/api/vulkan/vulkan.api index 4dbdfc68da..e9113158ec 100644 --- a/gapis/api/vulkan/vulkan.api +++ b/gapis/api/vulkan/vulkan.api @@ -2814,7 +2814,7 @@ cmd VkResult vkQueueSubmit( ref := cb.CommandReferences[as!u32(k)] if ref.Type == cmd_vkCmdExecuteCommands { enterSubcontext() - ec := cb.BufferCommands.vkCmdExecuteCommands[ref.CommandIndex] + ec := cb.BufferCommands.vkCmdExecuteCommands[ref.MapIndex] for l in (0 .. len(ec.CommandBuffers)) { scb := CommandBuffers[ec.CommandBuffers[as!u32(l)]] enterSubcontext()