From c64646b6e839996898dff1faa706905130fab865 Mon Sep 17 00:00:00 2001 From: George Wright Date: Thu, 30 Apr 2020 16:06:59 -0700 Subject: [PATCH] Bundle the validation layers and enable them if --enable-vulkan-validation-layers is specified to gn (flutter/engine#17854) --- .../platform/fuchsia/flutter/vulkan_surface_producer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc index a32d50e360..c7345d9163 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc @@ -63,9 +63,13 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) { std::vector extensions = { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; + + // On Fuchsia, the validation layers need to be packaged as part of the + // flutter_runner in order to work. As a result, we can use the presence + // of the layers to mean that we want the layers enabled. application_ = std::make_unique( *vk_, "FlutterRunner", std::move(extensions), VK_MAKE_VERSION(1, 0, 0), - VK_MAKE_VERSION(1, 1, 0)); + VK_MAKE_VERSION(1, 1, 0), true /* enable_validation_layers */); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the