|
Ream v0.1.0-1
C++ graphics library for Linux
|
Vulkan backend implementation of RDevice. More...
#include <RVKDevice.h>
Inheritance diagram for RVKDevice:Public Member Functions | |
| void | wait () noexcept override |
| Blocks until the device has finished all pending work. | |
| sk_sp< GrDirectContext > | skContext () const noexcept |
| Returns the calling thread's Skia (Ganesh) Vulkan context. | |
| std::mutex & | queueMutex () const noexcept |
| Serializes access to the shared VkQueue. | |
| UInt32 | findMemoryType (UInt32 typeBits, VkMemoryPropertyFlags props) const noexcept |
| Selects a memory type index satisfying the given requirements and property flags. | |
| bool | immediateSubmit (const std::function< void(VkCommandBuffer)> &record) const noexcept |
| Records and synchronously submits a one-shot command buffer on the graphics queue. | |
| bool | submitCommand (VkCommandBuffer cmd) const noexcept |
| Submits an already-recorded command buffer, consuming pending waits, and blocks until it completes. Used by RVKPainter::flush. | |
| bool | submitCommandAsync (VkCommandBuffer cmd, VkFence fence, std::vector< VkSemaphore > &ownedWaitsOut, VkSemaphore signal=VK_NULL_HANDLE) const noexcept |
Submits an already-recorded command buffer signalling fence, consuming pending waits, WITHOUT blocking. The caller tracks completion via fence (typically pairing with deferDestroy() so CPU/GPU can pipeline). Used by RVKPainter::flush. | |
| void | deferDestroy (VkFence fence, std::function< void()> cleanup) const noexcept |
Registers a cleanup to run once fence is signalled (deferred/GPU-safe destruction). | |
| void | queueWait (VkSemaphore semaphore, bool owned) const noexcept |
| Queues a semaphore for the next queue submission to wait on. | |
| bool | submitSignal (VkSemaphore semaphore, VkFence fence) const noexcept |
Empty queue submission that signals semaphore (and optional fence) after all prior queue work. | |
Public Member Functions inherited from RDevice | |
| ~RDevice () noexcept | |
| Destructor. | |
| int | drmFd () const noexcept |
| Returns the primary DRM file descriptor. | |
| int | drmFdReadOnly () const noexcept |
| Returns the read-only DRM file descriptor. | |
| void * | drmUserData () const noexcept |
| Returns the user data associated with the DRM device. | |
| dev_t | id () const noexcept |
| Returns the device id (dev_t) of the DRM node. | |
| const std::string & | drmNode () const noexcept |
| Returns the path of the DRM node. | |
| const std::string & | drmDriverName () const noexcept |
| Returns the DRM driver name. | |
| RDriver | drmDriver () const noexcept |
| Returns the detected DRM driver. | |
| RCore & | core () const noexcept |
| Returns the RCore instance that owns this device. | |
| RGLDevice * | asGL () noexcept |
| Attempts to cast this device to an RGLDevice. | |
| RRSDevice * | asRS () noexcept |
| Attempts to cast this device to an RRSDevice. | |
| RVKDevice * | asVK () noexcept |
| Attempts to cast this device to an RVKDevice. | |
| const Caps & | caps () const noexcept |
| Returns the capabilities of this device. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Additional Inherited Members | |
Public Attributes inherited from RDevice | |
| CZLogger | log { RLog } |
| Logger for messages related to this device. | |
Vulkan backend implementation of RDevice.
Wraps a single VkPhysicalDevice/VkDevice and its graphics queue, and owns the resources shared across the backend: the painter pipeline cache, per-thread Skia (Ganesh) contexts, a queue mutex serializing submissions, and a fence-tracked deferred-destruction queue enabling asynchronous, non-blocking command submission.
Obtained by downcasting an RDevice via RDevice::asVK().
|
overridevirtualnoexcept |
Blocks until the device has finished all pending work.
Implements RDevice.
|
noexcept |
Returns the calling thread's Skia (Ganesh) Vulkan context.
GrDirectContext is not thread-safe, so a separate context is lazily created per thread, all sharing this device's VkDevice/VkQueue and memory allocator.
|
inlinenoexcept |
Serializes access to the shared VkQueue.
VkQueue submission and vkDeviceWaitIdle require external synchronization.
|
noexcept |
Selects a memory type index satisfying the given requirements and property flags.
|
noexcept |
Records and synchronously submits a one-shot command buffer on the graphics queue.
Serialized via queueMutex() and blocks until the GPU finishes (fence wait). Used for pixel uploads/downloads and layout transitions.
|
noexcept |
Submits an already-recorded command buffer, consuming pending waits, and blocks until it completes. Used by RVKPainter::flush.
|
noexcept |
Submits an already-recorded command buffer signalling fence, consuming pending waits, WITHOUT blocking. The caller tracks completion via fence (typically pairing with deferDestroy() so CPU/GPU can pipeline). Used by RVKPainter::flush.
Owned pending-wait semaphores consumed by this submission are appended to ownedWaitsOut; the caller must destroy them once fence signals (e.g. inside its deferDestroy cleanup).
If signal is not VK_NULL_HANDLE it is signalled on completion (e.g. a swapchain present semaphore that vkQueuePresentKHR waits on), so present need not block the CPU.
|
noexcept |
Registers a cleanup to run once fence is signalled (deferred/GPU-safe destruction).
The fence is destroyed after the cleanup runs. Drained by clearGarbage() (called by the compositor each frame) and fully flushed at device destruction.
|
noexcept |
Queues a semaphore for the next queue submission to wait on.
Used by RVKSync::gpuWait so that subsequent GPU work on this device waits for the sync. If owned is true the semaphore is destroyed once consumed by a submission.
|
noexcept |
Empty queue submission that signals semaphore (and optional fence) after all prior queue work.
Backs RVKSync::Make (captures "all previously submitted work on this device").