Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
fence_waiter_vk.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
6
#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
7
8
#include <condition_variable>
9
#include <functional>
10
#include <memory>
11
#include <thread>
12
#include <vector>
13
14
#include "
flutter/fml/closure.h
"
15
#include "
flutter/fml/status.h
"
16
#include "
impeller/renderer/backend/vulkan/device_holder_vk.h
"
17
18
namespace
impeller
{
19
20
class
ContextVK;
21
class
WaitSetEntry;
22
23
using
WaitSet
= std::vector<std::shared_ptr<WaitSetEntry>>;
24
25
class
FenceWaiterVK
{
26
public
:
27
~FenceWaiterVK
();
28
29
bool
IsValid
()
const
;
30
31
void
Terminate
();
32
33
/// @brief Invokes the [submit_callback] synchronously and adds the fence to
34
/// the wait set if it succeeds. The [completion_callback] will be
35
/// called when the submitted command completes and the fence is
36
/// signaled.
37
fml::Status
AddFence
(
38
vk::UniqueFence fence,
39
const
std::function<
fml::Status
(vk::Fence)>& submit_callback,
40
fml::closure
completion_callback);
41
42
private
:
43
friend
class
ContextVK
;
44
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_;
49
WaitSet
wait_set_;
50
bool
terminate_ =
false
;
51
52
explicit
FenceWaiterVK
(std::weak_ptr<DeviceHolderVK> device_holder);
53
54
void
Main();
55
56
bool
Wait();
57
void
WaitUntilEmpty();
58
59
FenceWaiterVK
(
const
FenceWaiterVK
&) =
delete
;
60
61
FenceWaiterVK
& operator=(
const
FenceWaiterVK
&) =
delete
;
62
};
63
64
}
// namespace impeller
65
66
#endif
// FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
fml::Status
Definition
status.h:35
impeller::ContextVK
Definition
context_vk.h:66
impeller::FenceWaiterVK
Definition
fence_waiter_vk.h:25
impeller::FenceWaiterVK::Terminate
void Terminate()
Definition
fence_waiter_vk.cc:213
impeller::FenceWaiterVK::AddFence
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....
Definition
fence_waiter_vk.cc:63
impeller::FenceWaiterVK::~FenceWaiterVK
~FenceWaiterVK()
Definition
fence_waiter_vk.cc:59
impeller::FenceWaiterVK::IsValid
bool IsValid() const
closure.h
device_holder_vk.h
fml::closure
std::function< void()> closure
Definition
closure.h:14
impeller
Definition
texture.h:16
impeller::WaitSet
std::vector< std::shared_ptr< WaitSetEntry > > WaitSet
Definition
fence_waiter_vk.h:23
status.h
impeller
renderer
backend
vulkan
fence_waiter_vk.h
Generated on Sun Jul 5 2026 07:45:16 for Flutter Engine Uber Docs by
1.9.8