vpr::Instance class

Instance is a wrapper around the base Vulkan object that must be initialized first.

The VkInstanceCreateInfo struct passed to the constructor contains information about the current layers enabled, and which Vulkan Instance extensions to enable. By default, this should/will contain extensions required to support the creation of a window surface (done by calling a glfw function to retrieve required extensions on glfw-enabled platforms)

Public types

enum class instance_layers: uint32_t { Disabled, Minimal, Full }
Currently both minimal and full layers are the same: need some time to better decide what the "minimal" layer setup could look like.

Constructors, destructors, conversion operators

Instance(instance_layers layers, const VkApplicationInfo* info)
Sets the layer status as specified, and changes the minor state/informational info attached to the instance as specified by the info parameter.
Instance(instance_layers layers_flags, const VkApplicationInfo* info, const VprExtensionPack* extensions, const char*const* layers = nullptr, const uint32_t layer_count = 0)
Uses an extensions list, compared to the other constructor that simply uses what glfw says is required.

Public functions

auto HasExtension(const char* extension_name) const -> bool noexcept
For the best chance of matching extension names properly, use the Vulkan macros for extension names.
void GetEnabledExtensions(size_t* num_extensions, char** extensions) const
The extensions parameter is set using strdup, so the user MUST be sure to free this memory when finished reading it.