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

Device creation info.

Wraps a VkDeviceCreateInfo. See Device creation for usage information.

Public types

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

Constructors, destructors, conversion operators

DeviceCreateInfo(DeviceProperties& deviceProperties, const ExtensionProperties* extensionProperties, Flags flags = {}) explicit
Constructor.
DeviceCreateInfo(DeviceProperties& deviceProperties, Flags flags = {}) explicit
DeviceCreateInfo(DeviceProperties&& deviceProperties, const ExtensionProperties* extensionProperties, Flags flags = {}) explicit
Construct with allowing to reuse already populated device properties.
DeviceCreateInfo(DeviceProperties&& deviceProperties, Flags flags = {}) explicit
DeviceCreateInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& info) explicit
Construct from existing data.
DeviceCreateInfo(const DeviceCreateInfo&) deleted
Copying is not allowed.
DeviceCreateInfo(DeviceCreateInfo&& other) noexcept
Move constructor.
operator const VkDeviceCreateInfo*() const

Public functions

auto operator=(const DeviceCreateInfo&) -> DeviceCreateInfo& deleted
Copying is not allowed.
auto operator=(DeviceCreateInfo&& other) -> DeviceCreateInfo& noexcept
Move assignment.
auto addEnabledExtensions(const Containers::StringIterable& extensions) & -> DeviceCreateInfo&
Add enabled device extensions.
auto addEnabledExtensions(const Containers::StringIterable& extensions) && -> DeviceCreateInfo&&
auto addEnabledExtensions(Containers::ArrayView<const Extension> extensions) & -> DeviceCreateInfo&
auto addEnabledExtensions(Containers::ArrayView<const Extension> extensions) && -> DeviceCreateInfo&&
auto addEnabledExtensions(std::initializer_list<Extension> extension) & -> DeviceCreateInfo&
auto addEnabledExtensions(std::initializer_list<Extension> extension) && -> DeviceCreateInfo&&
template<class ... E>
auto addEnabledExtensions() & -> DeviceCreateInfo&
template<class ... E>
auto addEnabledExtensions() && -> DeviceCreateInfo&&
auto setEnabledFeatures(const DeviceFeatures& features) & -> DeviceCreateInfo&
Add enabled device features.
auto setEnabledFeatures(const DeviceFeatures& features) && -> DeviceCreateInfo&&
auto addQueues(UnsignedInt family, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) & -> DeviceCreateInfo&
Add queues.
auto addQueues(UnsignedInt family, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) && -> DeviceCreateInfo&&
auto addQueues(UnsignedInt family, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) & -> DeviceCreateInfo&
auto addQueues(UnsignedInt family, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) && -> DeviceCreateInfo&&
auto addQueues(QueueFlags flags, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) & -> DeviceCreateInfo&
Add queues of family matching given flags.
auto addQueues(QueueFlags flags, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) && -> DeviceCreateInfo&&
auto addQueues(QueueFlags flags, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) & -> DeviceCreateInfo&
auto addQueues(QueueFlags flags, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) && -> DeviceCreateInfo&&
auto addQueues(const VkDeviceQueueCreateInfo& info) & -> DeviceCreateInfo&
Add queues using raw info.
auto addQueues(const VkDeviceQueueCreateInfo& info) && -> DeviceCreateInfo&&
auto operator*() -> VkDeviceCreateInfo&
Underlying VkDeviceCreateInfo structure.
auto operator*() const -> const VkDeviceCreateInfo&
auto operator->() -> VkDeviceCreateInfo*
auto operator->() const -> const VkDeviceCreateInfo*

Enum documentation

enum class Magnum::Vk::DeviceCreateInfo::Flag: UnsignedInt

Device creation flag.

Wraps VkDeviceCreateFlagBits.

Enumerators
NoImplicitExtensions

Don't implicitly enable any extensions.

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

This flag also affects enabling of KHR_portability_subset, which is required to be enabled by the spec on any device that advertises it, and behavior of related DeviceFeatures. See Vulkan portability subset for details.

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Vk::DeviceCreateInfo::Flags

Device creation flags.

Type-safe wrapper for VkDeviceCreateFlags.

Function documentation

Magnum::Vk::DeviceCreateInfo::DeviceCreateInfo(DeviceProperties& deviceProperties, const ExtensionProperties* extensionProperties, Flags flags = {}) explicit

Constructor.

Parameters
deviceProperties A device to use
extensionProperties Existing ExtensionProperties instance for querying available Vulkan extensions. If nullptr, a new instance may be created internally if needed. If a r-value is passed, the instance is later available through Device::properties().
flags Device creation flags

The following VkDeviceCreateInfo fields are pre-filled in addition to sType:

  • flags

You need to call at least addQueues() for a valid setup.

Magnum::Vk::DeviceCreateInfo::DeviceCreateInfo(DeviceProperties& deviceProperties, Flags flags = {}) explicit

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

Magnum::Vk::DeviceCreateInfo::DeviceCreateInfo(DeviceProperties&& deviceProperties, const ExtensionProperties* extensionProperties, Flags flags = {}) explicit

Construct with allowing to reuse already populated device properties.

Compared to DeviceCreateInfo(DeviceProperties&, const ExtensionProperties*, Flags), if the Device is subsequently constructed via Device::Device(Instance&, DeviceCreateInfo&&), the deviceProperties instance gets directly transferred to the device, meaning Device::properties() and any APIs relying on it can reuse what was possibly already queried without having to repeat the potentially complex queries second time.

Magnum::Vk::DeviceCreateInfo::DeviceCreateInfo(DeviceProperties&& deviceProperties, Flags flags = {}) explicit

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

Magnum::Vk::DeviceCreateInfo::DeviceCreateInfo(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::DeviceCreateInfo::DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& 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::DeviceCreateInfo::operator const VkDeviceCreateInfo*() const

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

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

Add enabled device 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 ExtensionProperties::isSupported() to check for their presence.

The following VkDeviceCreateInfo 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)

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

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions(Containers::ArrayView<const Extension> extensions) &

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

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions(Containers::ArrayView<const Extension> extensions) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions(std::initializer_list<Extension> extension) &

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

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions(std::initializer_list<Extension> 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>
DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions() &

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>
DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addEnabledExtensions() &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::setEnabledFeatures(const DeviceFeatures& features) &

Add enabled device features.

Returns Reference to self (for method chaining)

All enabled features are expected to be reported as supported by the device and either their core version supported by the device or the corresponding extension enabled via addEnabledExtensions(). Use DeviceProperties::features() to check for feature support.

If Vulkan 1.1 is not supported and KHR_get_physical_device_properties2 is not enabled on the instance, the pEnabledFeatures field in VkDeviceCreateInfo is set to the Vulkan 1.0 subset of features. Otherwise, depending on what features are enabled, a subset of the following structures will be added to the pNext chain:

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::setEnabledFeatures(const DeviceFeatures& features) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addQueues(UnsignedInt family, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) &

Add queues.

Parameters
family in Family index, smaller than DeviceProperties::queueFamilyCount()
priorities in Queue priorities. Size of the array implies how many queues to add and has to be at least one.
output out Where to save resulting queues once the device is created. Has to have the same sizes as priorities.
Returns Reference to self (for method chaining)

At least one queue has to be added.

The following VkDeviceCreateInfo fields are set by this function:

  • queueCreateInfoCount to the count of queues added previously by this function plus queues.size()
  • pQueueCreateInfos to an array containing all queue create infos added previously by this function together with ones from family and priorities

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addQueues(UnsignedInt family, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addQueues(UnsignedInt family, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) &

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

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addQueues(UnsignedInt family, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addQueues(QueueFlags flags, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) &

Add queues of family matching given flags.

Equivalent to picking a queue family first using DeviceProperties::pickQueueFamily() based on flags and then calling the above addQueues() variant with the family index.

Note that DeviceProperties::pickQueueFamily() exits in case it doesn't find any family satisfying given flags — for a failproof scenario you may want to go with the above overload and DeviceProperties::tryPickQueueFamily() instead.

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addQueues(QueueFlags flags, Containers::ArrayView<const Float> priorities, Containers::ArrayView<const Containers::Reference<Queue>> output) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addQueues(QueueFlags flags, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) &

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

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addQueues(QueueFlags flags, std::initializer_list<Float> priorities, std::initializer_list<Containers::Reference<Queue>> output) &&

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

DeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::addQueues(const VkDeviceQueueCreateInfo& info) &

Add queues using raw info.

Returns Reference to self (for method chaining)

Compared to addQueues() this allows you to specify additional queue properties using the pNext chain. The info is used as-is, with all pointers expected to stay in scope until device creation.

The following VkDeviceCreateInfo fields are set by this function:

  • queueCreateInfoCount to the count of queues added previously by this function plus 1
  • pQueueCreateInfos to an array containing all queue create infos added previously by this function together with info

DeviceCreateInfo&& Magnum::Vk::DeviceCreateInfo::addQueues(const VkDeviceQueueCreateInfo& info) &&

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

const VkDeviceCreateInfo& Magnum::Vk::DeviceCreateInfo::operator*() const

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

VkDeviceCreateInfo* Magnum::Vk::DeviceCreateInfo::operator->()

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

const VkDeviceCreateInfo* Magnum::Vk::DeviceCreateInfo::operator->() const

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