Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ]
}
}
5 changes: 5 additions & 0 deletions impeller/tools/impeller.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have both enable_vulkan_validation_layers and impeller_enable_vulkan_validation_layers?

Or rather, what's the difference between impeller_enable_vulkan_validation_layers and (enable_impeller_vulkan && enable_vulkan_validation_layers)

(Not sure that enable_impeller_vulkan is the right spelling, but there's probably something we already have that could go there?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_vulkan_validation_layers is for the fuchsia code, impeller_enable_vulkan_validation_layers is for impeller. There is also a angle_enable_vulkan_validation_layers. enable_vulkan_validation_layers predates impeller. I tried to share the variables. That's how it was previously, but we need a different default value. That's why we need a different variable here.


# Enable pointer compression on 64-bit mobile targets. iOS is excluded due to
# its inability to allocate address space without allocating memory.
Expand Down