mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
big refactoring ! ci skip
This commit is contained in:
36
runtime/Includes/Renderer/Memory.h
git.filemode.normal_file
36
runtime/Includes/Renderer/Memory.h
git.filemode.normal_file
@@ -0,0 +1,36 @@
|
||||
#ifndef __MLX_VK_MEMORY__
|
||||
#define __MLX_VK_MEMORY__
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
class GPUAllocator
|
||||
{
|
||||
public:
|
||||
GPUAllocator() = default;
|
||||
|
||||
void Init() noexcept;
|
||||
void Destroy() noexcept;
|
||||
|
||||
VmaAllocation CreateBuffer(const VkBufferCreateInfo* binfo, const VmaAllocationCreateInfo* vinfo, VkBuffer& buffer, const char* name = nullptr) noexcept;
|
||||
void DestroyBuffer(VmaAllocation allocation, VkBuffer buffer) noexcept;
|
||||
|
||||
VmaAllocation CreateImage(const VkImageCreateInfo* iminfo, const VmaAllocationCreateInfo* vinfo, VkImage& image, const char* name = nullptr) noexcept;
|
||||
void DestroyImage(VmaAllocation allocation, VkImage image) noexcept;
|
||||
|
||||
void MapMemory(VmaAllocation allocation, void** data) noexcept;
|
||||
void UnmapMemory(VmaAllocation allocation) noexcept;
|
||||
|
||||
void DumpMemoryToJson();
|
||||
|
||||
void Flush(VmaAllocation allocation, VkDeviceSize size, VkDeviceSize offset) noexcept;
|
||||
|
||||
~GPUAllocator() = default;
|
||||
|
||||
private:
|
||||
VmaAllocator m_allocator;
|
||||
std::int32_t m_active_buffers_allocations = 0;
|
||||
std::int32_t m_active_images_allocations = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user