![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Provides access to scalar or arrayed buffer binding point from shader code. More...
#include <vppLangIntUniform.hpp>
Public Member Functions | |
UniformVar (BufferT &buf) | |
Constructs the accessor for provided binding point. | |
template<typename MemberT > | |
auto | operator[] (MemberT Definition::*pMember) const |
Provides read and write access to specified field. Single buffers only. More... | |
auto | operator[] (const Int &index) const |
Provides read and write access to specified item. Arrayed buffers only. More... | |
auto | operator[] (const UInt &index) const |
auto | operator[] (int index) const |
auto | operator[] (unsigned int index) const |
Int | Size () const |
Returns GPU-side value equal to the size of the array. Arrayed buffers only. | |
int | size () const |
Returns CPU-side value equal to the size of the array. Arrayed buffers only. | |
Provides access to scalar or arrayed buffer binding point from shader code.
Place UniformVar inside your shader code to access the data in uniform, storage or push constant buffer.
The first argument should be the structure template (derived from UniformStruct).
The second argument should be the decltype
of accessed binding point.
It accepts the following binding points: inUniformBuffer, ioBuffer, inUniformBufferDyn, ioBufferDyn, inPushConstant and arrayOf based on those.
Also specify the binding point in the constructor of UniformVar. The binding point should be an object inside PipelineConfig subclass and the shader should be a method in the same subclass - or some code called from it.
UniformVar gives access to single structure in single or arrayed buffer. To access an array embedded inside single buffer, see UniformArray and UniformSimpleArray.
Example of single buffer:
Example of arrayed buffer:
auto vpp::UniformVar< TDef, BufferT >::operator[] | ( | MemberT Definition::* | pMember | ) | const |
Provides read and write access to specified field. Single buffers only.
Some buffers are read-only. It is an error to attempt to write them.
auto vpp::UniformVar< TDef, BufferT >::operator[] | ( | const Int & | index | ) | const |
Provides read and write access to specified item. Arrayed buffers only.
Some buffers are read-only. It is an error to attempt to write them.
auto vpp::UniformVar< TDef, BufferT >::operator[] | ( | const UInt & | index | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
auto vpp::UniformVar< TDef, BufferT >::operator[] | ( | int | index | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
auto vpp::UniformVar< TDef, BufferT >::operator[] | ( | unsigned int | index | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.