VPP  0.7
A high-level modern C++ API for Vulkan
VPP Documentation

VPP is a high-level C++ rendering and GPU computation API based on Vulkan.

Vulkan is the new API for 3D graphics rendering and GPU computation developed by Khronos Group.

VPP adds high-level, object-oriented C++ interface over Vulkan. The goal is to make Vulkan programming easier and more intuitive. VPP provides the following features:

This document describes VPP classes, functions and data types grouped by their purpose. For some introductory texts explaining various topics, click the Related Pages button on the navigation panel.

All VPP elements are contained in the vpp namespace.

System classes

Classes providing basic interface to devices and operating system.

Render and compute pass construction classes

These classes provide high-level building blocks for the rendering or computation system.

Resource objects

Classes representing major resources: data buffers, images and samplers.

Memory allocation

Classes providing memory allocation services, both on GPU and CPU side.

Data containers

These classes help to construct various types of data buffers.

Pipeline construction classes

High-level building blocks for rendering and computation pipelines.

High level execution

These classes are high level interfaces to general mechanisms: rendering, computation and auxiliary processing. Using them is optional, as they provide very easy usage at the expense of limited control over what is going on under the hood. Recommended for beginners and to make simple projects.

Recording and execution of commands

These classes are responsible for recording and running Vulkan commands.

Synchronization primitives

Synchronization mechanisms for parallel execution.

Rendering configuration classes

Configuring various parameters.

Resource binding points

These classes should be used within custom PipelineConfig subclasses to define resource binding points. A binding point is auxiliary object representing some resource accessible in GPU-level shaders. After declaring a binding point, you can bind some data buffer to it and then read or write the data in the shader.

There are the following binding point classes and templates:

Vertex and instance data

Uniform, storage and texel data buffers

Push constants

Images and textures

Arrays of resource binding points

Render graph attachments

Inter-shader communication

Binding point accessors

Resource views

Resource binding helpers

Shader binding points

These classes also are meant to be used within PipelineConfig subclasses. They declare shader code blocks. A shader is plain C++ method which must be registered by binding it to appropriate shader binding point. You provide the method pointer to the binding point constructor.

Shader interface classes

Shader interface objects are provided by VPP to shader routines. Each shader type has both its own binding point type, and interface type. A pointer to the interface object is supplied to registered shader method. You can access built-in variables and some special functions through that pointer. Available variables and functions depend on shader type.

Shader language simple data types

Those are simple types which you can use in shader code. By convention, their names start with capital letters, to distinguish them from native C++ types.

There are two kinds of simple types: constants (r-values) and mutable (l-values). Constants are preferable, as they guarantee optimal performance. Mutable variables can degrade performance, as they consume GPU registers which are usually limited. When registers run out, the shader compiler will start to allocate GPU memory, which is much slower than registers. Therefore use constants if possible. Mutable type names by convention start with capital V letter.

Simple types cover scalar, vector and matrix types.

Shader language compound data types

Compound types also come in two kinds, but different than scalar types. There are array and structural compound types.

Array types always denote local mutable variables. There are no constant arrays. Also, array types are not used for non-local variables, like uniform buffers. Those object have their own means to access the data items (binding point accessors), which resemble array syntax but are not arrays described here.

Structural types come in several flavors differing in how they interact with CPU side. Those of them which are shared with CPU side, require for each field either CPU data type which maps to GPU type (UniformStruct), or Vulkan format specification (VertexStruct, InstanceStruct). LocalStruct types are local and require only GPU field types to be specified.

Shader language constructs

Shader language functions

Shader language functions for accessing textures and images

Debugging helpers