|
Ream v0.1.0-1
C++ graphics library for Linux
|
GPU/CPU synchronization fence. More...
#include <RSync.h>
Inheritance diagram for RSync:Public Member Functions | |
| virtual bool | gpuWait (RDevice *waiter=nullptr) const noexcept=0 |
| Inserts a GPU-side wait on this fence. | |
| virtual int | cpuWait (int timeoutMs=-1) const noexcept=0 |
| Blocks the calling thread until the fence is signaled. | |
| virtual CZSpFd | fd () const noexcept=0 |
Exports this fence as a sync_file file descriptor. | |
| bool | isExternal () const noexcept |
| Whether this sync was imported via FromExternal(). | |
| RDevice * | device () const noexcept |
| Returns the device this sync is associated with. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Static Public Member Functions | |
| static std::shared_ptr< RSync > | FromExternal (int fd, RDevice *device=nullptr) noexcept |
Imports an external sync_file fence. | |
| static std::shared_ptr< RSync > | Make (RDevice *device=nullptr) noexcept |
| Creates a new sync fence. | |
GPU/CPU synchronization fence.
RSync represents a point in a device's command stream, backed by a sync_file fence. It lets consumers wait for prior GPU work to complete before reading or overwriting a resource, without stalling unnecessarily.
A sync can be waited on the GPU (gpuWait(), inserting a dependency into a device's next submission) or on the CPU (cpuWait()). Because it is expressed as a sync_file fd, it can be exported and imported (fd(), RSync::FromExternal()) to interoperate with other devices, clients, and DRM sync objects. Images publish their read/write syncs automatically as rendering proceeds.
Imports an external sync_file fence.
| fd | A sync_file file descriptor. Ownership is taken even on failure. |
| device | Device to associate the sync with. If nullptr, the main device is used. |
Creates a new sync fence.
| device | Device to create the sync on. If nullptr, the main device is used. |
|
pure virtualnoexcept |
Inserts a GPU-side wait on this fence.
Non-blocking. Makes the waiter's next submission depend on this fence being signaled.
| waiter | Device that must wait. If nullptr, the main device is used. |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
inlinenoexcept |
Whether this sync was imported via FromExternal().
|
inlinenoexcept |
Returns the device this sync is associated with.