add VKMemoryAllocator

This commit is contained in:
2021-03-25 20:00:19 +08:00
parent 4af5735c25
commit e1aaaa0b31
12 changed files with 139 additions and 37 deletions

View File

@@ -0,0 +1,34 @@
#ifndef HGL_GRAPH_VULKAN_MEMORY_ALLOCATOR_INCLUDE
#define HGL_GRAPH_VULKAN_MEMORY_ALLOCATOR_INCLUDE
#include<hgl/graph/VK.h>
#include<hgl/type/MemoryAllocator.h>
VK_NAMESPACE_BEGIN
class VKMemoryAllocator:public AbstractMemoryAllocator
{
GPUDevice *device;
uint32_t buffer_usage_flag_bits;
GPUBuffer *gpu_buffer;
protected:
bool Alloc() override;
public:
const bool CanRealloc ()const override{return false;}
const uint32_t GetBufferUsageFlagBits ()const{return buffer_usage_flag_bits;}
public:
VKMemoryAllocator(GPUDevice *,const uint32_t);
~VKMemoryAllocator();
void Free() override {/* DON'T RUN ANY OPERATION.*/}
};//class VKMemoryAllocator:public AbstractMemoryAllocator
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_MEMORY_ALLOCATOR_INCLUDE