![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Input attachment binding point. More...
#include <vppLangIntImages.hpp>
Public Types | |
typedef ImageViewT::format_type | format_type |
typedef TImageBinding< ImageViewT > | assignment_type |
Public Member Functions | |
inAttachment (const Attachment< format_type > &attachmentNode, unsigned int set=0, int binding=-1) | |
Creates the binding point. More... | |
auto | operator= (const ImageViewT &view) |
Binds an image view to the binding point. More... | |
Input attachment binding point.
Input attachment is an intermediate image node in complex render graph. The same node is being declared as input and output attachment. One rendering process writes to it (seeing it as output attachment) while others can read from it. For these reading processes declare the node as input and provide corresponding inAttachment
binding point in each pipeline.
You must provide a reference to render graph node in the constructor.
The inAttachment
must be bound to an image view just as all other input binding points (to the shader data block and by means of assignment operator).
However, as the node is declared both output and input, in order to satisfy the output side requirements, it must be also be initialized with the image view in the Attachment constructor (or provide the view to FrameBuffer object). This must be a view to the same image.
Note that addInput
method will automatically add dependency between processes. This ensures that the second process will read complete data from the input attachment.
Example:
This binding point can only be used in SubpassLoad() function.
vpp::inAttachment< ImageViewT, COUNT >::inAttachment | ( | const Attachment< format_type > & | attachmentNode, |
unsigned int | set = 0 , |
||
int | binding = -1 |
||
) |
Creates the binding point.
Specify the attachment node (from render graph) as the first argument.
Typically you do not need to specify remaining arguments for the constructor.
Optionally you can force the set and binding index. This feature may be useful if you need to interface VPP binding point with externally supplied shader (written in GLSL and compiled externally to SPIR-V blob).
auto vpp::inAttachment< ImageViewT, COUNT >::operator= | ( | const ImageViewT & | view | ) |
Binds an image view to the binding point.
This operator returns a value that must be passed to ShaderDataBlock::update() method. You can also make a list of more assignments, joining them with comma operator. The update method accepts such a list.
The binding is stored inside ShaderDataBlock instance, immediately when update
is called. You select active ShaderDataBlock in your drawing command sequence by calling ShaderDataBlock::cmdBind(). Thus, actual resource binding (to the pipeline) occurs at command execution time, simultaneously for all bindings in that ShaderDataBlock instance.
This overload assumes the image is in VK_IMAGE_LAYOUT_GENERAL layout.