Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_framerenderinfo.hpp
Go to the documentation of this file.
1#pragma once
2#include "../core/foray_imagelayoutcache.hpp"
3#include "../foray_basics.hpp"
4#include "../foray_vulkan.hpp"
7#include <vector>
8
9namespace foray::base {
10
14 {
15 public:
16 FORAY_PROPERTY_V(FrameTime)
17 FORAY_PROPERTY_V(SinceStart)
18 FORAY_PROPERTY_V(FrameNumber)
19 FORAY_PROPERTY_V(RenderSize)
21 FORAY_PROPERTY_R(ImageLayoutCache)
22
23 inline core::DeviceSyncCommandBuffer& GetAuxCommandBuffer(int32_t index) { return mInFlightFrame->GetAuxiliaryCommandBuffer(index); }
25
28
31
33 inline void ClearSwapchainImage(VkCommandBuffer cmdBuffer) { mInFlightFrame->ClearSwapchainImage(cmdBuffer, mImageLayoutCache); }
38
39 FrameRenderInfo() = default;
43 FrameRenderInfo(const RenderLoop::RenderInfo& loopRenderInfo, InFlightFrame* inflightFrame)
44 : mFrameTime(loopRenderInfo.Delta), mSinceStart(loopRenderInfo.SinceStart), mFrameNumber(0), mInFlightFrame(inflightFrame)
45 {
46 }
47
48 protected:
54 uint64_t mFrameNumber = 0;
56 VkExtent2D mRenderSize = {};
63 };
64} // namespace foray::base
Context used for render processes. This object is rebuilt for every frame. /.
Definition foray_framerenderinfo.hpp:14
const core::DeviceSyncCommandBuffer & GetCommandBuffer(CmdBufferIndex index) const
Definition foray_framerenderinfo.hpp:30
core::DeviceSyncCommandBuffer & GetAuxCommandBuffer(int32_t index)
Definition foray_framerenderinfo.hpp:23
InFlightFrame * mInFlightFrame
In Flight Frame contains command buffers and synchronization primitives for the current frame.
Definition foray_framerenderinfo.hpp:58
FrameRenderInfo(const RenderLoop::RenderInfo &loopRenderInfo, InFlightFrame *inflightFrame)
Initialize based on loopRenderInfo and InFlightFrame.
Definition foray_framerenderinfo.hpp:43
const core::DeviceSyncCommandBuffer & GetAuxCommandBuffer(int32_t index) const
Definition foray_framerenderinfo.hpp:24
void PrepareSwapchainImageForPresent(VkCommandBuffer cmdBuffer)
Adds a Pipeline barrier transitioning the swapchain image into present layout and assuring all writes...
Definition foray_framerenderinfo.hpp:35
fp64_t mSinceStart
Delta time in seconds since application start.
Definition foray_framerenderinfo.hpp:52
const core::DeviceSyncCommandBuffer & GetPrimaryCommandBuffer() const
Definition foray_framerenderinfo.hpp:27
void SubmitAllCommandBuffers()
Batch submit all of InflightFrames command buffers at once.
Definition foray_framerenderinfo.hpp:37
void ClearSwapchainImage(VkCommandBuffer cmdBuffer)
Writes vkCmdClearColorImage cmd to the primary command buffer for the acquired image.
Definition foray_framerenderinfo.hpp:33
core::DeviceSyncCommandBuffer & GetCommandBuffer(CmdBufferIndex index)
Definition foray_framerenderinfo.hpp:29
core::ImageLayoutCache mImageLayoutCache
ImageLayoutCache is used to maintain Images layouts throughout the recording of the frame.
Definition foray_framerenderinfo.hpp:62
fp32_t mFrameTime
Delta time in seconds since last frames render call.
Definition foray_framerenderinfo.hpp:50
core::DeviceSyncCommandBuffer & GetPrimaryCommandBuffer()
Definition foray_framerenderinfo.hpp:26
VkExtent2D mRenderSize
Render Resolution.
Definition foray_framerenderinfo.hpp:56
uint64_t mFrameNumber
Number of complete frames rendered since application startup.
Definition foray_framerenderinfo.hpp:54
Wraps synchronization primitives and command buffers for an inflight frame.
Definition foray_inflightframe.hpp:32
core::DeviceSyncCommandBuffer & GetPrimaryCommandBuffer()
Get primary command buffer.
core::DeviceSyncCommandBuffer & GetCommandBuffer(CmdBufferIndex index)
Get a command buffer.
void SubmitAll()
Submits all command buffers by getting all VkSubmitInfo2{} structures from DeviceSyncCommandBuffer::W...
void PrepareSwapchainImageForPresent(VkCommandBuffer cmdBuffer, core::ImageLayoutCache &imgLayoutCache)
Adds a Pipeline barrier transitioning the swapchain image into present layout and assuring all writes...
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.
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_PROPERTY_V(member)
Getter+Setter shorthand for value types.
Definition foray_basics.hpp:81
#define FORAY_PROPERTY_R(member)
Getter+Setter shorthand for reference types.
Definition foray_basics.hpp:86
Definition foray_base_declares.hpp:3
int32_t CmdBufferIndex
Definition foray_inflightframe.hpp:17
float fp32_t
stdint.h style 32 bit floating point type alias (float)
Definition foray_basics.hpp:13
double fp64_t
stdint.h style 64 bit floating point type alias (double)
Definition foray_basics.hpp:15
Definition foray_renderloop.hpp:50