VPP  0.8
A high-level modern C++ API for Vulkan
vpp::Attachment< FormatT > Class Template Reference

Represents attachment graph node. More...

#include <vppRenderGraphNodes.hpp>

Public Member Functions

 Attachment (std::uint32_t width, std::uint32_t height, EImagePurpose imagePurpose=RENDER)
 Constructs attachment mode without fixed image view. More...
 
 Attachment (RenderGraph *pGraph, std::uint32_t width, std::uint32_t height, EImagePurpose imagePurpose=RENDER)
 Constructs attachment mode without fixed image view. More...
 
template<class ViewT >
 Attachment (const ViewT &imageView)
 Constructs attachment mode with fixed image view. More...
 
template<class ViewT >
 Attachment (RenderGraph *pGraph, const ViewT &imageView)
 Constructs attachment mode with fixed image view. More...
 
RenderGraphgraph () const
 Retrieves the parent render graph object.
 
std::uint32_t index () const
 Retrieves the index of the attachment.
 
std::uint32_t width () const
 Retrieves image width of the attachment.
 
std::uint32_t height () const
 Retrieves image height of the attachment.
 

Detailed Description

template<class FormatT>
class vpp::Attachment< FormatT >

Represents attachment graph node.

This is a lightweight class, can be passed by value. Its purpose however is to be used only within custom render graph definitions. It represents attachment of given format participating in the render graph.

Attachment nodes must be explicitly associated with process nodes. The kind of the attachment (e.g. color output, depth, input, etc.) is determined during this association, because single attachment might be shared by multiple processes and perform different roles (e.g. output from one process and input to another). Define this association using one of the following methods of the Process class, called from the RenderGraph derived class constructor:

On the other hand, an attachment must be also associated with some physical image, or part of image (e.g. single layer in image array). This is represented by an object of ImageView< ... > or FrameImageView class. Such image view must be provided for each attachment, however there are two ways to do this:

  • Immediately when constructing Attachment object, by providing the view object directly to the constructor.
  • Later, as an element in the vector supplied to FrameBuffer object construction.

The former method is simpler, the latter one allows rendering the same graph to different sets of images. This can be very useful e.g. when implementing double buffering.

These approaches can also be mixed. You can construct some attachments with fixed view, and others without the view. Later, when constructing the FrameBuffer, provide real FrameImageView object for these non-fixed attachments. For the rest, provide empty FrameImageView() values to the FrameBuffer, and it will read the fixed view from the corresponding Attachment object.

Constructor & Destructor Documentation

◆ Attachment() [1/4]

template<class FormatT>
vpp::Attachment< FormatT >::Attachment ( std::uint32_t  width,
std::uint32_t  height,
EImagePurpose  imagePurpose = RENDER 
)

Constructs attachment mode without fixed image view.

Note that you must still provide image size.

This constructor is intended to be used for Attachment objects being fields of a RenderGraph object. The parent RenderGraph is automatically determined as currently constructed graph.

◆ Attachment() [2/4]

template<class FormatT>
vpp::Attachment< FormatT >::Attachment ( RenderGraph pGraph,
std::uint32_t  width,
std::uint32_t  height,
EImagePurpose  imagePurpose = RENDER 
)

Constructs attachment mode without fixed image view.

Note that you must still provide image size.

The parent RenderGraph object is specified explicitly here.

◆ Attachment() [3/4]

template<class FormatT>
template<class ViewT >
vpp::Attachment< FormatT >::Attachment ( const ViewT &  imageView)

Constructs attachment mode with fixed image view.

Provide a reference to ImageView< ... > object or FrameImageView as the argument. The node will be beound statically to specified image.

This constructor is intended to be used for Attachment objects being fields of a RenderGraph object. The parent RenderGraph is automatically determined as currently constructed graph.

◆ Attachment() [4/4]

template<class FormatT>
template<class ViewT >
vpp::Attachment< FormatT >::Attachment ( RenderGraph pGraph,
const ViewT &  imageView 
)

Constructs attachment mode with fixed image view.

Provide a reference to ImageView< ... > object or FrameImageView as the second argument. The node will be beound statically to specified image.

The parent RenderGraph object is specified explicitly here.


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