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

Conversation

@matanlurey
Copy link
Contributor

Context:

@matanlurey:
Would it make sense for --unopt to imply --enable-vulkan-validation-layers if --enable-vulkan is set?
The reason I ask is because it does seem to imply glGetError checks, which (I could be wrong) is roughly similar?

@chinmaygarde:
Makes sense.

... so uh, here it is (let me know if we prefer anything different).

@matanlurey matanlurey requested a review from chinmaygarde July 27, 2023 00:52
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

Unlike the glGetError, to see Vulkan validation errors I believe you'll need to opt in from the AndroidManifest. Maybe we should also update context_vk.cc to also automatically enabled vulkan validation in unopt modes?

@jonahwilliams
Copy link
Contributor

Copy link
Contributor

@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.

As @jonahwilliams pointed out, if we request validation but the layers are absent, we will terminate context setup and eventually abort shell setup.

I think requiring validation in unopt modes without other guidance on how to setup validation layers puts an onerous burden on unopt engine tinkerers who might not care about Vulkan at all.

Perhaps we can relax the restriction to just log (loudly) that validations were requested but the layers weren't found but still continue with context setup? You can change the validation log to an error log there and not return nullopt.

Otherwise LGTM.

tools/gn Outdated

if args.enable_impeller_vulkan:
gn_args['impeller_enable_vulkan'] = True
# As of 2023-07-26, --unopt adds "glGetError" calls for the OpenGL backend,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this comment adds anything. For the context as of 07/26, we have git. Your call on whether to keep this though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, removed!

@jonahwilliams
Copy link
Contributor

What I mean is sort of the opposite though. It's fine to compile in validation layers, but they won't do anything without a separate step to opt in. Maybe we should make that second part automatic too?

@chinmaygarde
Copy link
Contributor

It's fine to compile in validation layers...

I believe validation layers can be added to the Vulkan loader from a separate APK too. I'm afraid having some Vulkan debugging related APK installed would enable validation on Flutter apps automatically. But perhaps I am overthinking it? Maybe we should just enable it for now and deal with it later. Having validations on with the least overhead possible is going to be super valuable in the short run.

@matanlurey matanlurey marked this pull request as draft July 27, 2023 17:04
@matanlurey
Copy link
Contributor Author

Sounds good, thanks all.

I'm setting up a test phone so I can use AGI to make sure I'm doing this all correctly - I'll convert back from a draft PR when it's ready for review!

@chinmaygarde chinmaygarde changed the title Set 'enable_vulkan_validation_layers' if --unopt and Vulkan is enabled. [Impeller] Set 'enable_vulkan_validation_layers' if --unopt and Vulkan is enabled. Jul 27, 2023
@matanlurey
Copy link
Contributor Author

Done and verified! Woot!

Screenshot 2023-07-27 at 1 33 46 PM

@matanlurey matanlurey marked this pull request as ready for review July 27, 2023 21:24
@matanlurey matanlurey merged commit 4d94723 into flutter:main Jul 28, 2023
@matanlurey matanlurey deleted the enable-vulkan-validation-if-unopt branch July 28, 2023 05:48
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 28, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 28, 2023
flutter/engine@dc8618d...cfa5427

2023-07-28 skia-flutter-autoroll@skia.org Roll Dart SDK from aab0233f76b7 to 1b85515a995b (1 revision) (flutter/engine#44096)
2023-07-28 matanlurey@users.noreply.github.com [Impeller] Set 'enable_vulkan_validation_layers' if --unopt and Vulkan is enabled. (flutter/engine#44055)
2023-07-28 skia-flutter-autoroll@skia.org Roll Skia from f2362d22abcf to 8739fd6d422c (1 revision) (flutter/engine#44095)

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 jonahwilliams@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…1464)

flutter/engine@dc8618d...cfa5427

2023-07-28 skia-flutter-autoroll@skia.org Roll Dart SDK from aab0233f76b7 to 1b85515a995b (1 revision) (flutter/engine#44096)
2023-07-28 matanlurey@users.noreply.github.com [Impeller] Set 'enable_vulkan_validation_layers' if --unopt and Vulkan is enabled. (flutter/engine#44055)
2023-07-28 skia-flutter-autoroll@skia.org Roll Skia from f2362d22abcf to 8739fd6d422c (1 revision) (flutter/engine#44095)

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 jonahwilliams@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
…1464)

flutter/engine@dc8618d...cfa5427

2023-07-28 skia-flutter-autoroll@skia.org Roll Dart SDK from aab0233f76b7 to 1b85515a995b (1 revision) (flutter/engine#44096)
2023-07-28 matanlurey@users.noreply.github.com [Impeller] Set 'enable_vulkan_validation_layers' if --unopt and Vulkan is enabled. (flutter/engine#44055)
2023-07-28 skia-flutter-autoroll@skia.org Roll Skia from f2362d22abcf to 8739fd6d422c (1 revision) (flutter/engine#44095)

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 jonahwilliams@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…n is enabled. (flutter#44055)

Context:

> @matanlurey:
> Would it make sense for `--unopt` to imply
`--enable-vulkan-validation-layers` if `--enable-vulkan` is set?
> The reason I ask is because it does seem to imply `glGetError` checks,
which (I could be wrong) is roughly similar?

> @chinmaygarde:
> Makes sense.

... so uh, here it is (let me know if we prefer anything different).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants