HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VE_Device Class Reference

#include <VE_Device.h>

Public Member Functions

 VE_Device ()=default
 
void destroy ()
 
VkDevice handle () const
 
const VE_Extext () const
 
VkQueue universalQueue () const
 
uint32_t universalQueueFamilyIndex () const
 
VkQueue graphicsQueue () const
 
uint32_t graphicsQueueFamilyIndex () const
 
const VE_PhysicalDevicephysicalDevice () const
 
const VE_Instanceinstance () const
 
VE_Result< VkDeviceMemory > allocateMemory (uint64_t size, uint32_t memory_type_bits, VkMemoryPropertyFlags mem_props, bool external)
 
VE_Result< VE_BufferAllocationcreateAndAllocateBuffer (VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags mem_props, bool external)
 
VE_Result< SYS_HandlecreateExternalMemoryHandle (VkDeviceMemory memory)
 
VE_Result
< VkDebugUtilsMessengerEXT > 
setDebugCallback (VkDebugUtilsMessageSeverityFlagsEXT msg_severity_flags, VkDebugUtilsMessageTypeFlagsEXT msg_type_flags, VkBool32(*callback)(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData), void *pUserData)
 

Static Public Member Functions

static VE_Result< VE_Devicecreate (const VE_Instance &instance, const VE_PhysicalDevice &physical_device, VE_PhysicalDeviceFeatures device_features, uint32_t device_extension_count, const VE_DeviceExtension device_extensions[])
 

Detailed Description

This class contains a VkDevice handle along with the objects that are involved with the creation of it. Upon instantiation, it creates the VkInstance, finds a suitable physical device, and creates the logical VkDevice from that along queue objects. It cleans up everything upon calling destroy() on it.

It therefore forms a single convenient point interface into the Vulkan API, and can form the bedrock of a higher level abstraction.

Keep in mind the size of the object. Heap allocation is suggested.

Definition at line 48 of file VE_Device.h.

Constructor & Destructor Documentation

VE_Device::VE_Device ( )
default

Member Function Documentation

VE_Result<VkDeviceMemory> VE_Device::allocateMemory ( uint64_t  size,
uint32_t  memory_type_bits,
VkMemoryPropertyFlags  mem_props,
bool  external 
)
static VE_Result<VE_Device> VE_Device::create ( const VE_Instance instance,
const VE_PhysicalDevice physical_device,
VE_PhysicalDeviceFeatures  device_features,
uint32_t  device_extension_count,
const VE_DeviceExtension  device_extensions[] 
)
static
VE_Result<VE_BufferAllocation> VE_Device::createAndAllocateBuffer ( VkDeviceSize  size,
VkBufferUsageFlags  usage,
VkMemoryPropertyFlags  mem_props,
bool  external 
)
VE_Result<SYS_Handle> VE_Device::createExternalMemoryHandle ( VkDeviceMemory  memory)
void VE_Device::destroy ( )
const VE_Ext& VE_Device::ext ( ) const
inline

Definition at line 115 of file VE_Device.h.

VkQueue VE_Device::graphicsQueue ( ) const

TODO make sure this is available Return a queue that supports graphics operations.

uint32_t VE_Device::graphicsQueueFamilyIndex ( ) const
VkDevice VE_Device::handle ( ) const
inline

Definition at line 113 of file VE_Device.h.

const VE_Instance& VE_Device::instance ( ) const
inline

Definition at line 129 of file VE_Device.h.

const VE_PhysicalDevice& VE_Device::physicalDevice ( ) const
inline

Definition at line 127 of file VE_Device.h.

VE_Result<VkDebugUtilsMessengerEXT> VE_Device::setDebugCallback ( VkDebugUtilsMessageSeverityFlagsEXT  msg_severity_flags,
VkDebugUtilsMessageTypeFlagsEXT  msg_type_flags,
VkBool32(*)(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData)  callback,
void pUserData 
)
VkQueue VE_Device::universalQueue ( ) const

TODO make sure this is available Return a queue that supports graphics, compute, and transfer operations.

uint32_t VE_Device::universalQueueFamilyIndex ( ) const

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