[Impeller] turned on validations for all debug builds (flutter/engine#45350)
fixes https://github.com/flutter/flutter/issues/133794 This adds the following shared libraries to the flutter.jar for debug builds on arm64: ``` lib/arm64-v8a/libVkLayer_khronos_validation.so lib/arm64-v8a/libc++_shared.so ``` [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
2
DEPS
2
DEPS
@@ -261,7 +261,7 @@ allowed_hosts = [
|
||||
]
|
||||
|
||||
deps = {
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + '6b0243e97d94836767ea8b94a477d7d15ee3bb91',
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'b615dd6af4c2e95a388060151c7fd1e429e34d61',
|
||||
|
||||
# Fuchsia compatibility
|
||||
#
|
||||
|
||||
@@ -492,12 +492,15 @@ action("android_jar") {
|
||||
|
||||
if (enable_vulkan_validation_layers) {
|
||||
assert(impeller_enable_vulkan)
|
||||
deps += [ "//third_party/vulkan_validation_layers" ]
|
||||
apilevel26_toolchain = "//build/toolchain/android:clang_arm64_apilevel26"
|
||||
validation_layer_target =
|
||||
"//third_party/vulkan_validation_layers($apilevel26_toolchain)"
|
||||
validation_layer_out_dir =
|
||||
get_label_info(validation_layer_target, "root_out_dir")
|
||||
deps += [ validation_layer_target ]
|
||||
args += [
|
||||
"--native_lib",
|
||||
rebase_path("libVkLayer_khronos_validation.so",
|
||||
root_build_dir,
|
||||
root_build_dir),
|
||||
rebase_path("$validation_layer_out_dir/libVkLayer_khronos_validation.so"),
|
||||
]
|
||||
if (current_cpu == "arm64") {
|
||||
args += [
|
||||
|
||||
@@ -38,7 +38,12 @@ static std::shared_ptr<impeller::Context> CreateImpellerContext(
|
||||
settings.cache_directory = fml::paths::GetCachesDirectory();
|
||||
settings.enable_validation = enable_vulkan_validation;
|
||||
|
||||
FML_LOG(ERROR) << "Using the Impeller rendering backend (Vulkan).";
|
||||
if (settings.enable_validation) {
|
||||
FML_LOG(ERROR) << "Using the Impeller rendering backend (Vulkan with "
|
||||
"Validation Layers).";
|
||||
} else {
|
||||
FML_LOG(ERROR) << "Using the Impeller rendering backend (Vulkan).";
|
||||
}
|
||||
|
||||
return impeller::ContextVK::Create(std::move(settings));
|
||||
}
|
||||
|
||||
@@ -214,6 +214,13 @@ public class FlutterLoader {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean areValidationLayersOnByDefault() {
|
||||
if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
return Build.SUPPORTED_ABIS[0].equals("arm64-v8a");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blocks until initialization of the native system has completed.
|
||||
*
|
||||
@@ -324,7 +331,8 @@ public class FlutterLoader {
|
||||
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);
|
||||
|
||||
@@ -646,7 +646,9 @@ def to_gn_args(args):
|
||||
if args.unoptimized and args.target_os == 'android' and args.android_cpu == 'arm64':
|
||||
enable_vulkan_validation = True
|
||||
|
||||
if enable_vulkan_validation:
|
||||
if enable_vulkan_validation or (args.enable_impeller_vulkan and
|
||||
runtime_mode == 'debug' and
|
||||
gn_args['target_cpu'] == 'arm64'):
|
||||
gn_args['enable_vulkan_validation_layers'] = True
|
||||
if args.target_os == 'android':
|
||||
gn_args['android_api_level'] = 26
|
||||
|
||||
Reference in New Issue
Block a user