Class VulkanInstance#

Class Documentation#

class VulkanInstance#

Public Functions

explicit VulkanInstance(std::string_view appName, std::vector<std::string> instanceLayers = {}, std::vector<std::string> instanceExtensions = {})#

Constructor.

Parameters:
  • appNameApplication name.

  • instanceLayersOptional: Instance layers to use.

  • instanceExtensionsOptional: Instance extensions to use.

~VulkanInstance()#

Destructor.

consteval VulkanInstance(const VulkanInstance&) noexcept = delete#

Copy constructor.

consteval VulkanInstance &operator=(const VulkanInstance&) noexcept = delete#

Copy assignment operator.

constexpr VulkanInstance(VulkanInstance&&) noexcept = default#

Move constructor.

VulkanInstance &operator=(VulkanInstance&&) noexcept = default#

Move assignment operator.

constexpr VkInstance GetVkInstance() const noexcept#

Retrieve the Vulkan instance handle.

Returns:

Vulkan instance handle.

constexpr const std::vector<std::string> &GetUsedInstanceLayers() const noexcept#

Retrieve a list of used instance layers.

Returns:

List of used instance layers.

constexpr const std::vector<std::string> &GetUsedInstanceExtensions() const noexcept#

Retrieve a list of used instance extensions.

Returns:

List of used instance extensions.

Public Static Functions

static TRAP::Optional<u32> GetInstanceVersion()#

Retrieve the Vulkan instance version packed by VK_MAKE_API_VERSION.

Returns:

Vulkan instance version if available, empty optional otherwise.

static std::optional<VkLayerProperties> GetInstanceLayerProperties(std::string_view instanceLayer)#

Retrieve the properties for the given instance layer.

Parameters:

instanceLayer – Instance layer to get properties from.

Returns:

Instance layer properties.

static std::optional<VkExtensionProperties> GetInstanceExtensionProperties(std::string_view instanceExtension)#

Retrieve the properties for the given instance extension.

Parameters:

instanceExtension – Instance extension to get properties from.

Returns:

Instance extension properties.

static bool IsLayerSupported(std::string_view layer)#

Check whether an instance layer is supported or not.

Parameters:

layer – Instance layer to check.

Returns:

True if the instance layer is supported, false otherwise.

static bool IsExtensionSupported(std::string_view extension)#

Check whether an instance extension is supported or not.

Parameters:

extension – Instance extension to check.

Returns:

True if the instance extension is supported, false otherwise.

static bool IsExtensionSupported(VulkanInstanceExtension extension)#

Check whether an instance extension is supported or not.

Parameters:

extension – Instance extension to check.

Returns:

True if the instance extension is supported, false otherwise.