Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve command tree grouping #884

Merged
merged 7 commits into from
Aug 11, 2017
Merged

Improve command tree grouping #884

merged 7 commits into from
Aug 11, 2017

Conversation

dsrbecky
Copy link
Contributor

@dsrbecky dsrbecky commented Aug 9, 2017

No description provided.

@@ -448,7 +448,7 @@ func TestAddAtomsWithSplitting(t *testing.T) {
ctx := log.Testing(t)
got := buildTestGroup(700)

got.AddAtoms(func(CmdID) bool { return true }, 45)
got.AddAtoms(func(CmdID) bool { return true }, 45, 0)
Copy link
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
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
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
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

@@ -372,20 +372,31 @@ func addDrawEvents(ctx context.Context, events *service.Events, p *path.CommandT
}

func addFrameEvents(ctx context.Context, events *service.Events, p *path.CommandTree, t *commandTree, last api.CmdID) {
frameCount, frameStart, frameEnd := 0, api.CmdID(0), api.CmdID(0)
frameCount, frameStart := 0, api.CmdID(0)
for _, e := range events.List {
i := api.CmdID(e.Command.Indices[0])
switch e.Kind {
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

Done

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
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
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
Contributor Author

PTAL

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

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

Copy link
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