Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_historyimage.hpp
Go to the documentation of this file.
1#pragma once
2#include "../base/foray_base_declares.hpp"
3#include "../core/foray_managedimage.hpp"
4
5namespace foray::util {
10 {
11 public:
15 void Create(core::Context* context, core::ManagedImage* source, VkImageUsageFlags additionalUsageFlags = 0U);
16
17 void Resize(const VkExtent2D& size);
18
20
22 void CmdCopySourceToHistory(VkCommandBuffer cmdBuffer, base::FrameRenderInfo& renderInfo);
23
25 static void sMultiCopySourceToHistory(const std::vector<HistoryImage*>& historyImages, VkCommandBuffer cmdBuffer, base::FrameRenderInfo& renderInfo);
26
27 inline bool Exists() const { return mHistory.Exists(); }
28
29 void Destroy();
30
32
33 inline operator core::ManagedImage&() { return mHistory; }
34 inline operator const core::ManagedImage&() const { return mHistory; }
35
36 FORAY_PROPERTY_V(HistoricLayout)
37
38 protected:
41 VkImageLayout mHistoricLayout = VkImageLayout::VK_IMAGE_LAYOUT_UNDEFINED;
42 };
43} // namespace foray::util
Context used for render processes. This object is rebuilt for every frame. /.
Definition foray_framerenderinfo.hpp:14
Tracks ImageLayouts over the course of a frame rendering process.
Definition foray_imagelayoutcache.hpp:13
Wraps allocation and lifetime functionality of VkImage.
Definition foray_managedimage.hpp:13
virtual bool Exists() const override
Return true, if the managed resource is allocated.
Definition foray_managedimage.hpp:86
Helper object managing a copy of an existing image for use as history information (reprojection etc....
Definition foray_historyimage.hpp:10
VkImageLayout mHistoricLayout
Definition foray_historyimage.hpp:41
void ApplyToLayoutCache(core::ImageLayoutCache &layoutCache)
static void sMultiCopySourceToHistory(const std::vector< HistoryImage * > &historyImages, VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo)
Batch record pipeline barriers and cmdCopyImage for a set of history images.
void Resize(const VkExtent2D &size)
void Create(core::Context *context, core::ManagedImage *source, VkImageUsageFlags additionalUsageFlags=0U)
bool Exists() const
Definition foray_historyimage.hpp:27
void CmdCopySourceToHistory(VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo)
Pipeline barriers, cmdCopyImage from source -> history.
core::ManagedImage mHistory
Definition foray_historyimage.hpp:40
core::ManagedImage & GetHistoryImage()
Definition foray_historyimage.hpp:31
core::ManagedImage * mSource
Definition foray_historyimage.hpp:39
#define FORAY_PROPERTY_V(member)
Getter+Setter shorthand for value types.
Definition foray_basics.hpp:81
Definition foray_dualbuffer.hpp:5
Non owning context object.
Definition foray_context.hpp:16