Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Added helper messaging around validation usage #42708

Merged
merged 6 commits into from
Jun 9, 2023
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
5 changes: 5 additions & 0 deletions impeller/renderer/backend/vulkan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/vulkan/config.gni")
import("../../../tools/impeller.gni")

impeller_component("vulkan_unittests") {
Expand Down Expand Up @@ -96,4 +97,8 @@ impeller_component("vulkan") {
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
"//third_party/vulkan_memory_allocator",
]

if (enable_vulkan_validation_layers) {
defines = [ "IMPELLER_ENABLE_VULKAN_VALIDATION_LAYERS" ]
}
}
11 changes: 11 additions & 0 deletions impeller/renderer/backend/vulkan/context_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ void ContextVK::Setup(Settings settings) {

vk::InstanceCreateInfo instance_info;
if (caps->AreValidationsEnabled()) {
std::stringstream ss;
ss << "Enabling validation layers, features: [";
for (const auto& validation : enabled_validations) {
ss << vk::to_string(validation) << " ";
}
ss << "]";
FML_LOG(ERROR) << ss.str();
#if !defined(IMPELLER_ENABLE_VULKAN_VALIDATION_LAYERS) && FML_OS_ANDROID
FML_LOG(ERROR) << "Vulkan validation layers turned on but the gn argument "
"`--enable-vulkan-validation-layers` is missing.";
#endif
instance_info.pNext = &validation;
}
instance_info.setPEnabledLayerNames(enabled_layers_c);
Expand Down