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

Stage which performs an image blit (more capable copy from one image to another) More...

#include <foray_blitstage.hpp>

Inheritance diagram for foray::stages::BlitStage:
foray::stages::RenderStage foray::stages::ImageToSwapchainStage

Public Member Functions

 BlitStage ()=default
 
void Init (core::ManagedImage *sourceImage=nullptr, core::ManagedImage *destImage=nullptr)
 Initialization.
 
virtual void RecordFrame (VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo) override
 Records pipeline barriers for source and destination images, and the blit command itself.
 
virtual void SetSrcImage (core::ManagedImage *image)
 Set source Image (nullptr allowed)
 
virtual void SetSrcImage (VkImage image, VkExtent2D size)
 Set source Image (nullptr allowed)
 
virtual void SetDstImage (core::ManagedImage *image)
 Set destination Image (nullptr allowed)
 
virtual void SetDstImage (VkImage image, VkExtent2D size)
 Set destination Image (nullptr allowed)
 
- Public Member Functions inherited from foray::stages::RenderStage
 RenderStage ()=default
 
virtual void Destroy ()
 Destroy the render stage. Finalizes all components.
 
virtual void Resize (const VkExtent2D &extent)
 Default implementation accesses mImageOutputs and calls ManagedImage::Resize(extent) on any set image.
 
std::vector< core::ManagedImage * > GetImageOutputs ()
 Gets a vector to all color attachments that will be included in a texture array and can be referenced in the shader pass.
 
core::ManagedImageGetImageOutput (std::string_view name, bool noThrow=false)
 Gets an image output.
 
virtual void OnShadersRecompiled (const std::unordered_set< uint64_t > &recompiled)
 Notifies the stage that the shader compiler instance has recompiled a shader.
 
virtual ~RenderStage ()
 

Protected Member Functions

virtual void ConfigureBlitRegion (VkImageBlit2 &blit)
 Configures the blit region.
 
- Protected Member Functions inherited from foray::stages::RenderStage
virtual void ReloadShaders ()
 Override this to reload all shaders and rebuild pipelines after a registered shader has been recompiled.
 
virtual void DestroyOutputImages ()
 Calls Destroy() on any image in mImageOutputs and clears mImageOutputs.
 

Protected Attributes

core::ManagedImagemSrcImage = nullptr
 If set, preferred over mSrcVkImage member. Allows for recreated ManagedImage instances.
 
VkImage mSrcVkImage = nullptr
 Fallback to mSrcImage.
 
VkExtent2D mSrcImageSize = {}
 Fallback to mSrcImage.
 
core::ManagedImagemDstImage = nullptr
 If set, preferred over mDStVkImage member. Allows for recreated ManagedImage instances.
 
VkImage mDstVkImage = nullptr
 Fallback to mDstImage.
 
VkExtent2D mDstImageSize = {}
 Fallback to mDstImage.
 
bool mFlipX = false
 If true, flips horizontal on blitting.
 
bool mFlipY = false
 If true, flips vertically on blitting.
 
VkFilter mFilter = VkFilter::VK_FILTER_LINEAR
 Filter used for blitting.
 
- Protected Attributes inherited from foray::stages::RenderStage
std::unordered_map< std::string, core::ManagedImage * > mImageOutputs
 Inheriting types should emplace their images onto this collection to provide them in GetImageOutput interface.
 
std::vector< uint64_t > mShaderKeys
 Inheriting types should emplace their shader keys onto this collection such that if a shader has been recompiled, ReloadShaders() will be called.
 
core::ContextmContext = nullptr
 Context object the renderstage is built upon.
 

Detailed Description

Stage which performs an image blit (more capable copy from one image to another)

Includes pipeline barriers

Constructor & Destructor Documentation

◆ BlitStage()

foray::stages::BlitStage::BlitStage ( )
default

Member Function Documentation

◆ ConfigureBlitRegion()

virtual void foray::stages::BlitStage::ConfigureBlitRegion ( VkImageBlit2 &  blit)
protectedvirtual

Configures the blit region.

◆ Init()

void foray::stages::BlitStage::Init ( core::ManagedImage sourceImage = nullptr,
core::ManagedImage destImage = nullptr 
)

Initialization.

Parameters
sourceImageSource Image
destImageDestination Image

◆ RecordFrame()

virtual void foray::stages::BlitStage::RecordFrame ( VkCommandBuffer  cmdBuffer,
base::FrameRenderInfo renderInfo 
)
overridevirtual

Records pipeline barriers for source and destination images, and the blit command itself.

Reimplemented from foray::stages::RenderStage.

Reimplemented in foray::stages::ImageToSwapchainStage.

◆ SetDstImage() [1/2]

virtual void foray::stages::BlitStage::SetDstImage ( core::ManagedImage image)
virtual

Set destination Image (nullptr allowed)

◆ SetDstImage() [2/2]

virtual void foray::stages::BlitStage::SetDstImage ( VkImage  image,
VkExtent2D  size 
)
virtual

Set destination Image (nullptr allowed)

◆ SetSrcImage() [1/2]

virtual void foray::stages::BlitStage::SetSrcImage ( core::ManagedImage image)
virtual

Set source Image (nullptr allowed)

◆ SetSrcImage() [2/2]

virtual void foray::stages::BlitStage::SetSrcImage ( VkImage  image,
VkExtent2D  size 
)
virtual

Set source Image (nullptr allowed)

Member Data Documentation

◆ mDstImage

core::ManagedImage* foray::stages::BlitStage::mDstImage = nullptr
protected

If set, preferred over mDStVkImage member. Allows for recreated ManagedImage instances.

◆ mDstImageSize

VkExtent2D foray::stages::BlitStage::mDstImageSize = {}
protected

Fallback to mDstImage.

◆ mDstVkImage

VkImage foray::stages::BlitStage::mDstVkImage = nullptr
protected

Fallback to mDstImage.

◆ mFilter

VkFilter foray::stages::BlitStage::mFilter = VkFilter::VK_FILTER_LINEAR
protected

Filter used for blitting.

◆ mFlipX

bool foray::stages::BlitStage::mFlipX = false
protected

If true, flips horizontal on blitting.

◆ mFlipY

bool foray::stages::BlitStage::mFlipY = false
protected

If true, flips vertically on blitting.

◆ mSrcImage

core::ManagedImage* foray::stages::BlitStage::mSrcImage = nullptr
protected

If set, preferred over mSrcVkImage member. Allows for recreated ManagedImage instances.

◆ mSrcImageSize

VkExtent2D foray::stages::BlitStage::mSrcImageSize = {}
protected

Fallback to mSrcImage.

◆ mSrcVkImage

VkImage foray::stages::BlitStage::mSrcVkImage = nullptr
protected

Fallback to mSrcImage.


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