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 105 of file VE_PhysicalDevice.h.
|
default |
|
inline |
Definition at line 136 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 197 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 141 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 112 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 119 of file VE_PhysicalDevice.h.
VE_Result<VkImageFormatProperties2> VE_PhysicalDevice::imageFormatProperties | ( | const VkImageCreateInfo & | info | ) | const |
|
inline |
Definition at line 151 of file VE_PhysicalDevice.h.
void VE_PhysicalDevice::printInfo | ( | ) | const |
|
inline |
Definition at line 114 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 146 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 124 of file VE_PhysicalDevice.h.
|
inline |
Definition at line 130 of file VE_PhysicalDevice.h.