VPP  0.8
A high-level modern C++ API for Vulkan
vpp::DeviceFeatures Class Reference

Utility class for dealing with device features and known extensions. More...

#include <vppPhysicalDevice.hpp>

Public Member Functions

 DeviceFeatures ()
 Constructs the empty feature list. More...
 
 DeviceFeatures (const DeviceFeatures &rhs)
 Constructs a copy of specified feature list.
 
const DeviceFeaturesoperator= (const DeviceFeatures &rhs)
 Makes a copy of specified feature list.
 
void readSupported (const PhysicalDevice &hDevice)
 Reads supported features and known extensions from specified device. More...
 
void readSupported (VkPhysicalDevice hDevice)
 
bool operator[] (EFeature feature) const
 Reads the status of specified feature or known extension. More...
 
bool enableIfSupported (EFeature feature, const PhysicalDevice &hDevice)
 Enables specified feature or known extension if supported by the device. More...
 
const char * getFeatureName (EFeature feature)
 Retrieves the name of specified feature or known extension. More...
 

Detailed Description

Utility class for dealing with device features and known extensions.

Certain device features and extensions must be explicitly enabled in order to make their functionality available. DeviceFeatures class manages such features and extensions known by VPP. All features and most extensions are disabled by default, and you can enable them selectively calling the enableIfSupported() method.

Next, you should specify the DeviceFeatures object to the Device constructor. DeviceFeatures is only a container of flags, it is the Device object that will actually enable the features and extensions.

Constructor & Destructor Documentation

◆ DeviceFeatures()

vpp::DeviceFeatures::DeviceFeatures ( )

Constructs the empty feature list.

Everything is disabled except certain extensions enabled by default (like the swapchain) and extensions incorporated into core Vulkan API.

Member Function Documentation

◆ enableIfSupported()

bool vpp::DeviceFeatures::enableIfSupported ( EFeature  feature,
const PhysicalDevice hDevice 
)

Enables specified feature or known extension if supported by the device.

Returns whether enabling was successful.

◆ getFeatureName()

const char* vpp::DeviceFeatures::getFeatureName ( EFeature  feature)

Retrieves the name of specified feature or known extension.

For extensions, this will return the canonical extension name, e.g. VK_KHR_shader_atomic_int64.

◆ operator[]()

bool vpp::DeviceFeatures::operator[] ( EFeature  feature) const

Reads the status of specified feature or known extension.

Value of true means that specific feature or extension is marked as enabled in this particular feature set.

◆ readSupported() [1/2]

void vpp::DeviceFeatures::readSupported ( const PhysicalDevice hDevice)

Reads supported features and known extensions from specified device.

Note: this retrieves supported features and known extensions from Vulkan each time. For a cached version, refer to PhysicalDevice::features() method.

◆ readSupported() [2/2]

void vpp::DeviceFeatures::readSupported ( VkPhysicalDevice  hDevice)

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


The documentation for this class was generated from the following file: