diff --git a/gapis/api/cmd_id_group.go b/gapis/api/cmd_id_group.go index bec51d329a..8fdd6f1378 100644 --- a/gapis/api/cmd_id_group.go +++ b/gapis/api/cmd_id_group.go @@ -457,10 +457,16 @@ func (c *SubCmdRoot) AddSubCmdMarkerGroups(r []uint64, groups []*CmdIDGroup) err // FindSubCommandRoot returns the SubCmdRoot that represents the given CmdID. func (g CmdIDGroup) FindSubCommandRoot(id CmdID) *SubCmdRoot { for _, x := range g.Spans { - if k, ok := x.(*SubCmdRoot); ok { + switch k := x.(type) { + case *SubCmdRoot: if CmdID(k.Id[len(k.Id)-1]) == id { return k } + case *CmdIDGroup: + y := k.FindSubCommandRoot(id) + if y != nil { + return y + } } } return nil diff --git a/gapis/api/vulkan/vulkan.go b/gapis/api/vulkan/vulkan.go index 230f82c464..4e923de902 100644 --- a/gapis/api/vulkan/vulkan.go +++ b/gapis/api/vulkan/vulkan.go @@ -313,10 +313,10 @@ func (API) ResolveSynchronization(ctx context.Context, d *sync.Data, c *path.Cap for _, ms := range markerStack[vkQu] { // If the last subcommand is in a secondary command buffer and current // recording debug marker groups are opened in a primary command buffer, - // this will assign a wrong End value to the open marker groups. - // However, those End values will be overwritten when the secondary - // command buffer ends and vkCmdExecuteCommands get executed. - ms.end = s.SubCmdIdx[len(s.SubCmdIdx)-1] + 1 + // this prevents assigning a wrong End value to the open marker groups. + if len(s.SubCmdIdx) == len(ms.parent) { + ms.end = s.SubCmdIdx[len(s.SubCmdIdx)-1] + 1 + } } }