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

[Impeller] Remove cached pipelines when RuntimeStage is hot reloaded #37307

Merged
merged 9 commits into from
Nov 5, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Nov 4, 2022

This is the last missing bit on Impeller's end to get shader hot reload working!

PXL_20221104_040627122.mp4

@bdero bdero self-assigned this Nov 4, 2022
@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 to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

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.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm w/ question

it = pipelines_.erase(it);
continue;
}
it++;
Copy link
Member

Choose a reason for hiding this comment

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

Why here and not as the last clause of the for?

Copy link
Member

Choose a reason for hiding this comment

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

The continue would make them not identical.

it = pipelines_.erase(it);
continue;
}
it++;
Copy link
Member

Choose a reason for hiding this comment

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

The continue would make them not identical.

// |PipelineLibrary|
void PipelineLibraryGLES::RemovePipelinesWithEntryPoint(
std::shared_ptr<const ShaderFunction> function) {
for (auto it = pipelines_.begin(); it != pipelines_.end();) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm never quite sure about iterator invalidation rules due to mutation while enumeration and the safer C++20 std::erase_if is unfortunately unavailable to us. Can we put an erase_if shim in //impeller/base somewhere and do the dumb thing for now where do do mutate while enumerate (separate allocations are OK). This may be safe as written but it is hard to read and brittle in case we change the container type.

Copy link
Member

Choose a reason for hiding this comment

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

Will also dry up the code a lot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. LMK if this is more or less what you had in mind.

@bdero bdero requested a review from chinmaygarde November 4, 2022 19:56
@bdero bdero force-pushed the bdero/pipeline-remove branch 2 times, most recently from 4ce5b35 to 0c44636 Compare November 4, 2022 20:26
@skia-gold
Copy link

Gold has detected about 103 new digest(s) on patchset 7.
View them at https://flutter-engine-gold.skia.org/cl/github/37307

@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2022
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Nov 4, 2022

auto label is removed for flutter/engine, pr: 37307, due to - The status or check suite Windows Android AOT Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

  • The status or check suite Linux License has failed. Please fix the issues identified (or deflake) before re-applying this label.

@bdero bdero force-pushed the bdero/pipeline-remove branch from f25f9b1 to f9fd352 Compare November 4, 2022 22:00
@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2022
@skia-gold
Copy link

Gold has detected about 103 new digest(s) on patchset 9.
View them at https://flutter-engine-gold.skia.org/cl/github/37307

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #37307 at sha f9fd352

@bdero bdero merged commit 396be86 into flutter:main Nov 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 5, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 5, 2022
…114732)

* aeae6afb7 Roll Dart SDK from b2aad7caafc9 to d97d5ad98893 (1 revision) (flutter/engine#37333)

* 396be860f [Impeller] Remove cached pipelines when RuntimeStage is hot reloaded (flutter/engine#37307)

* 223a485ce Handle include paths the same way as output paths (flutter/engine#37335)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#114732)

* aeae6afb7 Roll Dart SDK from b2aad7caafc9 to d97d5ad98893 (1 revision) (flutter/engine#37333)

* 396be860f [Impeller] Remove cached pipelines when RuntimeStage is hot reloaded (flutter/engine#37307)

* 223a485ce Handle include paths the same way as output paths (flutter/engine#37335)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#114732)

* aeae6afb7 Roll Dart SDK from b2aad7caafc9 to d97d5ad98893 (1 revision) (flutter/engine#37333)

* 396be860f [Impeller] Remove cached pipelines when RuntimeStage is hot reloaded (flutter/engine#37307)

* 223a485ce Handle include paths the same way as output paths (flutter/engine#37335)
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 needs tests will affect goldens
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants