![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Binding point class for push constant data input to shaders. Place in your pipeline configuration class to declare a push constant. More...
#include <vppLangIntUniform.hpp>
Public Types | |
typedef DefinitionT< CPU > | DataBlock |
A typedef to CPU version of the data structure. | |
Public Member Functions | |
inPushConstant () | |
Constructor. Does not take any arguments. | |
void | cmdPush (CommandBuffer currentBuffer) |
Emits push command to specified command buffer. More... | |
template<typename ValueT > | |
void | cmdPush (CommandBuffer currentBuffer, const ValueT &field) |
Emits push command to specified command buffer. More... | |
void | cmdPush () |
Emits push command to default command buffer. More... | |
template<typename ValueT > | |
void | cmdPush (const ValueT &field) |
Emits push command to default command buffer. More... | |
DataBlock & | data () |
Allows to access the fields of the data structure. More... | |
Binding point class for push constant data input to shaders. Place in your pipeline configuration class to declare a push constant.
Specify the name of your uniform data structure template as the argument. Accepts templates derived from UniformStruct.
This class should be used only to define a binding point inside your custom pipeline configuration (a PipelineConfig or ComputePipelineConfig subclass).
Push constants in VPP are used in pretty much the same way as uniform buffers, with some differences. There are the following steps to consider when using push constants within pipeline config:
Example:
void vpp::inPushConstant< DefinitionT >::cmdPush | ( | CommandBuffer | currentBuffer | ) |
Emits push command to specified command buffer.
The command will be executed when the command buffer is executed by the queue. It will transfer entire push constant structure to the GPU.
void vpp::inPushConstant< DefinitionT >::cmdPush | ( | CommandBuffer | currentBuffer, |
const ValueT & | field | ||
) |
Emits push command to specified command buffer.
The command will be executed when the command buffer is executed by the queue. It will transfer only specified field contents to the GPU. As the field reference, supply a reference to a field inside CPU version of the data structure.
void vpp::inPushConstant< DefinitionT >::cmdPush | ( | ) |
Emits push command to default command buffer.
The command will be executed when the command buffer is executed by the queue. It will transfer entire push constant structure to the GPU. This overload is meant to be used inside rendering command sequence (Process, Preprocess or Postprocess).
void vpp::inPushConstant< DefinitionT >::cmdPush | ( | const ValueT & | field | ) |
Emits push command to default command buffer.
The command will be executed when the command buffer is executed by the queue. It will transfer only specified field contents to the GPU. As the field reference, supply a reference to a field inside CPU version of the data structure.
This overload is meant to be used inside rendering command sequence (Process, Preprocess or Postprocess).
DataBlock& vpp::inPushConstant< DefinitionT >::data | ( | ) |
Allows to access the fields of the data structure.
Fields are being written directly. However, they are synchronized (sent to GPU) at the moment when cmdPush() command is being executed by the queue.
It is a common practice to issue cmdPush() inside rendering command sequence (Process, Preprocess or Postprocess). However, do NOT write push constant fields there. Fields should be written before issuing the command buffer to the queue – not when constructing the buffer what the command sequence actually does.