2#include "../core/foray_commandbuffer.hpp"
3#include "../core/foray_core_declares.hpp"
Wraps synchronization primitives and command buffers for an inflight frame.
Definition foray_inflightframe.hpp:32
VkSemaphore mSwapchainImageReady
Semaphore signalled by the device when the swapchain image becomes ready.
Definition foray_inflightframe.hpp:92
void WaitForExecutionFinished()
Blocks the current thread until the frame has finished execution.
VkSemaphore mPrimaryCompletedSemaphore
Semaphore signalled by the primary command buffer when execution has finished.
Definition foray_inflightframe.hpp:94
const core::DeviceSyncCommandBuffer & GetAuxiliaryCommandBuffer(uint32_t index) const
Get an auxiliary command buffer.
const core::DeviceSyncCommandBuffer & GetPrimaryCommandBuffer() const
Get primary command buffer.
ESwapchainInteractResult AcquireSwapchainImage()
Acquires next swapchain image and stores the resulting index in mSwapchainImageIndex.
virtual ~InFlightFrame()
Definition foray_inflightframe.hpp:37
ESwapchainInteractResult Present()
Presents the previously acquired image. The primary command buffer must have been submitted prior to ...
bool HasFinishedExecution()
Non-blocking check wether the frame has been finished execution.
std::vector< std::unique_ptr< core::DeviceSyncCommandBuffer > > mAuxiliaryCommandBuffers
Auxiliary command buffers.
Definition foray_inflightframe.hpp:88
core::DeviceSyncCommandBuffer & GetPrimaryCommandBuffer()
Get primary command buffer.
core::Context * mContext
Definition foray_inflightframe.hpp:85
core::DeviceSyncCommandBuffer & GetCommandBuffer(CmdBufferIndex index)
Get a command buffer.
void SubmitAll()
Submits all command buffers by getting all VkSubmitInfo2{} structures from DeviceSyncCommandBuffer::W...
uint32_t mSwapchainImageIndex
Definition foray_inflightframe.hpp:98
void ResetFence()
Resets the frames host synchronization fence.
void PrepareSwapchainImageForPresent(VkCommandBuffer cmdBuffer, core::ImageLayoutCache &imgLayoutCache)
Adds a Pipeline barrier transitioning the swapchain image into present layout and assuring all writes...
VkFence mPrimaryCompletedFence
Fence signalled after the primary / all command buffers have finished execution.
Definition foray_inflightframe.hpp:96
core::DeviceSyncCommandBuffer & GetAuxiliaryCommandBuffer(uint32_t index)
Get an auxiliary command buffer.
void ClearSwapchainImage(VkCommandBuffer cmdBuffer, core::ImageLayoutCache &imgLayoutCache)
Writes vkCmdClearColorImage cmd to the primary command buffer for the acquired image.
const core::DeviceSyncCommandBuffer & GetCommandBuffer(CmdBufferIndex index) const
Get a command buffer.
core::DeviceSyncCommandBuffer mPrimaryCommandBuffer
Primary command buffer.
Definition foray_inflightframe.hpp:90
void Create(core::Context *context, uint32_t auxCommandBufferCount=0)
Extension of the commandbuffer wrapper for device and/or host synchronized command buffer execution.
Definition foray_commandbuffer.hpp:90
Tracks ImageLayouts over the course of a frame rendering process.
Definition foray_imagelayoutcache.hpp:13
#define FORAY_GETTER_V(member)
Return value.
Definition foray_basics.hpp:39
Definition foray_base_declares.hpp:3
ESwapchainInteractResult
Result of swapchain interaction (AcquireImage or Present)
Definition foray_inflightframe.hpp:10
@ Resized
The interaction indicated that the swapchain should be resized.
@ Nominal
The interaction resulted nominally.
int32_t CmdBufferIndex
Definition foray_inflightframe.hpp:17
Non owning context object.
Definition foray_context.hpp:16