[Impeller] Added helper messaging around validation usage (flutter/engine#42708)
Adds some helper messages around using validation layers. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -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") {
|
||||
@@ -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" ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user