HDK
|
#include <VE_PhysicalDevice.h>
Static Public Member Functions | |
static VE_Result < VE_PhysicalDevice > | create (VkPhysicalDevice) |
static VE_Result< UT_Array < VE_PhysicalDevice > > | findAll (VkInstance instance) |
A wrapper around a VkPhysicalDevice object that also contains useful information about that physical device. Due to caching information from the driver, this object is rather hefty. Consider allocating it on the heap.
Definition at line 92 of file VE_PhysicalDevice.h.
|
default |
|
inline |
Definition at line 167 of file VE_PhysicalDevice.h.
|
static |
bool VE_PhysicalDevice::extensionAvailable | ( | const char * | name | ) | const |
bool VE_PhysicalDevice::extensionAvailable | ( | VE_DeviceExtension | ext | ) | const |
|
inline |
Definition at line 111 of file VE_PhysicalDevice.h.
|
static |
UT_Optional<uint32_t> VE_PhysicalDevice::findMemoryTypeIndex | ( | uint32_t | memory_type_bits, |
VkMemoryPropertyFlags | required_properties | ||
) | const |
Methods for retrieving a memory type index.
Vulkan resources can be created before any memory is actually allocated for them. This memory-less resource handle acts as a kind of meta-data object. One of the reasons for this is so the memory requirements for the resource can be queried before the resource is actually allocated, allowing us to merge the resources requirements with the applications needs and preferences.
The resource's requirements are expressed as memory type bits. The applications requirements or preferences are expressed as VkMemoryPropertyFlags. You can pass both of these to these new methods to retrieve the actually memory type index, which is all you need to actually allocate the memory.
Usage:
VkMemoryRequirements reqs; vkGetBufferMemoryRequirements(device, buffer, &reqs); uint32_t memory_type_index; auto r = physical_device.findMemoryTypeIndex(reqs.memoryTypeBits, preferred_flags | required_flags); if (!r) r = physical_device.findMemoryTypeIndex(reqs.memoryTypeBits, required_flags); memory_type_index = *r;
UT_Optional<uint32_t> VE_PhysicalDevice::findMemoryTypeIndex | ( | VkMemoryPropertyFlags | flags | ) | const |
Returns the memory type index satisfying the given flags, or none. This is equivalent to the above call with memory_type_bits == 0xFFFFFFFF
UT_Optional<uint32_t> VE_PhysicalDevice::findQueueFamilyIndex | ( | VkQueueFlags | flags | ) | const |
VkFormatProperties VE_PhysicalDevice::formatProperties | ( | const VkFormat | format | ) | const |
|
inline |
Definition at line 99 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 106 of file VE_PhysicalDevice.h.
VE_Result<VkImageFormatProperties2> VE_PhysicalDevice::imageFormatProperties | ( | const VkImageCreateInfo & | info | ) | const |
|
inline |
Definition at line 121 of file VE_PhysicalDevice.h.
void VE_PhysicalDevice::printInfo | ( | ) | const |
|
inline |
Definition at line 101 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 116 of file VE_PhysicalDevice.h.