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

Extension properties.

Provides a searchable container of Vulkan device extensions enumerated with DeviceProperties::enumerateExtensionProperties().

See the Device creation docs for an example of using this class for checking available extensions before enabling them on a device. See Instance creation docs for the same but using InstanceExtensionProperties.

Derived classes

class InstanceExtensionProperties new in Git master
Instance extension properties.

Constructors, destructors, conversion operators

ExtensionProperties(NoCreateT) explicit
Construct without populating the contents.
ExtensionProperties(const ExtensionProperties&) deleted
Copying is not allowed.
ExtensionProperties(ExtensionProperties&&) noexcept
Move constructor.

Public functions

auto operator=(const ExtensionProperties&) -> ExtensionProperties& deleted
Copying is not allowed.
auto operator=(ExtensionProperties&&) -> ExtensionProperties& noexcept
Move assignment.
auto names() const -> Containers::ArrayView<const Containers::StringView>
Instance extensions.
auto isSupported(Containers::StringView extension, UnsignedInt revision = 1) const -> bool
Whether given extension is supported.
auto isSupported(const Extension& extension, UnsignedInt revision = 1) const -> bool
template<class E>
auto isSupported(UnsignedInt revision = 1) const -> bool
auto count() const -> UnsignedInt
Count of extensions reported by the driver for all layers.
auto name(UnsignedInt id) const -> Containers::StringView
Extension name.
auto revision(UnsignedInt id) const -> UnsignedInt
Extension revision.
auto revision(Containers::StringView extension) const -> UnsignedInt
Revision of a particular extension name.
auto revision(const Extension& extension) const -> UnsignedInt
template<class E>
auto revision() const -> UnsignedInt
auto layer(UnsignedInt id) const -> UnsignedInt
Extension layer index.

Function documentation

Magnum::Vk::ExtensionProperties::ExtensionProperties(NoCreateT) explicit

Construct without populating the contents.

Equivalent to a moved-from state. Move over the result of DeviceProperties::enumerateExtensionProperties() to make it usable.

Containers::ArrayView<const Containers::StringView> Magnum::Vk::ExtensionProperties::names() const

Instance extensions.

A list of all extension strings reported by the driver for all layers passed to the constructor, with duplicates removed. Use isSupported() to query support of a particular extension. Note that the list is sorted and thus may be different than the order in which the name() and revision() accessors return values.

The returned views are owned by the ExtensionProperties instance (i.e., not a global memory).

bool Magnum::Vk::ExtensionProperties::isSupported(Containers::StringView extension, UnsignedInt revision = 1) const

Whether given extension is supported.

Parameters
extension Extension string
revision Minimal required revision. If the extension is present but in an older revision, the function returns false.

Since extension strings are easy to mistype, you're encouraged to use the other overloads such as isSupported(UnsignedInt) const together with extensions from the Extensions namespace.

Search complexity is $ \mathcal{O}(\log n) $ in the total extension count; in contrast extension queries on a created instance are $ \mathcal{O}(1) $ .

bool Magnum::Vk::ExtensionProperties::isSupported(const Extension& extension, UnsignedInt revision = 1) const

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>
bool Magnum::Vk::ExtensionProperties::isSupported(UnsignedInt revision = 1) const

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

UnsignedInt Magnum::Vk::ExtensionProperties::count() const

Count of extensions reported by the driver for all layers.

The count includes potential duplicates when an extension is both available globally and through a particular layer.

Containers::StringView Magnum::Vk::ExtensionProperties::name(UnsignedInt id) const

Extension name.

Parameters
id Extension index, expected to be smaller than count()

The returned view is owned by the ExtensionProperties instance (i.e., not a global memory).

UnsignedInt Magnum::Vk::ExtensionProperties::revision(UnsignedInt id) const

Extension revision.

Parameters
id Extension index, expected to be smaller than count()

UnsignedInt Magnum::Vk::ExtensionProperties::revision(Containers::StringView extension) const

Revision of a particular extension name.

If the extension is not supported, returns 0, supported extensions always have a non-zero revision. If the extension is implemented by more than one layer, returns revision of the first layer implementing it — use revision(UnsignedInt) const to get revision of a concrete extension in a concrete layer.

UnsignedInt Magnum::Vk::ExtensionProperties::revision(const Extension& extension) const

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>
UnsignedInt Magnum::Vk::ExtensionProperties::revision() const

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

UnsignedInt Magnum::Vk::ExtensionProperties::layer(UnsignedInt id) const

Extension layer index.

Parameters
id Extension index, expected to be smaller than count()

Returns ID of the layer the extension comes from. 0 is global extensions, 1 is the first layer passed to enumerateInstanceExtensionProperties() and so on.