Unverified Commit 7d31fe32 authored by Chinmay Garde's avatar Chinmay Garde Committed by GitHub

[Impeller] Plumb through the enable-vulkan-validation flag. (#123808)

[Impeller] Plumb through the enable-vulkan-validation flag.
parent d163620f
...@@ -660,6 +660,8 @@ class AndroidDevice extends Device { ...@@ -660,6 +660,8 @@ class AndroidDevice extends Device {
...<String>['--ez', 'enable-impeller', 'true'], ...<String>['--ez', 'enable-impeller', 'true'],
if (debuggingOptions.enableImpeller == ImpellerStatus.disabled) if (debuggingOptions.enableImpeller == ImpellerStatus.disabled)
...<String>['--ez', 'enable-impeller', 'false'], ...<String>['--ez', 'enable-impeller', 'false'],
if (debuggingOptions.enableVulkanValidation)
...<String>['--ez', 'enable-vulkan-validation', 'true'],
if (debuggingOptions.debuggingEnabled) ...<String>[ if (debuggingOptions.debuggingEnabled) ...<String>[
if (debuggingOptions.buildInfo.isDebug) ...<String>[ if (debuggingOptions.buildInfo.isDebug) ...<String>[
...<String>['--ez', 'enable-checked-mode', 'true'], ...<String>['--ez', 'enable-checked-mode', 'true'],
......
...@@ -183,6 +183,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment ...@@ -183,6 +183,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
addAndroidSpecificBuildOptions(hide: !verboseHelp); addAndroidSpecificBuildOptions(hide: !verboseHelp);
usesFatalWarningsOption(verboseHelp: verboseHelp); usesFatalWarningsOption(verboseHelp: verboseHelp);
addEnableImpellerFlag(verboseHelp: verboseHelp); addEnableImpellerFlag(verboseHelp: verboseHelp);
addEnableVulkanValidationFlag(verboseHelp: verboseHelp);
addEnableEmbedderApiFlag(verboseHelp: verboseHelp); addEnableEmbedderApiFlag(verboseHelp: verboseHelp);
} }
...@@ -196,6 +197,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment ...@@ -196,6 +197,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
bool get runningWithPrebuiltApplication => argResults![FlutterOptions.kUseApplicationBinary] != null; bool get runningWithPrebuiltApplication => argResults![FlutterOptions.kUseApplicationBinary] != null;
bool get trackWidgetCreation => boolArg('track-widget-creation'); bool get trackWidgetCreation => boolArg('track-widget-creation');
ImpellerStatus get enableImpeller => ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?); ImpellerStatus get enableImpeller => ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?);
bool get enableVulkanValidation => boolArg('enable-vulkan-validation');
bool get uninstallFirst => boolArg('uninstall-first'); bool get uninstallFirst => boolArg('uninstall-first');
bool get enableEmbedderApi => boolArg('enable-embedder-api'); bool get enableEmbedderApi => boolArg('enable-embedder-api');
...@@ -237,6 +239,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment ...@@ -237,6 +239,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
webBrowserDebugPort: webBrowserDebugPort, webBrowserDebugPort: webBrowserDebugPort,
webBrowserFlags: webBrowserFlags, webBrowserFlags: webBrowserFlags,
enableImpeller: enableImpeller, enableImpeller: enableImpeller,
enableVulkanValidation: enableVulkanValidation,
uninstallFirst: uninstallFirst, uninstallFirst: uninstallFirst,
enableDartProfiling: enableDartProfiling, enableDartProfiling: enableDartProfiling,
enableEmbedderApi: enableEmbedderApi, enableEmbedderApi: enableEmbedderApi,
...@@ -285,6 +288,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment ...@@ -285,6 +288,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
nullAssertions: boolArg('null-assertions'), nullAssertions: boolArg('null-assertions'),
nativeNullAssertions: boolArg('native-null-assertions'), nativeNullAssertions: boolArg('native-null-assertions'),
enableImpeller: enableImpeller, enableImpeller: enableImpeller,
enableVulkanValidation: enableVulkanValidation,
uninstallFirst: uninstallFirst, uninstallFirst: uninstallFirst,
serveObservatory: boolArg('serve-observatory'), serveObservatory: boolArg('serve-observatory'),
enableDartProfiling: enableDartProfiling, enableDartProfiling: enableDartProfiling,
......
...@@ -965,6 +965,7 @@ class DebuggingOptions { ...@@ -965,6 +965,7 @@ class DebuggingOptions {
this.nullAssertions = false, this.nullAssertions = false,
this.nativeNullAssertions = false, this.nativeNullAssertions = false,
this.enableImpeller = ImpellerStatus.platformDefault, this.enableImpeller = ImpellerStatus.platformDefault,
this.enableVulkanValidation = false,
this.uninstallFirst = false, this.uninstallFirst = false,
this.serveObservatory = false, this.serveObservatory = false,
this.enableDartProfiling = true, this.enableDartProfiling = true,
...@@ -986,6 +987,7 @@ class DebuggingOptions { ...@@ -986,6 +987,7 @@ class DebuggingOptions {
this.cacheSkSL = false, this.cacheSkSL = false,
this.traceAllowlist, this.traceAllowlist,
this.enableImpeller = ImpellerStatus.platformDefault, this.enableImpeller = ImpellerStatus.platformDefault,
this.enableVulkanValidation = false,
this.uninstallFirst = false, this.uninstallFirst = false,
this.enableDartProfiling = true, this.enableDartProfiling = true,
this.enableEmbedderApi = false, this.enableEmbedderApi = false,
...@@ -1059,6 +1061,7 @@ class DebuggingOptions { ...@@ -1059,6 +1061,7 @@ class DebuggingOptions {
required this.nullAssertions, required this.nullAssertions,
required this.nativeNullAssertions, required this.nativeNullAssertions,
required this.enableImpeller, required this.enableImpeller,
required this.enableVulkanValidation,
required this.uninstallFirst, required this.uninstallFirst,
required this.serveObservatory, required this.serveObservatory,
required this.enableDartProfiling, required this.enableDartProfiling,
...@@ -1098,6 +1101,7 @@ class DebuggingOptions { ...@@ -1098,6 +1101,7 @@ class DebuggingOptions {
final bool webUseSseForDebugBackend; final bool webUseSseForDebugBackend;
final bool webUseSseForInjectedClient; final bool webUseSseForInjectedClient;
final ImpellerStatus enableImpeller; final ImpellerStatus enableImpeller;
final bool enableVulkanValidation;
final bool serveObservatory; final bool serveObservatory;
final bool enableDartProfiling; final bool enableDartProfiling;
final bool enableEmbedderApi; final bool enableEmbedderApi;
...@@ -1230,6 +1234,7 @@ class DebuggingOptions { ...@@ -1230,6 +1234,7 @@ class DebuggingOptions {
'nullAssertions': nullAssertions, 'nullAssertions': nullAssertions,
'nativeNullAssertions': nativeNullAssertions, 'nativeNullAssertions': nativeNullAssertions,
'enableImpeller': enableImpeller.asBool, 'enableImpeller': enableImpeller.asBool,
'enableVulkanValidation': enableVulkanValidation,
'serveObservatory': serveObservatory, 'serveObservatory': serveObservatory,
'enableDartProfiling': enableDartProfiling, 'enableDartProfiling': enableDartProfiling,
'enableEmbedderApi': enableEmbedderApi, 'enableEmbedderApi': enableEmbedderApi,
...@@ -1278,6 +1283,7 @@ class DebuggingOptions { ...@@ -1278,6 +1283,7 @@ class DebuggingOptions {
nullAssertions: json['nullAssertions']! as bool, nullAssertions: json['nullAssertions']! as bool,
nativeNullAssertions: json['nativeNullAssertions']! as bool, nativeNullAssertions: json['nativeNullAssertions']! as bool,
enableImpeller: ImpellerStatus.fromBool(json['enableImpeller'] as bool?), enableImpeller: ImpellerStatus.fromBool(json['enableImpeller'] as bool?),
enableVulkanValidation: (json['enableVulkanValidation'] as bool?) ?? false,
uninstallFirst: (json['uninstallFirst'] as bool?) ?? false, uninstallFirst: (json['uninstallFirst'] as bool?) ?? false,
serveObservatory: (json['serveObservatory'] as bool?) ?? false, serveObservatory: (json['serveObservatory'] as bool?) ?? false,
enableDartProfiling: (json['enableDartProfiling'] as bool?) ?? true, enableDartProfiling: (json['enableDartProfiling'] as bool?) ?? true,
......
...@@ -1060,6 +1060,15 @@ abstract class FlutterCommand extends Command<void> { ...@@ -1060,6 +1060,15 @@ abstract class FlutterCommand extends Command<void> {
); );
} }
void addEnableVulkanValidationFlag({required bool verboseHelp}) {
argParser.addFlag('enable-vulkan-validation',
hide: !verboseHelp,
help: 'Enable vulkan validation on the Impeller rendering backend if '
'Vulkan is in use and the validation layers are available to the '
'application.',
);
}
void addEnableEmbedderApiFlag({required bool verboseHelp}) { void addEnableEmbedderApiFlag({required bool verboseHelp}) {
argParser.addFlag('enable-embedder-api', argParser.addFlag('enable-embedder-api',
hide: !verboseHelp, hide: !verboseHelp,
......
...@@ -1050,6 +1050,7 @@ void main() { ...@@ -1050,6 +1050,7 @@ void main() {
'--null-assertions', '--null-assertions',
'--native-null-assertions', '--native-null-assertions',
'--enable-impeller', '--enable-impeller',
'--enable-vulkan-validation',
'--trace-systrace', '--trace-systrace',
'--enable-software-rendering', '--enable-software-rendering',
'--skia-deterministic-rendering', '--skia-deterministic-rendering',
...@@ -1068,6 +1069,7 @@ void main() { ...@@ -1068,6 +1069,7 @@ void main() {
expect(options.nativeNullAssertions, true); expect(options.nativeNullAssertions, true);
expect(options.traceSystrace, true); expect(options.traceSystrace, true);
expect(options.enableImpeller, ImpellerStatus.enabled); expect(options.enableImpeller, ImpellerStatus.enabled);
expect(options.enableVulkanValidation, true);
expect(options.enableSoftwareRendering, true); expect(options.enableSoftwareRendering, true);
expect(options.skiaDeterministicRendering, true); expect(options.skiaDeterministicRendering, true);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment