class new in Git master
#include <Magnum/Vk/DeviceProperties.h>
DeviceProperties Physical device properties.
Wraps a VkPhysicalDevice along with its (lazy-populated) properties and features. See the Device creation docs for an example of using this class for enumerating available devices and picking one of them.
Public static functions
- static auto wrap(Instance& instance, VkPhysicalDevice handle) -> DeviceProperties
- Wrap existing Vulkan physical device.
Constructors, destructors, conversion operators
- DeviceProperties(NoCreateT) explicit noexcept
- Construct without populating the contents.
- DeviceProperties(const DeviceProperties&) deleted
- Copying is not allowed.
- DeviceProperties(DeviceProperties&&) noexcept
- Move constructor.
- operator VkPhysicalDevice() const
Public functions
- auto operator=(const DeviceProperties&) -> DeviceProperties& deleted
- Copying is not allowed.
- auto operator=(DeviceProperties&&) -> DeviceProperties& noexcept
- Move assignment.
- auto handle() const -> VkPhysicalDevice
- Underlying VkPhysicalDevice handle.
- auto properties() -> const VkPhysicalDeviceProperties2&
- Raw device properties.
- auto version() -> Version
- Device version.
- auto isVersionSupported(Version version) -> bool
- Whether given version is supported on the device.
- auto type() -> DeviceType
- Device type.
-
auto name() -> Containers::
StringView - Device name.
- auto driver() -> DeviceDriver
- Driver ID.
- auto driverVersion() -> Version
- Driver version.
-
auto driverName() -> Containers::
StringView - Driver name.
-
auto driverInfo() -> Containers::
StringView - Driver info.
-
auto enumerateExtensionProperties(const Containers::
StringIterable& layers = {}) -> ExtensionProperties - Enumerate device extensions.
- auto features() -> const DeviceFeatures&
- Device features.
-
auto queueFamilyProperties() -> Containers::
ArrayView<const VkQueueFamilyProperties2> - Queue family properties.
- auto queueFamilyCount() -> UnsignedInt
- Queue family count.
- auto queueFamilySize(UnsignedInt queueFamily) -> UnsignedInt
- Queue count in given family.
- auto queueFamilyFlags(UnsignedInt queueFamily) -> QueueFlags
- Queue family flags.
- auto pickQueueFamily(QueueFlags flags) -> UnsignedInt
- Pick a queue family satisfying given flags.
-
auto tryPickQueueFamily(QueueFlags flags) -> Containers::
Optional<UnsignedInt> - Try to pick a queue family satisfying given flags.
- auto memoryProperties() -> const VkPhysicalDeviceMemoryProperties2&
- Device memory properties.
- auto memoryHeapCount() -> UnsignedInt
- Memory heap count.
- auto memoryHeapSize(UnsignedInt heap) -> UnsignedLong
- Memory heap size.
- auto memoryHeapFlags(UnsignedInt heap) -> MemoryHeapFlags
- Memory heap size.
- auto memoryCount() -> UnsignedInt
- Memory type count.
- auto memoryFlags(UnsignedInt memory) -> MemoryFlags
- Memory type flags.
- auto memoryHeapIndex(UnsignedInt memory) -> UnsignedInt
- Memory heap index.
- auto pickMemory(MemoryFlags requiredFlags, MemoryFlags preferredFlags = {}, UnsignedInt memories = ~UnsignedInt{}) -> UnsignedInt
- Pick a memory type satisfying given flags.
- auto pickMemory(MemoryFlags requiredFlags, UnsignedInt memories) -> UnsignedInt
-
auto tryPickMemory(MemoryFlags requiredFlags,
MemoryFlags preferredFlags = {},
UnsignedInt memories = ~UnsignedInt{}) -> Containers::
Optional<UnsignedInt> - Try to pick a memory type satisfying given flags.
-
auto tryPickMemory(MemoryFlags requiredFlags,
UnsignedInt memories) -> Containers::
Optional<UnsignedInt>
Function documentation
static DeviceProperties Magnum:: Vk:: DeviceProperties:: wrap(Instance& instance,
VkPhysicalDevice handle)
Wrap existing Vulkan physical device.
Parameters | |
---|---|
instance | Vulkan instance |
handle | The VkPhysicalDevice handle |
The handle
is expected to be originating from instance
. Unlike with other handle types, the VkPhysicalDevice handles don't have to be destroyed at the end. so there's no equivalent of e.g. Instance::
Magnum:: Vk:: DeviceProperties:: DeviceProperties(NoCreateT) explicit noexcept
Construct without populating the contents.
The constructed instance is equivalent to moved-from state. Useful in cases where you will overwrite the instance later anyway. Move another object over it to make it useful.
Magnum:: Vk:: DeviceProperties:: operator VkPhysicalDevice() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
VkPhysicalDevice Magnum:: Vk:: DeviceProperties:: handle() const
Underlying VkPhysicalDevice handle.
Unlike most handle getters, this one is marked as const
because the DeviceProperties class is treated as a view on the physical device — it doesn't change the device state in any way, only queries its properties.
const VkPhysicalDeviceProperties2& Magnum:: Vk:: DeviceProperties:: properties()
Raw device properties.
Populated lazily on first request. If Vulkan 1.1 is not supported and the KHR_pNext
member being nullptr
. Otherwise:
- If Vulkan 1.2 or the KHR_
driver_ properties extension is supported by the device, the pNext
chain contains VkPhysicalDeviceDriverProperties and the driver(), driverName() and driverInfo() properties are populated.
Version Magnum:: Vk:: DeviceProperties:: version()
Device version.
Convenience access to properties() internals, populated lazily on first request.
bool Magnum:: Vk:: DeviceProperties:: isVersionSupported(Version version)
Whether given version is supported on the device.
Compares version
against version().
DeviceType Magnum:: Vk:: DeviceProperties:: type()
Device type.
Convenience access to properties() internals, populated lazily on first request.
Containers:: StringView Magnum:: Vk:: DeviceProperties:: name()
Device name.
Convenience access to properties() internals, populated lazily on first request.
DeviceDriver Magnum:: Vk:: DeviceProperties:: driver()
Driver ID.
Convenience access to properties() internals, populated lazily on first request. Only present if Vulkan 1.2 is supported or the KHR_
Version Magnum:: Vk:: DeviceProperties:: driverVersion()
Driver version.
Convenience access to properties() internals, populated lazily on first request.
Containers:: StringView Magnum:: Vk:: DeviceProperties:: driverName()
Driver name.
Convenience access to properties() internals, populated lazily on first request. Only present if Vulkan 1.2 is supported or the KHR_
Containers:: StringView Magnum:: Vk:: DeviceProperties:: driverInfo()
Driver info.
Convenience access to properties() internals, populated lazily on first request. Only present if Vulkan 1.2 is supported or the KHR_
ExtensionProperties Magnum:: Vk:: DeviceProperties:: enumerateExtensionProperties(const Containers:: StringIterable& layers = {})
Enumerate device extensions.
Parameters | |
---|---|
layers | Additional layers to list extensions from |
Expects that all listed layers are supported — however they don't need to be enabled on the instance.
const DeviceFeatures& Magnum:: Vk:: DeviceProperties:: features()
Device features.
Populated lazily on first request, extracting the booleans into a more compact set of DeviceFeature values. If Vulkan 1.1 is not supported and the KHR_
- If Vulkan 1.1 is supported by the device, the
pNext
chain contains VkPhysicalDeviceProtectedMemoryFeatures - If Vulkan 1.1 or the KHR_
multiview extension is supported by the device, the pNext
chain contains VkPhysicalDeviceMultiviewFeatures - If Vulkan 1.1 or the KHR_
shader_ draw_ parameters extension is supported by the device, the pNext
chain contains VkPhysicalDeviceShaderDrawParametersFeatures - If the EXT_
texture_ compression_ astc_ hdr extension is supported by the device, the pNext
chain contains VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT - If Vulkan 1.2 or the KHR_
shader_ float16_ int8 extension is supported by the device, the pNext
chain contains VkPhysicalDeviceShaderFloat16Int8Features - If Vulkan 1.1 or the KHR_
16bit_ storage extension is supported by the device, the pNext
chain contains VkPhysicalDevice16BitStorageFeatures - If Vulkan 1.2 or the KHR_
imageless_ framebuffer extension is supported by the device, the pNext
chain contains VkPhysicalDeviceImagelessFramebufferFeatures - If Vulkan 1.1 or the KHR_
variable_ pointers extension is supported by the device, the pNext
chain contains VkPhysicalDeviceVariablePointersFeatures - If the KHR_
acceleration_ structure extension is supported by the device, the pNext
chain contains VkPhysicalDeviceAccelerationStructureFeaturesKHR - If Vulkan 1.1 or the KHR_
sampler_ ycbcr_ conversion extension is supported by the device, the pNext
chain contains VkPhysicalDeviceSamplerYcbcrConversionFeatures - If Vulkan 1.2 or the EXT_
descriptor_ indexing extension is supported by the device, the pNext
chain contains VkPhysicalDeviceDescriptorIndexingFeatures - If the KHR_
portability_ subset extension is supported by the device, the pNext
chain contains VkPhysicalDevicePortabilitySubsetFeaturesKHR - If Vulkan 1.2 or the KHR_
shader_ subgroup_ extended_ types extension is supported by the device, the pNext
chain contains VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures - If Vulkan 1.2 or the KHR_
8bit_ storage extension is supported by the device, the pNext
chain contains VkPhysicalDevice8BitStorageFeatures - If Vulkan 1.2 or the KHR_
shader_ atomic_ int64 extension is supported by the device, the pNext
chain contains VkPhysicalDeviceShaderAtomicInt64Features - If the EXT_
vertex_ attribute_ divisor extension is supported by the device, the pNext
chain contains VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT - If Vulkan 1.2 or the KHR_
timeline_ semaphore extension is supported by the device, the pNext
chain contains VkPhysicalDeviceTimelineSemaphoreFeatures - If Vulkan 1.2 or the KHR_
vulkan_ memory_ model extension is supported by the device, the pNext
chain contains VkPhysicalDeviceVulkanMemoryModelFeatures - If Vulkan 1.2 or the EXT_
scalar_ block_ layout extension is supported by the device, the pNext
chain contains VkPhysicalDeviceScalarBlockLayoutFeatures - If Vulkan 1.2 or the KHR_
separate_ depth_ stencil_ layouts extension is supported by the device, the pNext
chain contains VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures - If Vulkan 1.2 or the KHR_
uniform_ buffer_ standard_ layout extension is supported by the device, the pNext
chain contains VkPhysicalDeviceUniformBufferStandardLayoutFeatures - If Vulkan 1.2 or the KHR_
buffer_ device_ address extension is supported by the device, the pNext
chain contains VkPhysicalDeviceBufferDeviceAddressFeatures - If Vulkan 1.2 or the EXT_
host_ query_ reset extension is supported by the device, the pNext
chain contains VkPhysicalDeviceHostQueryResetFeatures - If the EXT_
index_ type_ uint8 extension is supported by the device, the pNext
chain contains VkPhysicalDeviceIndexTypeUint8FeaturesEXT - If the EXT_
extended_ dynamic_ state extension is supported by the device, the pNext
chain contains VkPhysicalDeviceExtendedDynamicStateFeaturesEXT - If the EXT_
robustness2 extension is supported by the device, the pNext
chain contains VkPhysicalDeviceRobustness2FeaturesEXT - If the EXT_
image_ robustness extension is supported by the device, the pNext
chain contains VkPhysicalDeviceImageRobustnessFeaturesEXT - If the KHR_
ray_ tracing_ pipeline extension is supported by the device, the pNext
chain contains VkPhysicalDeviceRayTracingPipelineFeaturesKHR - If the KHR_
ray_ query extension is supported by the device, the pNext
chain contains VkPhysicalDeviceRayQueryFeaturesKHR
If the KHR_
Containers:: ArrayView<const VkQueueFamilyProperties2> Magnum:: Vk:: DeviceProperties:: queueFamilyProperties()
Queue family properties.
Populated lazily on first request. If Vulkan 1.1 is not supported and the KHR_
UnsignedInt Magnum:: Vk:: DeviceProperties:: queueFamilyCount()
Queue family count.
Convenience access to queueFamilyProperties() internals, populated lazily on first request.
UnsignedInt Magnum:: Vk:: DeviceProperties:: queueFamilySize(UnsignedInt queueFamily)
Queue count in given family.
Parameters | |
---|---|
queueFamily | Queue family index, expected to be smaller than queueFamilyCount() |
Convenience access to queueFamilyProperties() internals, populated lazily on first request.
QueueFlags Magnum:: Vk:: DeviceProperties:: queueFamilyFlags(UnsignedInt queueFamily)
Queue family flags.
Parameters | |
---|---|
queueFamily | Queue family index, expected to be smaller than queueFamilyCount() |
Convenience access to queueFamilyProperties() internals, populated lazily on first request.
UnsignedInt Magnum:: Vk:: DeviceProperties:: pickQueueFamily(QueueFlags flags)
Pick a queue family satisfying given flags.
Returns | Queue family index for use in queueFamilySize(), queueFamilyFlags() and DeviceCreateInfo:: |
---|
Queries queue family properties using queueFamilyProperties() and tries to find the first that contains all flags
. If it is not found, exits. See tryPickQueueFamily() for an alternative that doesn't exit on failure.
Containers:: Optional<UnsignedInt> Magnum:: Vk:: DeviceProperties:: tryPickQueueFamily(QueueFlags flags)
Try to pick a queue family satisfying given flags.
Compared to pickQueueFamily() the function returns Containers::
const VkPhysicalDeviceMemoryProperties2& Magnum:: Vk:: DeviceProperties:: memoryProperties()
Device memory properties.
Populated lazily on first request. If Vulkan 1.1 is not supported and the KHR_
UnsignedInt Magnum:: Vk:: DeviceProperties:: memoryHeapCount()
Memory heap count.
Convenience access to memoryProperties() internals, populated lazily on first request.
UnsignedLong Magnum:: Vk:: DeviceProperties:: memoryHeapSize(UnsignedInt heap)
Memory heap size.
Parameters | |
---|---|
heap | Memory heap index, expected to be smaller than memoryHeapCount() |
Convenience access to memoryProperties() internals, populated lazily on first request.
MemoryHeapFlags Magnum:: Vk:: DeviceProperties:: memoryHeapFlags(UnsignedInt heap)
Memory heap size.
Parameters | |
---|---|
heap | Memory heap index, expected to be smaller than memoryHeapCount() |
Convenience access to memoryProperties() internals, populated lazily on first request.
UnsignedInt Magnum:: Vk:: DeviceProperties:: memoryCount()
Memory type count.
Convenience access to memoryProperties() internals, populated lazily on first request.
MemoryFlags Magnum:: Vk:: DeviceProperties:: memoryFlags(UnsignedInt memory)
Memory type flags.
Parameters | |
---|---|
memory | Memory type index, expected to be smaller than memoryCount() |
Convenience access to memoryProperties() internals, populated lazily on first request.
UnsignedInt Magnum:: Vk:: DeviceProperties:: memoryHeapIndex(UnsignedInt memory)
Memory heap index.
Parameters | |
---|---|
memory | Memory type index, expected to be smaller than memoryCount() |
Returns | Memory heap index, always smaller than memoryHeapCount() |
Convenience access to memoryProperties() internals, populated lazily on first request.
UnsignedInt Magnum:: Vk:: DeviceProperties:: pickMemory(MemoryFlags requiredFlags,
MemoryFlags preferredFlags = {},
UnsignedInt memories = ~UnsignedInt{})
Pick a memory type satisfying given flags.
Parameters | |
---|---|
requiredFlags | Memory flags that should be present in picked memory type. Can be an empty set, but picking such memory is probably not very useful. |
preferredFlags | If there's more than one memory type matching requiredFlags , prefer one that has most of these as well. Defaults to an empty set. |
memories | Bits indicating which memory types should be considered (bit 0 indicates memory type 0 should be considered etc.). Expected to have at least one bit of the first memoryCount() bits set, otherwise the function will always fail. Defaults to all bits set, meaning all memory types are considered. Corresponds to MemoryRequirements:: |
Queries memory properties using memoryProperties() and out of memory types set in memoryBits
tries to find one that contains all requiredFlags
and most of optionalFlags
. If it is not found, exits. See tryPickMemory() for an alternative that doesn't exit on failure.
UnsignedInt Magnum:: Vk:: DeviceProperties:: pickMemory(MemoryFlags requiredFlags,
UnsignedInt memories)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Equivalent to calling pickMemory(MemoryFlags, MemoryFlags, UnsignedInt) with empty preferredFlags
.
Containers:: Optional<UnsignedInt> Magnum:: Vk:: DeviceProperties:: tryPickMemory(MemoryFlags requiredFlags,
MemoryFlags preferredFlags = {},
UnsignedInt memories = ~UnsignedInt{})
Try to pick a memory type satisfying given flags.
Compared to pickMemory() the function returns Containers::
Containers:: Optional<UnsignedInt> Magnum:: Vk:: DeviceProperties:: tryPickMemory(MemoryFlags requiredFlags,
UnsignedInt memories)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Equivalent to calling tryPickMemory(MemoryFlags, MemoryFlags, UnsignedInt) with empty preferredFlags
.
Debug& operator<<(Debug& debug, DeviceType value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug, DeviceDriver value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug, QueueFlag value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug, QueueFlags value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug, MemoryHeapFlag value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug, MemoryHeapFlags value) new in Git master
Debug output operator.
Debug& operator<<(Debug& debug,
MemoryFlag value) new in Git master
#include <Magnum/Vk/Memory.h>
Debug output operator.
Debug& operator<<(Debug& debug,
MemoryFlags value) new in Git master
#include <Magnum/Vk/Memory.h>
Debug output operator.