![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Provides output access to communication variable binding point from shader code. More...
#include <vppLangIntInOut.hpp>
Public Member Functions | |
Output (const BindingPointT &var) | |
Constructs the output point associated with specified binding point (ioVariable or ioStructure). | |
template<typename MemberT > | |
auto | operator[] (MemberT struct_type::*pMember) const |
Provides access to structure members for ioStructure binding points. Provide a pointer to member of your structure (a subclass of LocalStruct). More... | |
auto | operator[] (const Int &index) |
Provides access to an item in case if the variable is an array. More... | |
auto | operator[] (const UInt &index) |
auto | operator[] (int index) |
auto | operator[] (unsigned int index) |
template<typename RightT > | |
void | operator= (const RightT &rhs) |
Int | Size () const |
Returns GPU-side value equal to the array size (number of vertices). | |
int | size () const |
Returns CPU-side value equal to the array size (number of vertices). | |
Provides output access to communication variable binding point from shader code.
Place Output inside your shader code to write data to a communication variable.
The argument should be decltype of the binding point field. It accepts ioVariable and ioStructure binding points. Also provide the binding point reference to the constructor.
You must pay attention yo use Output only in the shader which has been declared as source shader in the binding point.
Example of usage:
auto vpp::Output< BindingPointT >::operator[] | ( | MemberT struct_type::* | pMember | ) | const |
Provides access to structure members for ioStructure binding points. Provide a pointer to member of your structure (a subclass of LocalStruct).
Not applicable for ioVariable binding points.
auto vpp::Output< BindingPointT >::operator[] | ( | const Int & | index | ) |
Provides access to an item in case if the variable is an array.
Communication variables are automatically converted to arrays in certain types of shaders, i.e.:
This is because these shaders operate on multiple vertices at once, forming a geometric primitive or patch. You can access values for individual vertices, by using one of indexing operators.
auto vpp::Output< BindingPointT >::operator[] | ( | const UInt & | index | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
auto vpp::Output< BindingPointT >::operator[] | ( | int | index | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
auto vpp::Output< BindingPointT >::operator[] | ( | unsigned int | index | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.