Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Apr 4, 2024

The filter graph frequently creates and submits command buffers in serial. This has some unnecessary overhead, esp on Vulkan where submitting a command buffer has a non-trivial cost. While previously I had tried to batch up all submissions, doing this in a limited manner in the filter graph should be more straightforward.

For gaussians this makes a big difference, as there is a mipmap generation, downsample, then 2 render passes, so we can compress the 4 command buffers into 1.

flutter/flutter#142545

@flutter-dashboard

This comment was marked as off-topic.

jonahwilliams added 2 commits April 4, 2024 12:09
@jonahwilliams jonahwilliams requested review from bdero and gaaclarke April 4, 2024 19:11
Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

LGTM, I'm excited to see how this affects our blur benchmarks. This should be test exempt since it does not change functionality, just performance. I just have one style note.

}
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({std::move(command_buffer)})
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the initializer list?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, it's for a vector. I was thinking it was constructing something like a SubmitInfo and we were using the initializer syntax to avoid explicitly mentioning that type. Man, c++. I feel different about using it for std::vectors. It would be a big pain to have to explicitly list those types. I think /*buffers=*/ would be an improvement since that's typically what we do for rvalues in parameter lists.

}
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({std::move(command_buffer)})
Copy link
Member

Choose a reason for hiding this comment

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

same as above

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


if (!renderer.GetContext()
->GetCommandQueue()
->Submit({std::move(command_buffer)})
Copy link
Member

Choose a reason for hiding this comment

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

Same

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


if (!renderer.GetContext()
->GetCommandQueue()
->Submit({command_buffer})
Copy link
Member

Choose a reason for hiding this comment

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

same

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

if (!GetContentContext()
->GetContext()
->GetCommandQueue()
->Submit({command_buffer})
Copy link
Member

Choose a reason for hiding this comment

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

sa

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

}
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({std::move(command_buffer)})
Copy link
Member

Choose a reason for hiding this comment

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

s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol

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

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 5, 2024
@auto-submit auto-submit bot merged commit d048b9a into flutter:main Apr 5, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 5, 2024
@jonahwilliams
Copy link
Contributor Author

I did some CPU captures after the fact. Its a bit better, but if you breakdown the top% CPU (filtering to flutter only code) its mostly render pass construction. Part of this might be backpressure, althrough I would expect to see that in waitForNextDrawable..

image

@jonahwilliams jonahwilliams deleted the warn_api_impeller branch April 5, 2024 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants