5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
8 #include <condition_variable>
14 #include "flutter/fml/closure.h"
15 #include "flutter/fml/status.h"
23 using WaitSet = std::vector<std::shared_ptr<WaitSetEntry>>;
38 vk::UniqueFence fence,
39 const std::function<fml::Status(vk::Fence)>& submit_callback,
40 fml::closure completion_callback);
45 std::weak_ptr<DeviceHolderVK> device_holder_;
46 std::unique_ptr<std::thread> waiter_thread_;
47 std::mutex wait_set_mutex_;
48 std::condition_variable wait_set_cv_;
50 bool terminate_ =
false;
52 explicit FenceWaiterVK(std::weak_ptr<DeviceHolderVK> device_holder);
57 void WaitUntilEmpty();
fml::Status AddFence(vk::UniqueFence fence, const std::function< fml::Status(vk::Fence)> &submit_callback, fml::closure completion_callback)
Invokes the [submit_callback] synchronously and adds the fence to the wait set if it succeeds....
bool Main(const fml::CommandLine &command_line)
std::vector< std::shared_ptr< WaitSetEntry > > WaitSet