From a50610328816900f90e3719f991dcddb65b94017 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 8 Feb 2024 13:37:38 -0800 Subject: [PATCH] Sever the //flutter/vulkan dependency in Flutter tester. (flutter/engine#50454) The previous code was setting up a proc table, then getting the address of the proc that was used to the setup that table, then setting up another proc table. Directly setup the final proc table and don't depend on //impeller/vulkan. Part of https://github.com/flutter/flutter/issues/143127 --- engine/src/flutter/shell/testing/tester_main.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/engine/src/flutter/shell/testing/tester_main.cc b/engine/src/flutter/shell/testing/tester_main.cc index c1d42a16bb..52f53f25f9 100644 --- a/engine/src/flutter/shell/testing/tester_main.cc +++ b/engine/src/flutter/shell/testing/tester_main.cc @@ -35,7 +35,6 @@ #if ALLOW_IMPELLER #include // nogncheck -#include "flutter/vulkan/procs/vulkan_proc_table.h" // nogncheck #include "impeller/entity/vk/entity_shaders_vk.h" // nogncheck #include "impeller/entity/vk/framebuffer_blend_shaders_vk.h" // nogncheck #include "impeller/entity/vk/modern_shaders_vk.h" // nogncheck @@ -69,7 +68,6 @@ static std::vector> ShaderLibraryMappings() { struct ImpellerVulkanContextHolder { ImpellerVulkanContextHolder() = default; ImpellerVulkanContextHolder(ImpellerVulkanContextHolder&&) = default; - fml::RefPtr vulkan_proc_table; std::shared_ptr context; std::shared_ptr surface_context; @@ -77,15 +75,8 @@ struct ImpellerVulkanContextHolder { }; bool ImpellerVulkanContextHolder::Initialize(bool enable_validation) { - vulkan_proc_table = - fml::MakeRefCounted(&vkGetInstanceProcAddr); - if (!vulkan_proc_table->NativeGetInstanceProcAddr()) { - FML_LOG(ERROR) << "Could not load Swiftshader library."; - return false; - } impeller::ContextVK::Settings context_settings; - context_settings.proc_address_callback = - vulkan_proc_table->NativeGetInstanceProcAddr(); + context_settings.proc_address_callback = &vkGetInstanceProcAddr; context_settings.shader_libraries_data = ShaderLibraryMappings(); context_settings.cache_directory = fml::paths::GetCachesDirectory(); context_settings.enable_validation = enable_validation;