2#include <UnCompute/Backend/DeviceMemoryBase.h>
3#include <UnCompute/Memory/Memory.h>
4#include <UnCompute/VulkanBackend/VulkanInclude.h>
10 VkDeviceMemory m_NativeMemory = VK_NULL_HANDLE;
11 UInt32 m_MemoryTypeIndex = 0;
12 bool m_Mapped =
false;
21 ResultCode
Map(UInt64 byteOffset, UInt64 byteSize,
void** ppData)
override;
22 void Unmap()
override;
25 void Reset()
override;
27 [[nodiscard]]
inline VkDeviceMemory GetNativeMemory()
const
29 return m_NativeMemory;
34 *ppMemory = AllocateObject<VulkanDeviceMemory>(pDevice);
35 (*ppMemory)->AddRef();
36 return ResultCode::Success;
Definition: DeviceMemoryBase.h:8
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
This class holds a handle to backend-specific memory.
Definition: IDeviceMemory.h:31
Base interface for all compute backend objects.
Definition: IDeviceObject.h:30
Definition: VulkanDeviceMemory.h:9
void Reset() override
Reset the object to uninitialized state.
Definition: VulkanDeviceMemory.cpp:80
void Unmap() override
Unmap the mapped memory.
Definition: VulkanDeviceMemory.cpp:49
bool IsCompatible(IDeviceObject *pObject, UInt64 sizeLimit) override
Check if the memory is compatible with an object.
Definition: VulkanDeviceMemory.cpp:69
ResultCode Map(UInt64 byteOffset, UInt64 byteSize, void **ppData) override
Map the device memory to access it from the host.
Definition: VulkanDeviceMemory.cpp:26
Device memory descriptor.
Definition: IDeviceMemory.h:12