Skip to content

Commit

Permalink
[Impeller] moved validation layers on by default logic to gni scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gaaclarke committed Sep 11, 2023
1 parent 0774ddc commit 27ad47c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
}
4 changes: 4 additions & 0 deletions impeller/tools/impeller.gni
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ declare_args() {
}

declare_args() {
# Wether to build and include the validation layers.
impeller_enable_vulkan_validation_layers =
impeller_enable_vulkan && flutter_runtime_mode == "debug"

# Whether Impeller supports rendering on the platform.
impeller_supports_rendering =
impeller_enable_metal || impeller_enable_opengles ||
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 27ad47c

Please sign in to comment.