Flutter Engine
The Flutter Engine
FenceSync.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef FenceSync_DEFINED
9#define FenceSync_DEFINED
10
12
13namespace sk_gpu_test {
14
15using PlatformFence = uint64_t;
16static constexpr PlatformFence kInvalidFence = 0;
17
18/*
19 * This class provides an interface to interact with fence syncs. A fence sync is an object that the
20 * client can insert into the GPU command stream, and then at any future time, wait until all
21 * commands that were issued before the fence have completed.
22 */
23class FenceSync {
24public:
25 [[nodiscard]] virtual PlatformFence insertFence() const = 0;
26 virtual bool waitFence(PlatformFence) const = 0;
27 virtual void deleteFence(PlatformFence) const = 0;
28
29 virtual bool validate() const { return true; }
30
31 virtual ~FenceSync() {}
32};
33
34} // namespace sk_gpu_test
35
36#endif
virtual ~FenceSync()
Definition: FenceSync.h:31
virtual bool waitFence(PlatformFence) const =0
virtual void deleteFence(PlatformFence) const =0
virtual PlatformFence insertFence() const =0
virtual bool validate() const
Definition: FenceSync.h:29
static constexpr PlatformFence kInvalidFence
Definition: FenceSync.h:16
uint64_t PlatformFence
Definition: FenceSync.h:15