![]() |
VPP
0.8
A high-level modern C++ API for Vulkan
|
Instance factory class. More...
#include <vppInstance.hpp>
Public Member Functions | |
createInstance () | |
Constructs instance factory object with default options. | |
createInstance & | vulkan (const SVulkanVersion &v) |
Sets the target Vulkan version (default: 1.0.0). More... | |
createInstance & | validation (bool v) |
Sets the validation status (default: disabled). | |
createInstance & | raw (bool v) |
If set, VPP will not add any extensions automatically (default: false). More... | |
createInstance & | appName (const char *v) |
Sets the application name (default: null). More... | |
createInstance & | engineName (const char *v) |
Sets the engine name (default: null). More... | |
createInstance & | appVersion (unsigned int v) |
Sets the application version (default: 0). More... | |
createInstance & | engineVersion (unsigned int v) |
Sets the engine version (default: 0). More... | |
createInstance & | ext (const std::string &v) |
Adds an instance extension to enable. More... | |
createInstance & | layer (const std::string &v) |
Adds a layer to enable. More... | |
operator Instance () const | |
Creates actual instance with specified options. | |
Instance factory class.
This class is meant to be used somewhat like a function. The syntax is as in the following examples:
The createInstance
actually construct proxy object that you can configure using chain of methods, and finally assign it to Instance variable. The last step creates the actual instance.
The default options (if you do not call any methods on the proxy object) are:
createInstance& vpp::createInstance::appName | ( | const char * | v | ) |
Sets the application name (default: null).
This is arbitrary name of your choice.
Providing information about your application in theory might enable Vulkan to include optimizations made for specific applications.
createInstance& vpp::createInstance::appVersion | ( | unsigned int | v | ) |
Sets the application version (default: 0).
This is arbitrary value of your choice.
Providing information about your application in theory might enable Vulkan to include optimizations made for specific applications.
createInstance& vpp::createInstance::engineName | ( | const char * | v | ) |
Sets the engine name (default: null).
This is arbitrary name of your choice.
Providing information about your application in theory might enable Vulkan to include optimizations made for specific applications.
createInstance& vpp::createInstance::engineVersion | ( | unsigned int | v | ) |
Sets the engine version (default: 0).
This is arbitrary value of your choice.
Providing information about your application in theory might enable Vulkan to include optimizations made for specific applications.
createInstance& vpp::createInstance::ext | ( | const std::string & | v | ) |
Adds an instance extension to enable.
Note that VPP enables some extensions automatically. Also, extensions that you supply here will be enabled only if supported by the system the application is being run on.
createInstance& vpp::createInstance::layer | ( | const std::string & | v | ) |
Adds a layer to enable.
Note that VPP enables some layers automatically and the system may also load additional layers without knowledge of the application.
createInstance& vpp::createInstance::raw | ( | bool | v | ) |
If set, VPP will not add any extensions automatically (default: false).
Only extensions you explicitly mention will be loaded (including surface, swapchain and debug extensions).
createInstance& vpp::createInstance::vulkan | ( | const SVulkanVersion & | v | ) |
Sets the target Vulkan version (default: 1.0.0).
Vulkan installations are backward-compatible. For example, if the system supports Vulkan 1.1, then it also supports Vulkan 1.0. However, there might exist systems not supporting Vulkan 1.1. It is your decision whether you require extended features of Vulkan 1.1 (or any further version). If not, then target earlier version. In general, it is reasonable to require minimum version that you actually need for features.
Only major
and minor
fields of the version structure are significant when matching the version. The patch
field is ignored.
Specifying required version during instance construction must be followed by checking whether target physical device actually supports that version. There might be e.g. a system where new Vulkan driver is installed, but the device is an old graphic card with only Vulkan 1.0 support. You must manually check the device properties before using any features requiring newer version. Otherwise assume that capabilities and semantics are just as in older version.