![]() |
VPP
0.8
A high-level modern C++ API for Vulkan
|
Represents the instance of Vulkan system. More...
#include <vppInstance.hpp>
Public Member Functions | |
~Instance () | |
Destructor. | |
VkInstance | handle () const |
Retrieves Vulkan handle for the instance. | |
bool | valid () const |
Checks whether instance creation has succeeded. | |
const std::set< std::string > & | enabledExtensions () const |
Retrieves the names of enabled extensions. | |
VkResult | enumeratePhysicalDevices (PhysicalDevices *pResult) const |
Gets a list of physical devices in the system. | |
Static Public Member Functions | |
static SVulkanVersion | getLatestAvailableVulkanVersion () |
Gets newest Vulkan version available on the system. More... | |
static SVulkanVersion | supportedVersion () |
Gets the minimum of two versions: latest available and requested by user. | |
static VkResult | enumerateExtensions (ExtensionProperties *pResult) |
Gets a list of available Vulkan extensions for the instance. | |
static DebugReporter * | getDebugReporter () |
Gets currently registered debug reporter, or zero if there is no one. | |
Represents the instance of Vulkan system.
The instance is the root object of entire Vulkan system. The main purpose is to provide access to physical devices in the system as well as the list of available Vulkan extensions.
There can be only one instance object per program. You can construct multiple ones, but all of them will point to the same object internally. Do not create many instances from different threads however, this operation is not thread safe. Best practice is to create just one, from your main thread and keep its life time until the end of the program. You can pass the Instance object by value, also to other threads.
This object is reference-counted and may be passed by value.
Instance is created by means of createInstance() special function.
An example:
|
static |
Gets newest Vulkan version available on the system.
Caution: on systems where there is no Vulkan driver installed, it might still return version 1.0. Try creating instance and check valid()
method on it in order to determine if Vulkan is supported at all.