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

[Impeller] remove std::vector usage in render pass vk. #57132

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Dec 11, 2024

Remove std::vector usage in vulkan render pass. Fixed size array + offsets, should be faster than heap allocations.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

LGTM with a nit. Though optional TBH.

color_ref.layout = vk::ImageLayout::eGeneral;
color_refs[0] = color_ref;
attachments.push_back(color0_.value());
color_refs[color_index++] = color_ref;
Copy link
Member

Choose a reason for hiding this comment

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

I suggest using .at(color_index++) instead of [color_index++]. The former performs range checking in debug for throwing the exceptions (which we disable). The latter is free to write into garbage memory. Some safety net in debug should be good to have IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can add a break if we hit more than 16 attachments. otherwise there shouldn't (TM) need to be bounds checks.

Copy link
Member Author

Choose a reason for hiding this comment

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

added at

Copy link
Member Author

Choose a reason for hiding this comment

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

There are other places where the bounds checks would be harder to add so I made them use .at() too.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, its hard to imagine cases where we could blow the limit. But the .at() to me also reads better since it implies no reallocations may occur if say the collection was a map.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
Copy link
Contributor

auto-submit bot commented Dec 11, 2024

auto label is removed for flutter/engine/57132, due to - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
Copy link
Contributor

auto-submit bot commented Dec 11, 2024

auto label is removed for flutter/engine/57132, due to - The status or check suite Linux local_engine_builds has failed. Please fix the issues identified (or deflake) before re-applying this label.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
@auto-submit auto-submit bot merged commit e352461 into flutter:main Dec 11, 2024
34 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 11, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 12, 2024
…160128)

flutter/engine@b8034f1...e352461

2024-12-11 [email protected] [Impeller] remove std::vector usage
in render pass vk. (flutter/engine#57132)
2024-12-11 [email protected] [Linux] Add
Multi-Touch Support for Linux (flutter/engine#54214)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to
ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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