ngscopeclient v0.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QueueHandle Class Reference

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< QueueWrapperGetQueue ()
 
 QueueHandle (QueueHandle const &)=delete
 
QueueHandleoperator= (QueueHandle const &)=delete
 

Protected Member Functions

void _waitFence ()
 

Protected Attributes

friend QueueLock
 
std::shared_ptr< QueueWrapperm_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.
 

Detailed Description

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

Member Function Documentation

◆ _waitFence()

void QueueHandle::_waitFence ( )
protected

Waits for previous submit's fence, if any, then resets the fence for reuse. Must obtain the lock before calling!

◆ MarkScratchBufferUsed()

template<class T >
void QueueHandle::MarkScratchBufferUsed ( T buf)

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)

◆ WaitIdleWithTimeout()

bool QueueHandle::WaitIdleWithTimeout ( uint64_t  nanoseconds)

Wait for previous submits to complete, but only up to a timeout.

Returns
true if now idle, false if timeout

The documentation for this class was generated from the following files: