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

#include <VE_Memory.h>

+ Inheritance diagram for VE_Memory:

Public Member Functions

VkDeviceMemory getVkMem () const
 
VkDeviceSize getOffset () const
 
VkDeviceSize getSize () const
 
const VmaAllocationInfo & allocInfo () const
 
 UT_NON_COPYABLE (VE_Memory)
 
VE_MemType getType () const
 
voidmapMemory ()
 
void unmapMemory ()
 
voidmappedPointer ()
 
const voidmappedPointer () const
 
bool isCoherent () const
 
bool isDedicated () const
 
 VE_Memory (VE_Memory &&other) noexcept
 
VE_Memoryoperator= (VE_Memory &&other) noexcept
 
VE_Result< SYS_HandlegetExternalHandle (VkDevice device, const VE_Ext *ext)
 
virtual ~VE_Memory ()
 

Friends

class VE_MemoryAllocator
 

Detailed Description

A block of memory as allocated by VE_MemoryAllocator. Will free itself when it goes out of scope. It represents a block of bytes, and should in general be used to as a backing member in some higher level, resource-like class, such as a Buffer or Image class.

Definition at line 118 of file VE_Memory.h.

Constructor & Destructor Documentation

VE_Memory::VE_Memory ( VE_Memory &&  other)
inlinenoexcept

Definition at line 142 of file VE_Memory.h.

virtual VE_Memory::~VE_Memory ( )
virtual

Member Function Documentation

const VmaAllocationInfo& VE_Memory::allocInfo ( ) const
inline

Definition at line 125 of file VE_Memory.h.

VE_Result<SYS_Handle> VE_Memory::getExternalHandle ( VkDevice  device,
const VE_Ext ext 
)

On linux, the returned handle is owned by the caller, and the caller is fully responsible for it. No operations are allowed on the file descriptor after a successful import into OpenCL (section 5.5.2.1 of the OpenCL spec). Likewise, performing any operation on the file descriptor after an import into OpenGL results in undefined behaviour (documented in description of the EXT_external_objects_fd extension). As a result, different callers will potentially get different handles. On windows, the returned handle is NOT owned by the caller! The caller can use the handle to import the Vulkan memory, but should not close it. See section 5.5.2.2 of the OpenCL spec and documentation for extension EXT_external_objects_win32 for more information. Every caller of this function thus shares the same handle. On mac, this function returns extension_unavailable error.

VkDeviceSize VE_Memory::getOffset ( ) const
inline

Definition at line 122 of file VE_Memory.h.

VkDeviceSize VE_Memory::getSize ( ) const
inline

Definition at line 123 of file VE_Memory.h.

VE_MemType VE_Memory::getType ( ) const
inline

Definition at line 131 of file VE_Memory.h.

VkDeviceMemory VE_Memory::getVkMem ( ) const
inline

Definition at line 121 of file VE_Memory.h.

bool VE_Memory::isCoherent ( ) const
inline

Definition at line 139 of file VE_Memory.h.

bool VE_Memory::isDedicated ( ) const
inline

Definition at line 140 of file VE_Memory.h.

void* VE_Memory::mapMemory ( )
void* VE_Memory::mappedPointer ( )
inline

Definition at line 136 of file VE_Memory.h.

const void* VE_Memory::mappedPointer ( ) const
inline

Definition at line 137 of file VE_Memory.h.

VE_Memory& VE_Memory::operator= ( VE_Memory &&  other)
inlinenoexcept

Definition at line 147 of file VE_Memory.h.

void VE_Memory::unmapMemory ( )
VE_Memory::UT_NON_COPYABLE ( VE_Memory  )

Friends And Related Function Documentation

friend class VE_MemoryAllocator
friend

Definition at line 188 of file VE_Memory.h.

Member Data Documentation

VE_MemFlags VE_Memory::flags

Definition at line 200 of file VE_Memory.h.

void* VE_Memory::mappedPtr

Definition at line 199 of file VE_Memory.h.

VE_MemType VE_Memory::type

Definition at line 198 of file VE_Memory.h.


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