This class holds a handle to backend-specific memory.
More...
#include <IDeviceMemory.h>
|
|
static constexpr UInt64 | WholeSize = std::numeric_limits<UInt64>::max() |
| | Special constant that represents the whole memory size.
|
| |
This class holds a handle to backend-specific memory.
◆ Init()
| virtual ResultCode UN::IDeviceMemory::Init |
( |
const DescriptorType & |
desc | ) |
|
|
pure virtual |
Allocate memory with specified descriptor.
- Parameters
-
| desc | - Device memory descriptor. |
- Returns
- ResultCode::Success or an error code.
Implemented in UN::DeviceMemoryBase.
◆ IsCompatible() [1/2]
| virtual bool UN::IDeviceMemory::IsCompatible |
( |
IDeviceObject * |
pObject | ) |
|
|
pure virtual |
Check if the memory is compatible with an object.
The implementation is backend-specific, it not only checks if the size of device memory is greater or equal to the size of memory required by the object, but also check backend's memory type, e.g. Vulkan's memory type bits to be compatible.
- Parameters
-
| pObject | - The object to check the memory for. |
- Returns
- True if the memory is compatible.
Implemented in UN::VulkanDeviceMemory.
◆ IsCompatible() [2/2]
| virtual bool UN::IDeviceMemory::IsCompatible |
( |
IDeviceObject * |
pObject, |
|
|
UInt64 |
sizeLimit |
|
) |
| |
|
pure virtual |
Check if the memory is compatible with an object.
The implementation is backend-specific, it not only checks if the size of device memory is greater or equal to the size of memory required by the object, but also checks backend's memory type, e.g. Vulkan's memory type bits to be compatible.
- Parameters
-
| pObject | - The object to check the memory for. |
| sizeLimit | - Maximum size of memory in bytes allowed for the object to occupy. |
- Returns
- True if the memory is compatible.
Implemented in UN::VulkanDeviceMemory.
◆ Map()
| virtual ResultCode UN::IDeviceMemory::Map |
( |
UInt64 |
byteOffset, |
|
|
UInt64 |
byteSize, |
|
|
void ** |
ppData |
|
) |
| |
|
pure virtual |
Map the device memory to access it from the host.
- Parameters
-
| byteOffset | - Byte offset of the memory to map. |
| byteSize | - Size of the part of the memory to map. |
| ppData | - A pointer to the memory where the pointer to the mapped memory will be written. |
- Note
- This function is only valid to use if the memory was allocated with MemoryKindFlags::HostAccessible flag.
- Returns
- ResultCode::Success or an error node.
Implemented in UN::VulkanDeviceMemory.
◆ Unmap()
| virtual void UN::IDeviceMemory::Unmap |
( |
| ) |
|
|
pure virtual |
Unmap the mapped memory.
- Note
- This function does nothing if the memory was not mapped by calling Map().
Implemented in UN::VulkanDeviceMemory.
The documentation for this class was generated from the following file: