diff --git a/impeller/renderer/backend/vulkan/BUILD.gn b/impeller/renderer/backend/vulkan/BUILD.gn index ae2c71be87ca8..cd20c993d3e69 100644 --- a/impeller/renderer/backend/vulkan/BUILD.gn +++ b/impeller/renderer/backend/vulkan/BUILD.gn @@ -114,7 +114,7 @@ impeller_component("vulkan") { "//third_party/vulkan_memory_allocator", ] - if (enable_vulkan_validation_layers) { + if (impeller_enable_vulkan_validation_layers) { defines = [ "IMPELLER_ENABLE_VULKAN_VALIDATION_LAYERS" ] } } diff --git a/impeller/tools/impeller.gni b/impeller/tools/impeller.gni index f30b68556524e..f2d33b0c28e4a 100644 --- a/impeller/tools/impeller.gni +++ b/impeller/tools/impeller.gni @@ -47,6 +47,11 @@ declare_args() { } declare_args() { + # Wether to build and include the validation layers. + impeller_enable_vulkan_validation_layers = + impeller_enable_vulkan && flutter_runtime_mode == "debug" && + target_cpu == "arm64" + # Whether Impeller supports rendering on the platform. impeller_supports_rendering = impeller_enable_metal || impeller_enable_opengles || diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 49d833339ef73..06e4c9de02985 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -490,7 +490,7 @@ action("android_jar") { ":pom_libflutter", ] - if (enable_vulkan_validation_layers) { + if (impeller_enable_vulkan_validation_layers) { assert(impeller_enable_vulkan) # We use a different toolchain here so that vulkan validation layers are diff --git a/tools/gn b/tools/gn index c80590bd67d60..5b481d6f33129 100755 --- a/tools/gn +++ b/tools/gn @@ -646,10 +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 or (args.enable_impeller_vulkan and - runtime_mode == 'debug' and - gn_args['target_cpu'] == 'arm64'): + if enable_vulkan_validation: gn_args['enable_vulkan_validation_layers'] = True + gn_args['impeller_enable_vulkan_validation_layers'] = True # Enable pointer compression on 64-bit mobile targets. iOS is excluded due to # its inability to allocate address space without allocating memory.