Skip to content

Commit

Permalink
[Impeller] turned on validations for all debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
gaaclarke committed Aug 31, 2023
1 parent ca513c9 commit 639425d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ action("android_jar") {
":pom_libflutter",
]

if (enable_vulkan_validation_layers) {
if (enable_vulkan_validation_layers ||
(impeller_enable_vulkan && current_cpu == "arm64" &&
flutter_runtime_mode == "debug")) {
assert(impeller_enable_vulkan)
deps += [ "//third_party/vulkan_validation_layers" ]
args += [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ public InitResult call() {
}
}

private static boolean areValidationLayersOnByDefault() {
if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return Build.SUPPORTED_ABIS[0] == "arm64-v8a";
}
return false;
}

/**
* Blocks until initialization of the native system has completed.
*
Expand Down Expand Up @@ -324,7 +331,8 @@ public void ensureInitializationComplete(
if (metaData.getBoolean(ENABLE_IMPELLER_META_DATA_KEY, false)) {
shellArgs.add("--enable-impeller");
}
if (metaData.getBoolean(ENABLE_VULKAN_VALIDATION_META_DATA_KEY, false)) {
if (metaData.getBoolean(
ENABLE_VULKAN_VALIDATION_META_DATA_KEY, areValidationLayersOnByDefault())) {
shellArgs.add("--enable-vulkan-validation");
}
String backend = metaData.getString(IMPELLER_BACKEND_META_DATA_KEY);
Expand Down

0 comments on commit 639425d

Please sign in to comment.