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

#include <commandbuffer.h>

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

Public Member Functions

 PrimaryCommandBuffer (RenderBuffer *pRenderBuffer, VkFramebuffer framebuffer=VK_NULL_HANDLE)
 
virtual ~PrimaryCommandBuffer ()
 
virtual void begin ()
 
virtual void end ()
 
virtual void reset ()
 
void setFrameBufferHandle (VkFramebuffer framebuffer)
 
void reserveCommandBuffers (uint size)
 
SecondaryCommandBuffergetNextSecondaryCommandBuffer ()
 
- Public Member Functions inherited from Engine::CommandBuffer
 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
 
- Public Member Functions inherited from Engine::MasterLock
 MasterLock ()
 
void lock ()
 
void wait ()
 
void unlock ()
 
bool isLocked ()
 

Protected Attributes

RenderBufferpRenderBuffer
 
VkFramebuffer frameBuffer
 
Queue< SecondaryCommandBuffer * > resetCommandBuffer
 
Queue< SecondaryCommandBuffer * > recordingCommandBuffer
 
Queue< SecondaryCommandBuffer * > pendingCommandBuffer
 
- Protected Attributes inherited from Engine::CommandBuffer
VkCommandBuffer commandBuffer
 
VkDevice logicalDevice
 
VkCommandPool commandPool
 
VkCommandBufferBeginInfo beginInfo
 
State state
 
VkFence fence
 
VkSemaphore completeSemaphore
 
VkSemaphore waitSemaphore
 
uintmax_t fenceTimeout
 

Friends

class RenderBuffer
 

Additional Inherited Members

- Public Types inherited from Engine::CommandBuffer
enum  State : uint {
  RESET = 0 ,
  RECORDING ,
  PENDING
}
 
- Static Public Member Functions inherited from Engine::CommandBuffer
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)
 
- Public Attributes inherited from Engine::MasterLock
volatile uint slaveCount
 
volatile bool locked
 

Constructor & Destructor Documentation

◆ PrimaryCommandBuffer()

Engine::PrimaryCommandBuffer::PrimaryCommandBuffer ( RenderBuffer * pRenderBuffer,
VkFramebuffer framebuffer = VK_NULL_HANDLE )

A Primary command-buffer. All Commands are exectuted in SubCommandBuffer objects. Allocation is done upon construction.

Parameters
Thecommand-pool that this and all SubCommandBuffer objects will be allocated from.
Therender-pass that all SubCommandBuffer objects will render-to.

◆ ~PrimaryCommandBuffer()

virtual Engine::PrimaryCommandBuffer::~PrimaryCommandBuffer ( )
virtual

Member Function Documentation

◆ begin()

virtual void Engine::PrimaryCommandBuffer::begin ( )
virtual

Starts the render-pass for the respective framebuffer.

Reimplemented from Engine::CommandBuffer.

◆ end()

virtual void Engine::PrimaryCommandBuffer::end ( )
virtual

Ends the render-pass for the respective framebuffer.

Reimplemented from Engine::CommandBuffer.

◆ getNextSecondaryCommandBuffer()

SecondaryCommandBuffer * Engine::PrimaryCommandBuffer::getNextSecondaryCommandBuffer ( )

A RESET secondary command-buffer will be returned from the queue or allocated internally. The life-cycle for the SubCommandBuffer object is managed by this class.

Returns
Pointer to the next SubCommandBuffer in the queue, in RESET state.

◆ reserveCommandBuffers()

void Engine::PrimaryCommandBuffer::reserveCommandBuffers ( uint size)

◆ reset()

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

Reimplemented from Engine::CommandBuffer.

◆ setFrameBufferHandle()

void Engine::PrimaryCommandBuffer::setFrameBufferHandle ( VkFramebuffer framebuffer)

Friends And Related Symbol Documentation

◆ RenderBuffer

friend class RenderBuffer
friend

Member Data Documentation

◆ frameBuffer

VkFramebuffer Engine::PrimaryCommandBuffer::frameBuffer
protected

◆ pendingCommandBuffer

Queue< SecondaryCommandBuffer * > Engine::PrimaryCommandBuffer::pendingCommandBuffer
protected

Dispatched CommandBuffers in PENDING state.

◆ pRenderBuffer

RenderBuffer* Engine::PrimaryCommandBuffer::pRenderBuffer
protected

◆ recordingCommandBuffer

Queue< SecondaryCommandBuffer * > Engine::PrimaryCommandBuffer::recordingCommandBuffer
protected

Dispatched CommandBuffers in RECORDING state.

◆ resetCommandBuffer

Queue< SecondaryCommandBuffer * > Engine::PrimaryCommandBuffer::resetCommandBuffer
protected

CommandBuffer objects in RESET state ready for dispatch.


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