![]() |
VPP
0.8
A high-level modern C++ API for Vulkan
|
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 DeviceFeatures & | operator= (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... | |
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.
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.
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.
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
.
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.
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.
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.