![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Template for defining uniform data fields. More...
#include <vppLangIntUniform.hpp>
Public Member Functions | |
UniformFld () | |
Constructs uninitialized or GPU-side data field. | |
UniformFld (const HostT &value) | |
Constructs initialized CPU-side data field. | |
operator HostT & () | |
Allows CPU-side access to the field. | |
operator const HostT & () const | |
Allows CPU-side read-only access to the field. | |
Template for defining uniform data fields.
Place UniformFld inside UniformStruct to define a data field. This field can have scalar, vector or matrix type. You must specify one type in the template argument list: the host type (CPU-side). The shader (GPU-side) type is automatically inferred.
Example:
The first argument should be the tag passed from UniformStruct.
The second argument describes the CPU type. That allows to create CPU version of the structure that is compatible with GPU version. This argument can be one of the following:
data_type
defined with the format.vppSupportGLM.hpp
for that to work.[ caution! document also alignment issues with uniform buffers! ]