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] Guard against empty grid sizes #40769

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Mar 29, 2023

On Metal, this will trigger a runtime assert if not guarded against further down. We should avoid doing the dispatch at all if the grid size is zero in any dimension.

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.

Besides using the validation logs, lgtm.

@@ -55,6 +55,8 @@
return false;
}

FML_DCHECK(!grid_size_.IsEmpty() && !thread_group_size_.IsEmpty());
Copy link
Member

Choose a reason for hiding this comment

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

We use VALIDATION_LOG for such things and return false from here maybe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's too strong. VALIDATION_LOG will kill the process. An application could get here by mistake and should fizzle instead of dying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(but a test should die)

@@ -47,6 +47,11 @@ bool ComputePass::AddCommand(ComputeCommand command) {
}

bool ComputePass::EncodeCommands() const {
if (grid_size_.IsEmpty() || thread_group_size_.IsEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

Ditto about the validation logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same comment - I think making this a fatal error is too strong.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 30, 2023
@auto-submit auto-submit bot merged commit 35507f9 into flutter:main Mar 30, 2023
@dnfield dnfield deleted the strokes branch March 30, 2023 17:32
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 30, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 30, 2023
…0769) (#123801)

Roll Flutter Engine from 7d190aa0e19f to 35507f9e91a7 (1 revision)
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this pull request Mar 30, 2023
…/engine#40769) (#123801)

Commit: 4a7fca08d9396ba00b436d1224192afd62adab85
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
…0769) (flutter#123801)

Roll Flutter Engine from 7d190aa0e19f to 35507f9e91a7 (1 revision)
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
No open projects
Archived in project
2 participants