|
ngscopeclient v0.2
|
Wrapper around a Vulkan Queue object. More...
#include <QueueHandle.h>
Public Member Functions | |
| QueueHandle (std::shared_ptr< QueueWrapper > &queue, const std::string &name) | |
| void | Submit (vk::raii::CommandBuffer const &cmdBuf) |
| Submit the given command buffer on the queue. | |
| void | SubmitAndBlock (vk::raii::CommandBuffer const &cmdBuf) |
| Submit the given command buffer on the queue and wait until completion. | |
| const std::string | GetName () const |
| template<class T > | |
| void | MarkScratchBufferUsed (T &buf) |
| Mark a scratch buffer as in use by command buffers pending for this queue. | |
| void | WaitIdle () |
| Wait for all previous submits to complete. | |
| bool | WaitIdleWithTimeout (uint64_t nanoseconds) |
| Wait for previous submits to complete, but only up to a timeout. | |
| std::shared_ptr< QueueWrapper > | GetQueue () |
| QueueHandle (QueueHandle const &)=delete | |
| QueueHandle & | operator= (QueueHandle const &)=delete |
Protected Member Functions | |
| void | _waitFence () |
Protected Attributes | |
| friend | QueueLock |
| std::shared_ptr< QueueWrapper > | m_queue |
| std::unique_ptr< vk::raii::Fence > | m_fence |
| bool | m_fenceBusy |
| std::string | m_fenceName |
| std::recursive_mutex | m_fenceMutex |
| The mutex controlling access to the fence. | |
| std::set< std::unique_ptr< ScratchBufferBase > > | m_usedScratchBuffers |
| Scratch buffers used by jobs in the queue. | |
Wrapper around a Vulkan Queue object.
Many QueueHandle's can point to a single QueueWrapper and are thread safe, but a single QueueHandle cannot be used from more than one thread simultaneously.
TODO: how does this play with g_vkTransferQueue? for now keep a lock on the fence for that use case
|
protected |
Waits for previous submit's fence, if any, then resets the fence for reuse. Must obtain the lock before calling!
Mark a scratch buffer as in use by command buffers pending for this queue.
This prevents other filters from using the buffer until the fence completes
(Implementation is in ScratchBufferManager.h)
Wait for previous submits to complete, but only up to a timeout.