![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Base class for vertex data structures. More...
#include <vppLangIntVertex.hpp>
Base class for vertex data structures.
Inherit from this class to define your vertex data structure template. The first template argument should be passed from your template. The second one should be the name of your template which is being derived.
Use Attribute template to define fields inside the structure.
Structures defined with VertexStruct will be treated in vertex shaders as holding the data for single vertex of a mesh.
Instantiating the template with GPU tag argument gives GPU-side version of the structure, while CPU tag gives the host version. The CPU version can be directly used to fill data buffers meant to be transfered to GPU.
CPU flavor uses Vulkan format enumeration internally. Also Attribute arguments correspond to vpp::format arguments. This is because Vulkan needs to interpret the data in order to construct and rasterize primitives. Interpretation of numeric data in Vulkan is based on the format.
Example of type definition: