Class Instance

Class Documentation

class inexor::vulkan_renderer::wrapper::Instance

RAII wrapper class for VkInstances.

Public Functions

Instance(const std::string &application_name, const std::string &engine_name, std::uint32_t application_version, std::uint32_t engine_version, std::uint32_t vk_api_version, bool enable_validation_layers, bool enable_renderdoc_layer, const std::vector<std::string> &requested_instance_extensions, const std::vector<std::string> &requested_instance_layers)

Construct the Vulkan instance and specify the requested instance layers and instance extensions.

Parameters
  • application_name – The Vulkan application’s internal application name.

  • engine_name – The Vulkan application’s internal engine name.

  • application_version – The Vulkan application’s internal version.

  • engine_version – The Vulkan application’s internal engine version.

  • vk_api_version – The requested version of Vulkan API from which an instance will be created. If the requested version of Vulkan API is not available, the creation of the instance will fail!

  • enable_validation_layers – True if validation layers should be enabled, false otherwise.

  • enable_renderdoc_layer – True if renderdoc layer should be enabled, false otherwise.

  • requested_instance_extensions – The instance extensions which are requested.

  • requested_instance_layers – The instance layers which are requested.

Instance(const std::string &application_name, const std::string &engine_name, std::uint32_t application_version, std::uint32_t engine_version, std::uint32_t vk_api_version, bool enable_validation_layers, bool enable_renderdoc_layer)

Construct the Vulkan instance without the requested instance layers and instance extensions.

Parameters
  • application_name – The Vulkan application’s internal application name.

  • engine_name – The Vulkan application’s internal engine name.

  • application_version – The Vulkan application’s internal version.

  • engine_version – The Vulkan application’s internal engine version.

  • vk_api_version – The requested version of Vulkan API from which an instance will be created. If the requested version of Vulkan API is not available, the creation of the instance will fail!

  • enable_validation_layers – True if validation layers should be enabled, false otherwise.

  • enable_renderdoc_layer – True if renderdoc layer should be enabled, false otherwise.

Instance(const Instance&) = delete
Instance(Instance&&) noexcept
~Instance()
Instance &operator=(const Instance&) = delete
Instance &operator=(Instance&&) = default
inline VkInstance instance() const
inline std::uint32_t vulkan_api_version() const

Public Static Functions

static bool is_layer_supported(const std::string &layer_name)

Check if a certain instance layer is available on the system.

Parameters

layer_name – The name of the instance layer.

Returns

true if the instance layer is supported.

static bool is_extension_supported(const std::string &extension_name)

Check if a certain instance extension is supported on the system.

Parameters

extension_name – The name of the instance extension.

Returns

true if the instance extension is supported.

Private Members

VkInstance m_instance = {VK_NULL_HANDLE}
std::uint32_t m_vk_api_version