Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Renderer::Backend::Vulkan::CSubmitScheduler Class Reference

A helper class to batch VkQueueSubmit calls and track VkCommandBuffer usages properly. More...

#include <SubmitScheduler.h>

Collaboration diagram for Renderer::Backend::Vulkan::CSubmitScheduler:

Classes

struct  Fence
 
struct  FrameObject
 
struct  SubmittedHandle
 

Public Types

using SubmitHandle = uint32_t
 

Public Member Functions

 CSubmitScheduler (CDevice *device, const uint32_t queueFamilyIndex, VkQueue queue)
 
 ~CSubmitScheduler ()
 
bool AcquireNextImage (CSwapChain &swapChain)
 
void Present (CSwapChain &swapChain)
 
SubmitHandle Submit (VkCommandBuffer commandBuffer)
 
void WaitUntilFree (const SubmitHandle handle)
 
uint32_t GetFrameID () const
 
void Flush ()
 

Static Public Attributes

static constexpr SubmitHandle INVALID_SUBMIT_HANDLE = 0
 

Private Attributes

CDevicem_Device = nullptr
 
VkQueue m_Queue = VK_NULL_HANDLE
 
std::vector< Fencem_Fences
 
uint32_t m_FenceIndex = 0
 
uint32_t m_FrameID = 0
 
SubmitHandle m_CurrentHandle = INVALID_SUBMIT_HANDLE + 1
 
std::queue< SubmittedHandlem_SubmittedHandles
 
std::array< FrameObject, NUMBER_OF_FRAMES_IN_FLIGHTm_FrameObjects
 
VkSemaphore m_NextWaitSemaphore = VK_NULL_HANDLE
 
VkPipelineStageFlags m_NextWaitDstStageMask = 0
 
VkSemaphore m_NextSubmitSignalSemaphore = VK_NULL_HANDLE
 
std::vector< VkCommandBuffer > m_SubmittedCommandBuffers
 
std::unique_ptr< CRingCommandContextm_AcquireCommandContext
 
std::unique_ptr< CRingCommandContextm_PresentCommandContext
 
bool m_DebugWaitIdleBeforeAcquire = false
 
bool m_DebugWaitIdleBeforePresent = false
 
bool m_DebugWaitIdleAfterPresent = false
 

Detailed Description

A helper class to batch VkQueueSubmit calls and track VkCommandBuffer usages properly.

Member Typedef Documentation

◆ SubmitHandle

Constructor & Destructor Documentation

◆ CSubmitScheduler()

Renderer::Backend::Vulkan::CSubmitScheduler::CSubmitScheduler ( CDevice device,
const uint32_t  queueFamilyIndex,
VkQueue  queue 
)

◆ ~CSubmitScheduler()

Renderer::Backend::Vulkan::CSubmitScheduler::~CSubmitScheduler ( )

Member Function Documentation

◆ AcquireNextImage()

bool Renderer::Backend::Vulkan::CSubmitScheduler::AcquireNextImage ( CSwapChain swapChain)

◆ Flush()

void Renderer::Backend::Vulkan::CSubmitScheduler::Flush ( )

◆ GetFrameID()

uint32_t Renderer::Backend::Vulkan::CSubmitScheduler::GetFrameID ( ) const
inline

◆ Present()

void Renderer::Backend::Vulkan::CSubmitScheduler::Present ( CSwapChain swapChain)

◆ Submit()

CSubmitScheduler::SubmitHandle Renderer::Backend::Vulkan::CSubmitScheduler::Submit ( VkCommandBuffer  commandBuffer)

◆ WaitUntilFree()

void Renderer::Backend::Vulkan::CSubmitScheduler::WaitUntilFree ( const SubmitHandle  handle)

Member Data Documentation

◆ INVALID_SUBMIT_HANDLE

constexpr SubmitHandle Renderer::Backend::Vulkan::CSubmitScheduler::INVALID_SUBMIT_HANDLE = 0
staticconstexpr

◆ m_AcquireCommandContext

std::unique_ptr<CRingCommandContext> Renderer::Backend::Vulkan::CSubmitScheduler::m_AcquireCommandContext
private

◆ m_CurrentHandle

SubmitHandle Renderer::Backend::Vulkan::CSubmitScheduler::m_CurrentHandle = INVALID_SUBMIT_HANDLE + 1
private

◆ m_DebugWaitIdleAfterPresent

bool Renderer::Backend::Vulkan::CSubmitScheduler::m_DebugWaitIdleAfterPresent = false
private

◆ m_DebugWaitIdleBeforeAcquire

bool Renderer::Backend::Vulkan::CSubmitScheduler::m_DebugWaitIdleBeforeAcquire = false
private

◆ m_DebugWaitIdleBeforePresent

bool Renderer::Backend::Vulkan::CSubmitScheduler::m_DebugWaitIdleBeforePresent = false
private

◆ m_Device

CDevice* Renderer::Backend::Vulkan::CSubmitScheduler::m_Device = nullptr
private

◆ m_FenceIndex

uint32_t Renderer::Backend::Vulkan::CSubmitScheduler::m_FenceIndex = 0
private

◆ m_Fences

std::vector<Fence> Renderer::Backend::Vulkan::CSubmitScheduler::m_Fences
private

◆ m_FrameID

uint32_t Renderer::Backend::Vulkan::CSubmitScheduler::m_FrameID = 0
private

◆ m_FrameObjects

std::array<FrameObject, NUMBER_OF_FRAMES_IN_FLIGHT> Renderer::Backend::Vulkan::CSubmitScheduler::m_FrameObjects
private

◆ m_NextSubmitSignalSemaphore

VkSemaphore Renderer::Backend::Vulkan::CSubmitScheduler::m_NextSubmitSignalSemaphore = VK_NULL_HANDLE
private

◆ m_NextWaitDstStageMask

VkPipelineStageFlags Renderer::Backend::Vulkan::CSubmitScheduler::m_NextWaitDstStageMask = 0
private

◆ m_NextWaitSemaphore

VkSemaphore Renderer::Backend::Vulkan::CSubmitScheduler::m_NextWaitSemaphore = VK_NULL_HANDLE
private

◆ m_PresentCommandContext

std::unique_ptr<CRingCommandContext> Renderer::Backend::Vulkan::CSubmitScheduler::m_PresentCommandContext
private

◆ m_Queue

VkQueue Renderer::Backend::Vulkan::CSubmitScheduler::m_Queue = VK_NULL_HANDLE
private

◆ m_SubmittedCommandBuffers

std::vector<VkCommandBuffer> Renderer::Backend::Vulkan::CSubmitScheduler::m_SubmittedCommandBuffers
private

◆ m_SubmittedHandles

std::queue<SubmittedHandle> Renderer::Backend::Vulkan::CSubmitScheduler::m_SubmittedHandles
private

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