Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
foray::base::FrameRenderInfo Class Reference

Context used for render processes. This object is rebuilt for every frame. /. More...

#include <foray_framerenderinfo.hpp>

Public Member Functions

core::DeviceSyncCommandBufferGetAuxCommandBuffer (int32_t index)
 
const core::DeviceSyncCommandBufferGetAuxCommandBuffer (int32_t index) const
 
core::DeviceSyncCommandBufferGetPrimaryCommandBuffer ()
 
const core::DeviceSyncCommandBufferGetPrimaryCommandBuffer () const
 
core::DeviceSyncCommandBufferGetCommandBuffer (CmdBufferIndex index)
 
const core::DeviceSyncCommandBufferGetCommandBuffer (CmdBufferIndex index) const
 
void ClearSwapchainImage (VkCommandBuffer cmdBuffer)
 Writes vkCmdClearColorImage cmd to the primary command buffer for the acquired image.
 
void PrepareSwapchainImageForPresent (VkCommandBuffer cmdBuffer)
 Adds a Pipeline barrier transitioning the swapchain image into present layout and assuring all writes to it have finished.
 
void SubmitAllCommandBuffers ()
 Batch submit all of InflightFrames command buffers at once.
 
 FrameRenderInfo ()=default
 
 FrameRenderInfo (const RenderLoop::RenderInfo &loopRenderInfo, InFlightFrame *inflightFrame)
 Initialize based on loopRenderInfo and InFlightFrame.
 

Protected Attributes

fp32_t mFrameTime = 0.f
 Delta time in seconds since last frames render call.
 
fp64_t mSinceStart = 0.0
 Delta time in seconds since application start.
 
uint64_t mFrameNumber = 0
 Number of complete frames rendered since application startup.
 
VkExtent2D mRenderSize = {}
 Render Resolution.
 
InFlightFramemInFlightFrame = nullptr
 In Flight Frame contains command buffers and synchronization primitives for the current frame.
 
core::ImageLayoutCache mImageLayoutCache
 ImageLayoutCache is used to maintain Images layouts throughout the recording of the frame.
 

Detailed Description

Context used for render processes. This object is rebuilt for every frame. /.

Remarks
Care should be taken if passed as value instead of reference because the ImageLayoutCache cannot work on multiple instances for a single render process

Constructor & Destructor Documentation

◆ FrameRenderInfo() [1/2]

foray::base::FrameRenderInfo::FrameRenderInfo ( )
default

◆ FrameRenderInfo() [2/2]

foray::base::FrameRenderInfo::FrameRenderInfo ( const RenderLoop::RenderInfo loopRenderInfo,
InFlightFrame inflightFrame 
)
inline

Initialize based on loopRenderInfo and InFlightFrame.

Remarks
RenderLoop::RenderInfo::LoopFrameNumber is not used as mFrameNumber, as the render index can be prevented from incrementing if the swapchain is resized before a frame could be recorded

Member Function Documentation

◆ ClearSwapchainImage()

void foray::base::FrameRenderInfo::ClearSwapchainImage ( VkCommandBuffer  cmdBuffer)
inline

Writes vkCmdClearColorImage cmd to the primary command buffer for the acquired image.

◆ GetAuxCommandBuffer() [1/2]

core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetAuxCommandBuffer ( int32_t  index)
inline

◆ GetAuxCommandBuffer() [2/2]

const core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetAuxCommandBuffer ( int32_t  index) const
inline

◆ GetCommandBuffer() [1/2]

core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetCommandBuffer ( CmdBufferIndex  index)
inline

◆ GetCommandBuffer() [2/2]

const core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetCommandBuffer ( CmdBufferIndex  index) const
inline

◆ GetPrimaryCommandBuffer() [1/2]

core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetPrimaryCommandBuffer ( )
inline

◆ GetPrimaryCommandBuffer() [2/2]

const core::DeviceSyncCommandBuffer & foray::base::FrameRenderInfo::GetPrimaryCommandBuffer ( ) const
inline

◆ PrepareSwapchainImageForPresent()

void foray::base::FrameRenderInfo::PrepareSwapchainImageForPresent ( VkCommandBuffer  cmdBuffer)
inline

Adds a Pipeline barrier transitioning the swapchain image into present layout and assuring all writes to it have finished.

◆ SubmitAllCommandBuffers()

void foray::base::FrameRenderInfo::SubmitAllCommandBuffers ( )
inline

Batch submit all of InflightFrames command buffers at once.

Member Data Documentation

◆ mFrameNumber

uint64_t foray::base::FrameRenderInfo::mFrameNumber = 0
protected

Number of complete frames rendered since application startup.

◆ mFrameTime

fp32_t foray::base::FrameRenderInfo::mFrameTime = 0.f
protected

Delta time in seconds since last frames render call.

◆ mImageLayoutCache

core::ImageLayoutCache foray::base::FrameRenderInfo::mImageLayoutCache
protected

ImageLayoutCache is used to maintain Images layouts throughout the recording of the frame.

Remarks
This is necessary, because Image Layout Transitions need the old ImageLayout set, otherwise the driver is free to discard the Image's content at will (e.g. NVidia GTX 10XX series drivers)

◆ mInFlightFrame

InFlightFrame* foray::base::FrameRenderInfo::mInFlightFrame = nullptr
protected

In Flight Frame contains command buffers and synchronization primitives for the current frame.

◆ mRenderSize

VkExtent2D foray::base::FrameRenderInfo::mRenderSize = {}
protected

Render Resolution.

◆ mSinceStart

fp64_t foray::base::FrameRenderInfo::mSinceStart = 0.0
protected

Delta time in seconds since application start.


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