[Flutter GPU] Improve context initialization error messages#183986
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves the error messages for Flutter GPU context initialization. A new check is added to provide a specific error when the Impeller rendering backend is not enabled, which is a prerequisite for Flutter GPU. The existing error message for when Flutter GPU itself is not enabled has also been clarified to include macOS and specific file names (Info.plist, AndroidManifest.xml). To support these changes, the test suite in gpu_test.dart has been refactored into more granular tests that cover each initialization error case separately, and a new helper flutterGpuEnabled has been added for test flag detection. The changes make debugging initialization issues easier and improve test coverage.
706ecf9 to
51a1875
Compare
|
Hmm not sure why the engine tests aren't running. |
Just FYI - The |
|
autosubmit label was removed for flutter/flutter/183986, because - The status or check suite Linux linux_host_engine_test has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…nabled errors When Flutter GPU initialization fails because Impeller is not enabled, display a specific error message about enabling Impeller rather than the generic "Flutter GPU must be enabled" message.
…isabled Run gpu_test.dart with Impeller enabled but --enable-flutter-gpu omitted so the "Flutter GPU must be enabled" error message is also tested on CI.
The skip: parameter of test() is evaluated eagerly at registration time. When running with Impeller enabled but Flutter GPU disabled, accessing gpu.gpuContext in skip expressions throws an unhandled exception that crashes the entire test runner. Add flutterGpuEnabled guards so the expression short-circuits before accessing the context.
All tests that use gpu.gpuContext require both Impeller and Flutter GPU to be enabled. Update skip conditions from `!impellerEnabled` to `!impellerEnabled || !flutterGpuEnabled` so tests are properly skipped when running with Impeller enabled but Flutter GPU disabled. Also fix the first error message test to not fail when Impeller is enabled but Flutter GPU is disabled.
a697290 to
8d3b79c
Compare
gaaclarke
left a comment
There was a problem hiding this comment.
slight change requested, otherwise looks good
| final int alignment = gpu.gpuContext.minimumUniformByteAlignment; | ||
| expect(alignment, greaterThanOrEqualTo(16)); | ||
| }, skip: !impellerEnabled); | ||
| }, skip: !impellerEnabled || !flutterGpuEnabled); |
There was a problem hiding this comment.
Can you switch these to !(impellerEnabled && flutterGpuEnabled) using de morgan's law? That's a lot more clear to me.
…183986) When Flutter GPU initialization fails because Impeller is not enabled, display a specific error message about enabling Impeller rather than the generic "Flutter GPU must be enabled" message. Resolves flutter#173648
When Flutter GPU initialization fails because Impeller is not enabled, display a specific error message about enabling Impeller rather than the generic "Flutter GPU must be enabled" message.
Resolves #173648