class new in Git master
#include <Magnum/Vk/DeviceCreateInfo.h>
DeviceCreateInfo 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_ This flag also affects enabling of KHR_ |
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:: |
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::deviceProperties
instance gets directly transferred to the device, meaning Device::
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::
The following VkDeviceCreateInfo fields are set by this function:
enabledExtensionCount
to the count of extensions added previously by this function plusextensions.size()
pEnabledExtensionNames
to an array containing all extension strings added previously by this function together with ones fromextensions
(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::
If Vulkan 1.1 is not supported and KHR_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:
- VkPhysicalDeviceProtectedMemoryFeatures (Vulkan 1.1)
- VkPhysicalDeviceMultiviewFeatures (Vulkan 1.1, KHR_
multiview) - VkPhysicalDeviceShaderDrawParametersFeatures (Vulkan 1.1, KHR_
shader_ draw_ parameters) - VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT ( EXT_
texture_ compression_ astc_ hdr) - VkPhysicalDeviceShaderFloat16Int8Features (Vulkan 1.2, KHR_
shader_ float16_ int8) - VkPhysicalDevice16BitStorageFeatures (Vulkan 1.1, KHR_
16bit_ storage) - VkPhysicalDeviceImagelessFramebufferFeatures (Vulkan 1.2, KHR_
imageless_ framebuffer) - VkPhysicalDeviceVariablePointersFeatures (Vulkan 1.1, KHR_
variable_ pointers) - VkPhysicalDeviceAccelerationStructureFeaturesKHR ( KHR_
acceleration_ structure) - VkPhysicalDeviceSamplerYcbcrConversionFeatures (Vulkan 1.1, KHR_
sampler_ ycbcr_ conversion) - VkPhysicalDeviceDescriptorIndexingFeatures (Vulkan 1.2, EXT_
descriptor_ indexing) - VkPhysicalDevicePortabilitySubsetFeaturesKHR ( KHR_
portability_ subset) - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures (Vulkan 1.2, KHR_
shader_ subgroup_ extended_ types) - VkPhysicalDevice8BitStorageFeatures (Vulkan 1.2, KHR_
8bit_ storage) - VkPhysicalDeviceShaderAtomicInt64Features (Vulkan 1.2, KHR_
shader_ atomic_ int64) - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT ( EXT_
vertex_ attribute_ divisor) - VkPhysicalDeviceTimelineSemaphoreFeatures (Vulkan 1.2, KHR_
timeline_ semaphore) - VkPhysicalDeviceVulkanMemoryModelFeatures (Vulkan 1.2, KHR_
vulkan_ memory_ model) - VkPhysicalDeviceScalarBlockLayoutFeatures (Vulkan 1.2, EXT_
scalar_ block_ layout) - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures (Vulkan 1.2, KHR_
separate_ depth_ stencil_ layouts) - VkPhysicalDeviceUniformBufferStandardLayoutFeatures (Vulkan 1.2, KHR_
uniform_ buffer_ standard_ layout) - VkPhysicalDeviceBufferDeviceAddressFeatures (Vulkan 1.2, KHR_
buffer_ device_ address) - VkPhysicalDeviceHostQueryResetFeatures (Vulkan 1.2, EXT_
host_ query_ reset) - VkPhysicalDeviceIndexTypeUint8FeaturesEXT ( EXT_
index_ type_ uint8) - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT ( EXT_
extended_ dynamic_ state) - VkPhysicalDeviceRobustness2FeaturesEXT ( EXT_
robustness2) - VkPhysicalDeviceImageRobustnessFeaturesEXT ( EXT_
image_ robustness) - VkPhysicalDeviceRayTracingPipelineFeaturesKHR ( KHR_
ray_ tracing_ pipeline) - VkPhysicalDeviceRayQueryFeaturesKHR ( KHR_
ray_ query)
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:: |
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 plusqueues.size()
pQueueCreateInfos
to an array containing all queue create infos added previously by this function together with ones fromfamily
andpriorities
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::flags
and then calling the above addQueues() variant with the family index.
Note that DeviceProperties::flags
— for a failproof scenario you may want to go with the above overload and DeviceProperties::
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 plus1
pQueueCreateInfos
to an array containing all queue create infos added previously by this function together withinfo
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.