What is PVRVk?

PVRVk provides a simplified abstraction of the Vulkan API

About PVRVk

PVRVk is an independent module providing a convenient, advanced, yet still extremely close to the original, Vulkan abstraction. It offers a combination of simplicity, ease of use, minimal overhead, and respect to the specifications.

The main features are:
  • C++ classes that wrap the Vulkan objects with their conceptual functionalities.
  • Automatic reference counted smart pointers for all Vulkan objects/object lifecycle management.
  • Command buffers that are aware of which objects await execution into them, and keep them alive.
  • Descriptor sets that contain references to the objects they contain.
  • Default parameters for all parameter objects and functions, where suitable.
  • Structs and classes initialised to sensible defaults.
  • Strongly-typed enums instead of C enums.

Developers who have used the Vulkan spec should find PVRVk very familiar without any other external references. All developer-facing functionality can be found in the pvrvk:: namespace.

To make sure PVRVk can be used by as wide an audience as possible, it is completely independent from any other Framework module.

How to use PVRVk

PVRVk can be used by following the Vulkan specification and getting a handle on the obvious conventions:

  • Enums are type-safe (enum class) and their members lose the prefix. Instead, e_ is added so that members like VK_FORMAT_2D are still valid C++ identifiers - for example: e_2D.
  • Vulkan functions become member functions of their first parameter's class. This means that any function that takes a command buffer as its first argument becomes a member function of the CommandBuffer class.
  • A few other obvious rules such as Resource Acquisition Is Initialisation (RAII) objects. This means it is possible to release whatever is not wanted any more by null-ing or resetting its handle, or just letting it go out of scope.

PVRVk has no Framework dependencies and uses vulkan_bindings.h. The compiled library file is named PVRVk, therefore the files are PVRVk.lib and libPVRVK.a. The library will need to be linked to be used.

PVRVk/PVRVk.h will need to be included in order to make available the symbols required for PVRVk, but PVRUtilsVk will always include the PVRVk headers anyway. Therefore, when using PVRUtilsVk, there is no need to '#include “PVRVk/PVRVk.h”'.

For developers familiar with Vulkan, the sections Using PVRVk in this document and Frequently Asked Questions in the Tip and Tricks document may also give some useful Vulkan tips.

PVRUtilsVk uses PVRVk. All of the PowerVR SDK Vulkan examples except for HelloAPI (which is completely raw code) are nearly all PVRVk/PVRUtilsVk code.