![]() |
VPP
0.8
A high-level modern C++ API for Vulkan
|
Declares mutable shader local variable of array type. More...
#include <vppLangAggregates.hpp>
Public Member Functions | |
VArray (int s) | |
Constucts local array of specified size. More... | |
template<typename IndexT > | |
auto | operator[] (IndexT index) const |
Allows read/write access to elements of the array. | |
Int | Size () const |
Returns GPU-level value equal to the size of the array. | |
int | size () const |
Returns CPU-level value equal to the size of the array. | |
Declares mutable shader local variable of array type.
This allows to create local arrays of specified type (scalar, vector or matrix) and the size determined at shader compilation time.
Beware that mutable local variables may degrade performance on GPU because they consume general purpose registers for each local thread. Arrays obviously take even more registers.
vpp::VArray< ItemT >::VArray | ( | int | s | ) |
Constucts local array of specified size.
The size may come from CPU-level variable. It can not be changed after constructing the array.
The lifetime of constructed array is until the end of the shader. Consider reusing the array if possible in order to avoid excessive register usage.