Magnum::Vk::InstanceCreateInfo class new in Git master

Instance creation info.

Wraps a VkInstanceCreateInfo and VkApplicationInfo. See Instance creation for usage information.

Public types

enum class Flag: UnsignedInt { NoImplicitExtensions = 1u << 31 }
Instance creation flag.
using Flags = Containers::EnumSet<Flag>
Instance creation flags.

Constructors, destructors, conversion operators

InstanceCreateInfo(Int argc, const char*const* argv, const LayerProperties* layerProperties, const InstanceExtensionProperties*const extensionProperties, Flags flags = {})
Constructor.
InstanceCreateInfo(Int argc, const char*const* argv, Flags flags = {})
InstanceCreateInfo(Flags flags = {})
InstanceCreateInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
InstanceCreateInfo(const VkInstanceCreateInfo& info) explicit
Construct from existing data.
operator const VkInstanceCreateInfo*() const

Public functions

auto setApplicationInfo(Containers::StringView name, Version version) -> InstanceCreateInfo&
Set application info.
auto addEnabledLayers(const Containers::StringIterable& layers) -> InstanceCreateInfo&
Add enabled layers.
auto addEnabledExtensions(const Containers::StringIterable& extensions) -> InstanceCreateInfo&
Add enabled instance extensions.
auto addEnabledExtensions(Containers::ArrayView<const InstanceExtension> extensions) -> InstanceCreateInfo&
auto addEnabledExtensions(std::initializer_list<InstanceExtension> extension) -> InstanceCreateInfo&
template<class ... E>
auto addEnabledExtensions() -> InstanceCreateInfo&
auto operator*() -> VkInstanceCreateInfo&
Underlying VkInstanceCreateInfo structure.
auto operator*() const -> const VkInstanceCreateInfo&
auto operator->() -> VkInstanceCreateInfo*
auto operator->() const -> const VkInstanceCreateInfo*

Enum documentation

enum class Magnum::Vk::InstanceCreateInfo::Flag: UnsignedInt

Instance creation flag.

Wraps VkInstanceCreateFlagBits.

Enumerators
NoImplicitExtensions

Don't implicitly enable any extensions.

By default, the engine enables various extensions such as KHR_get_physical_device_properties2 to provide a broader functionality. If you want to have a complete control over what gets enabled, set this flag.

Typedef documentation

Function documentation

Magnum::Vk::InstanceCreateInfo::InstanceCreateInfo(Int argc, const char*const* argv, const LayerProperties* layerProperties, const InstanceExtensionProperties*const extensionProperties, Flags flags = {})

Constructor.

Parameters
argc Command-line argument count. Can be 0.
argv Command-line argument values. Can be nullptr. If set, is expected to stay in scope for the whole instance lifetime.
layerProperties Existing LayerProperties instance for querying available Vulkan layers. If nullptr, a new instance may be created internally if needed.
extensionProperties Existing InstanceExtensionProperties instance for querying available Vulkan extensions. If nullptr, a new instance may be created internally if needed.
flags Instance creation flags

The following VkInstanceCreateInfo fields are pre-filled in addition to sType, everything else is zero-filled:

Magnum::Vk::InstanceCreateInfo::InstanceCreateInfo(Int argc, const char*const* argv, Flags flags = {})

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Magnum::Vk::InstanceCreateInfo::InstanceCreateInfo(Flags flags = {})

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Magnum::Vk::InstanceCreateInfo::InstanceCreateInfo(NoInitT) explicit noexcept

Construct without initializing the contents.

Note that not even the sType field is set — the structure has to be fully initialized afterwards in order to be usable.

Magnum::Vk::InstanceCreateInfo::InstanceCreateInfo(const VkInstanceCreateInfo& info) explicit

Construct from existing data.

Copies the existing values verbatim, pointers are kept unchanged without taking over the ownership. Modifying the newly created instance will not modify the original data nor the pointed-to data.

Magnum::Vk::InstanceCreateInfo::operator const VkInstanceCreateInfo*() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::setApplicationInfo(Containers::StringView name, Version version)

Set application info.

Returns Reference to self (for method chaining)

Use the version() helper to create the version value. The name is nullptr by default.

The following VkInstanceCreateInfo fields are set by this function:

  • pApplicationInfo
  • pApplicationInfo->pApplicationName to name (a copy of it, if needed)
  • pApplicationInfo->applicationVersion to version

InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::addEnabledLayers(const Containers::StringIterable& layers)

Add enabled layers.

Returns Reference to self (for method chaining)

All listed layers are expected be supported, use LayerProperties::isSupported() to check for their presence. If a particular layer is listed among --magnum-disable-layers in command-line options, it's not added.

The following VkInstanceCreateInfo fields are set by this function:

  • enabledLayerCount to the count of layers added previously by this function plus layers.size()
  • pEnabledLayerNames to an array containing all layer strings added previously by this function together with ones from layers (doing a copy where needed)

InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::addEnabledExtensions(const Containers::StringIterable& extensions)

Add enabled instance extensions.

Returns Reference to self (for method chaining)

All listed extensions are expected to be supported either globally or in at least one of the enabled layers, use InstanceExtensionProperties::isSupported() to check for their presence. If a particular extension is listed among --magnum-disable-extensions in command-line options, it's not added.

The following VkInstanceCreateInfo fields are set by this function:

  • enabledExtensionCount to the count of extensions added previously by this function plus extensions.size()
  • pEnabledExtensionNames to an array containing all extension strings added previously by this function together with ones from extensions (doing a copy where needed)

InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::addEnabledExtensions(Containers::ArrayView<const InstanceExtension> extensions)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::addEnabledExtensions(std::initializer_list<InstanceExtension> extension)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class ... E>
InstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::addEnabledExtensions()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const VkInstanceCreateInfo& Magnum::Vk::InstanceCreateInfo::operator*() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

VkInstanceCreateInfo* Magnum::Vk::InstanceCreateInfo::operator->()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const VkInstanceCreateInfo* Magnum::Vk::InstanceCreateInfo::operator->() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.