![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Binding point class for storage (read-write) data buffer to shaders. Place in your pipeline configuration class to declare a storage data buffer. More...
#include <vppLangIntUniform.hpp>
Public Member Functions | |
ioBuffer (std::uint32_t set=0, int binding=-1) | |
Creates the binding point. More... | |
auto | operator= (const UniformBufferView &value) |
Binds a buffer to the binding point. More... | |
Binding point class for storage (read-write) data buffer to shaders. Place in your pipeline configuration class to declare a storage data buffer.
This class should be used only to define a binding point inside your custom pipeline configuration (a PipelineConfig or ComputePipelineConfig subclass).
There are the following steps to consider when using storage buffers within pipeline config:
Example:
vpp::ioBuffer::ioBuffer | ( | std::uint32_t | set = 0 , |
int | binding = -1 |
||
) |
Creates the binding point.
Typically you do not need to specify any 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::ioBuffer::operator= | ( | const UniformBufferView & | value | ) |
Binds a buffer to the binding point.
Accepts single argument which is generic buffer abstraction represented by UniformBufferView object. Usually just use gvector object in that place (it will be automatically cast to UniformBufferView). Alternatively, any Vulkan read-write uniform buffer bound to memory may be used.
Calling this operator does not bind the buffer immediately. It only generates an entry inside ShaderDataBlock. The operator returns an opaque value that must be supplied to ShaderDataBlock::update method. Several buffers can be bound at once. The binding will actually occur when the ShaderDataBlock is selected in the rendering pipeline.
Example: