Skip to content

Commit

Permalink
Fix the crash caused by cmd grouping when vkCmdExecuteCommands is used (
Browse files Browse the repository at this point in the history
  • Loading branch information
Qining authored Oct 13, 2017
1 parent e451f22 commit 573e7c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion gapis/api/cmd_id_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions gapis/api/vulkan/vulkan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 573e7c5

Please sign in to comment.