add VKMemoryAllocator.h/.cpp in CMakeLists.txt

This commit is contained in:
hyzboy 2021-04-07 21:17:24 +08:00
parent 8f1fc82697
commit d0d00b235c
3 changed files with 10 additions and 11 deletions

2
CMCore

@ -1 +1 @@
Subproject commit 91d408d10cb6f934522f6c544ae05694315b90fe Subproject commit ec23a526afb1543236817a930c2f8a57b0b37570

View File

@ -3,6 +3,7 @@
#include<hgl/graph/VKBuffer.h> #include<hgl/graph/VKBuffer.h>
#include<hgl/graph/VKDevice.h> #include<hgl/graph/VKDevice.h>
#include<hgl/type/Collection.h>
namespace hgl namespace hgl
{ {
namespace graph namespace graph
@ -11,24 +12,20 @@ namespace hgl
* GPU数据阵列缓冲区<br> * GPU数据阵列缓冲区<br>
* instance等 * instance等
*/ */
class GPUArrayBuffer template<typename T> class GPUArrayBuffer
{ {
protected: protected:
GPUDevice * device; GPUDevice * device;
uint32_t item_size; ///<单个数据长度 Collection<T> *coll;
uint32_t alloc_count; ///<总计分配的数据个数
uint32_t count; ///<实际使用的数据个数
uint32_t total_bytes; ///<总字节数
GPUBuffer * buf_gpu; ///<实际数据GPU缓冲区
uint8 * buf_cpu;
uint32_t * offset; ///<数据偏移地址
private: private:
GPUArrayBuffer(GPUDevice *,const uint32_t s=0,const uint32_t c=0); GPUArrayBuffer(GPUDevice *device,const uint32_t s,const uint32_t c)
{
}
friend class GPUDevice; friend class GPUDevice;

View File

@ -101,11 +101,13 @@ SET(VK_DEBUG_SOURCE ${SG_INCLUDE_PATH}/VKDebugOut.h
Vulkan/VKDebugOut.cpp) Vulkan/VKDebugOut.cpp)
SET(VK_MEMORY_SOURCE ${SG_INCLUDE_PATH}/VKMemory.h SET(VK_MEMORY_SOURCE ${SG_INCLUDE_PATH}/VKMemory.h
${SG_INCLUDE_PATH}/VKMemoryAllocator.h
${SG_INCLUDE_PATH}/VKBuffer.h ${SG_INCLUDE_PATH}/VKBuffer.h
${SG_INCLUDE_PATH}/VKVertexAttribBuffer.h ${SG_INCLUDE_PATH}/VKVertexAttribBuffer.h
${SG_INCLUDE_PATH}/VKIndexBuffer.h ${SG_INCLUDE_PATH}/VKIndexBuffer.h
${SG_INCLUDE_PATH}/VKArrayBuffer.h ${SG_INCLUDE_PATH}/VKArrayBuffer.h
Vulkan/VKMemory.cpp Vulkan/VKMemory.cpp
Vulkan/VKMemoryAllocator.cpp
Vulkan/VKBuffer.cpp Vulkan/VKBuffer.cpp
Vulkan/VKArrayBuffer.cpp) Vulkan/VKArrayBuffer.cpp)