Rasterfarm-SDK
Loading...
Searching...
No Matches
Engine::CommandBuffer Class Reference

#include <commandbuffer.h>

Inheritance diagram for Engine::CommandBuffer:
Engine::MasterLock Mutex Engine::PrimaryCommandBuffer Engine::SecondaryCommandBuffer

Public Types

enum  State : uint {
  RESET = 0 ,
  RECORDING ,
  PENDING
}
 

Public Member Functions

 CommandBuffer (VkCommandPool commandPool, VkCommandBufferLevel bufferLevel=VK_COMMAND_BUFFER_LEVEL_PRIMARY, VkCommandBufferUsageFlagBits bufferUsage=VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT)
 
virtual ~CommandBuffer ()
 
 operator VkCommandBuffer * ()
 
 operator VkCommandBuffer ()
 
VkCommandBuffer getHandle () const
 
State getState () const
 
void setFence (VkFence fence, uintmax_t timeout=UINT64_MAX)
 
VkFence getFence ()
 
bool isFenceSignaled ()
 
void waitForFenceSignal ()
 
VkSemaphore getCompleteSemaphore () const
 
void setCompleteSemaphore (VkSemaphore semaphore)
 
VkSemaphore getWaitSemaphore () const
 
void setWaitSemaphore (VkSemaphore semaphore)
 
VkCommandPool getCommandPool () const
 
virtual void begin ()
 
virtual void end ()
 
virtual void reset ()
 
- Public Member Functions inherited from Engine::MasterLock
 MasterLock ()
 
void lock ()
 
void wait ()
 
void unlock ()
 
bool isLocked ()
 

Static Public Member Functions

template<class C >
static HeapArray< VkCommandBuffer > getHandles (HeapArray< C * > array)
 
template<class C >
static HeapArray< VkCommandBuffer > getHandles (Queue< C * > queue)
 
template<class C >
static HeapArray< VkSemaphore > getWaitSemaphores (Queue< C * > queue)
 
template<class C >
static HeapArray< VkSemaphore > getCompleteSemaphores (Queue< C * > queue)
 

Protected Attributes

VkCommandBuffer commandBuffer
 
VkDevice logicalDevice
 
VkCommandPool commandPool
 
VkCommandBufferBeginInfo beginInfo
 
State state
 
VkFence fence
 
VkSemaphore completeSemaphore
 
VkSemaphore waitSemaphore
 
uintmax_t fenceTimeout
 

Friends

class Implementation
 
class PrimaryCommandBuffer
 
class RenderBuffer
 

Additional Inherited Members

- Public Attributes inherited from Engine::MasterLock
volatile uint slaveCount
 
volatile bool locked
 

Detailed Description

A primary command-buffer;

Member Enumeration Documentation

◆ State

Enumerator
RESET 

Ready to begin recording commmands.

RECORDING 

Commmands are currently being recorded.

PENDING 

Commmands are no-longer recording and are pending submission

Constructor & Destructor Documentation

◆ CommandBuffer()

Engine::CommandBuffer::CommandBuffer ( VkCommandPool commandPool,
VkCommandBufferLevel bufferLevel = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
VkCommandBufferUsageFlagBits bufferUsage = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT )

A command-buffer. Allocation is done upon construction.

Parameters
Thecommand-pool that this buffer will-be allocated from.
Thebuffer-level of type primary or secondary.

◆ ~CommandBuffer()

virtual Engine::CommandBuffer::~CommandBuffer ( )
virtual

Member Function Documentation

◆ begin()

virtual void Engine::CommandBuffer::begin ( )
virtual

Begins the recording sequence of this command-buffer. In the case of a primary command-buffer, it may-be this method is never called and all commands are within the sub-commands, which are called individually.

Reimplemented in Engine::PrimaryCommandBuffer.

◆ end()

virtual void Engine::CommandBuffer::end ( )
virtual

Ends the recording sequence of this command-buffer. In the case of a primary command-buffer, it may-be this method is never called and all commands are within the sub-commands, which are called individually.

Reimplemented in Engine::PrimaryCommandBuffer.

◆ getCommandPool()

VkCommandPool Engine::CommandBuffer::getCommandPool ( ) const
inline

◆ getCompleteSemaphore()

VkSemaphore Engine::CommandBuffer::getCompleteSemaphore ( ) const
inline

◆ getCompleteSemaphores()

template<class C >
static HeapArray< VkSemaphore > Engine::CommandBuffer::getCompleteSemaphores ( Queue< C * > queue)
inlinestatic

◆ getFence()

VkFence Engine::CommandBuffer::getFence ( )
inline

◆ getHandle()

VkCommandBuffer Engine::CommandBuffer::getHandle ( ) const
inline

◆ getHandles() [1/2]

template<class C >
static HeapArray< VkCommandBuffer > Engine::CommandBuffer::getHandles ( HeapArray< C * > array)
inlinestatic

◆ getHandles() [2/2]

template<class C >
static HeapArray< VkCommandBuffer > Engine::CommandBuffer::getHandles ( Queue< C * > queue)
inlinestatic

◆ getState()

State Engine::CommandBuffer::getState ( ) const
inline

◆ getWaitSemaphore()

VkSemaphore Engine::CommandBuffer::getWaitSemaphore ( ) const
inline

◆ getWaitSemaphores()

template<class C >
static HeapArray< VkSemaphore > Engine::CommandBuffer::getWaitSemaphores ( Queue< C * > queue)
inlinestatic

◆ isFenceSignaled()

bool Engine::CommandBuffer::isFenceSignaled ( )

◆ operator VkCommandBuffer()

Engine::CommandBuffer::operator VkCommandBuffer ( )
inline

◆ operator VkCommandBuffer *()

Engine::CommandBuffer::operator VkCommandBuffer * ( )
inline

◆ reset()

virtual void Engine::CommandBuffer::reset ( )
virtual
Returns
True if the fence was signaled within the given timeout. If no timeout was passed then true if successfully signaled.

Reimplemented in Engine::PrimaryCommandBuffer.

◆ setCompleteSemaphore()

void Engine::CommandBuffer::setCompleteSemaphore ( VkSemaphore semaphore)
inline

◆ setFence()

void Engine::CommandBuffer::setFence ( VkFence fence,
uintmax_t timeout = UINT64_MAX )

◆ setWaitSemaphore()

void Engine::CommandBuffer::setWaitSemaphore ( VkSemaphore semaphore)
inline

◆ waitForFenceSignal()

void Engine::CommandBuffer::waitForFenceSignal ( )

Friends And Related Symbol Documentation

◆ Implementation

friend class Implementation
friend

◆ PrimaryCommandBuffer

friend class PrimaryCommandBuffer
friend

◆ RenderBuffer

friend class RenderBuffer
friend

Member Data Documentation

◆ beginInfo

VkCommandBufferBeginInfo Engine::CommandBuffer::beginInfo
protected

◆ commandBuffer

VkCommandBuffer Engine::CommandBuffer::commandBuffer
protected

◆ commandPool

VkCommandPool Engine::CommandBuffer::commandPool
protected

Child command-buffers will be allocated from this field.

◆ completeSemaphore

VkSemaphore Engine::CommandBuffer::completeSemaphore
protected

Produced by this CommandBuffer when submission is complete.

◆ fence

VkFence Engine::CommandBuffer::fence
protected

◆ fenceTimeout

uintmax_t Engine::CommandBuffer::fenceTimeout
protected

◆ logicalDevice

VkDevice Engine::CommandBuffer::logicalDevice
protected

◆ state

State Engine::CommandBuffer::state
protected

◆ waitSemaphore

VkSemaphore Engine::CommandBuffer::waitSemaphore
protected

Submission will wait until receipt of this signal.


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