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

Conversation

@jonahwilliams
Copy link
Contributor

Fixes flutter/flutter#158074

binding a nullptr texture should fail but not crash.

Comment on lines +411 to +413
if (!texture) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: I would prefer this is an assert instead of turning BindResource to a noop. It's harder to follow code if every procedure call is prefaced with an implicit "maybe", like "MaybeBindResource()". New people on the team complain about this pattern making the code hard to follow.

This at least communicates when nothing has happened with the returnval and matches existing patterns though so we shouldn't hold back the PR about it. How about adding [[nodiscard]] to this method to communicate at callsites that the method potentially is a noop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't want to crash the app if one of the draws is misconfigured. There is some ambiguity (due to runtime effect) as to whether this is covering up a bug in flutter or a bug in the user code.

DCHECK would be fine, except that it doesn't stop the production crash.

What I'd really like is to get those nullability annotations working correctly so we can correctly eliminate the nullptr closer to where it was generated.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2024
@auto-submit auto-submit bot merged commit 2be456e into flutter:main Nov 6, 2024
30 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 7, 2024
…158303)

flutter/engine@94dac95...076688d

2024-11-07 [email protected] [web:a11y] make header a <header> when non-empty and heading when empty (flutter/engine#55996)
2024-11-06 [email protected] [Impeller] make sure binding nullptr texture does not crash. (flutter/engine#56381)

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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
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.

[Impeller] missing null check in RenderPassMTL::Bind texture.

2 participants