Skip to content

Improve command tree grouping#884

Merged
dsrbecky merged 7 commits intogoogle:masterfrom
dsrbecky:cmd-tree
Aug 11, 2017
Merged

Improve command tree grouping#884
dsrbecky merged 7 commits intogoogle:masterfrom
dsrbecky:cmd-tree

Conversation

@dsrbecky
Copy link
Copy Markdown
Contributor

@dsrbecky dsrbecky commented Aug 9, 2017

No description provided.

got := buildTestGroup(700)

got.AddAtoms(func(CmdID) bool { return true }, 45)
got.AddAtoms(func(CmdID) bool { return true }, 45, 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please have a test for maxNeighbours?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return log.Errf(ctx, err, "Couldn't get events")
}

func addDrawEvents(ctx context.Context, events *service.Events, p *path.CommandTree, t *commandTree, last api.CmdID) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the fix for the "silently ignored error" of which you speak?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return log.Errf(ctx, err, "Couldn't get events") was always ignored before

frameCount, frameStart := 0, api.CmdID(0)
for _, e := range events.List {
i := api.CmdID(e.Command.Indices[0])
switch e.Kind {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about removing the use of FirstInFrame. Don't we want to use this information if it's provided by the API? For example eglSwapBuffers is now annotated with @StartOfFrame, so we're actually deriving our start-of-frame here from the end-of-frame event, which is actually derived from the @StartOfFrame annotation. Ewww.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread gapis/api/cmd_id_group.go Outdated
Name string // Name of this group.
Range CmdIDRange // The range of commands this group (and items) represents.
Spans Spans // All sub-groups and sub-ranges of this group.
Thumbnail CmdID // The command which shall be used to make thumbnail for this group
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't think this information belongs here. The types in the gapis/api package are supposed to be core and generic data structures relating to APIs, Commands and basic resource types. Thumbnail is a very specific usage.

It's unfortunate that the resolve.commandTree structure doesn't have a separate node type for its representation of the command tree.

Given that you're just doing a binary search on the events list to get the thumbnail for the group, you could just do this on demand in resolve.CommandTreeNode()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

I want to be about to easily distinguish what is user-defined group,
and what is gapis-generated group (heuristics).
For pure-heuristic based grouping, this has no effect as we
do not generate this pattern.

For captures with a lot of user defined groups, this makes
the user defined groups easier to find and navigate.
Just to make the code easier to read/modify

Also fix silently ignored error
This does not have effect on the heuristic based grouping,
but it ensures that we still have frames in the presence
of user-defined debug groups.
This ensures we create the draw groups even in the
presence of user-defined groups.
This behaviour fixes my current frame issue,
and I do not believe we care in other cases.
@dsrbecky
Copy link
Copy Markdown
Contributor Author

PTAL

This avoids a common problem where the framebuffer is unbound
at the end of the group.
@dsrbecky
Copy link
Copy Markdown
Contributor Author

PS: I added the missing local changes to the last commit.

Copy link
Copy Markdown
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@dsrbecky dsrbecky merged commit f8f7606 into google:master Aug 11, 2017
@dsrbecky dsrbecky deleted the cmd-tree branch September 15, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants