From d0d00b235cded9fc9d5e923a1fbaaafd2e250d8e Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 7 Apr 2021 21:17:24 +0800 Subject: [PATCH] add VKMemoryAllocator.h/.cpp in CMakeLists.txt --- CMCore | 2 +- inc/hgl/graph/VKArrayBuffer.h | 17 +++++++---------- src/SceneGraph/CMakeLists.txt | 2 ++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CMCore b/CMCore index 91d408d1..ec23a526 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit 91d408d10cb6f934522f6c544ae05694315b90fe +Subproject commit ec23a526afb1543236817a930c2f8a57b0b37570 diff --git a/inc/hgl/graph/VKArrayBuffer.h b/inc/hgl/graph/VKArrayBuffer.h index c92b9bf4..8d0cdca5 100644 --- a/inc/hgl/graph/VKArrayBuffer.h +++ b/inc/hgl/graph/VKArrayBuffer.h @@ -3,6 +3,7 @@ #include #include +#include namespace hgl { namespace graph @@ -11,24 +12,20 @@ namespace hgl * GPU数据阵列缓冲区
* 它用于储存多份相同格式的数据,常用于多物件渲染,instance等 */ - class GPUArrayBuffer + template class GPUArrayBuffer { protected: GPUDevice * device; - uint32_t item_size; ///<单个数据长度 - uint32_t alloc_count; ///<总计分配的数据个数 - uint32_t count; ///<实际使用的数据个数 - uint32_t total_bytes; ///<总字节数 - - GPUBuffer * buf_gpu; ///<实际数据GPU缓冲区 - uint8 * buf_cpu; - uint32_t * offset; ///<数据偏移地址 + Collection *coll; 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; diff --git a/src/SceneGraph/CMakeLists.txt b/src/SceneGraph/CMakeLists.txt index 9c341ec9..f4fb59a4 100644 --- a/src/SceneGraph/CMakeLists.txt +++ b/src/SceneGraph/CMakeLists.txt @@ -101,11 +101,13 @@ SET(VK_DEBUG_SOURCE ${SG_INCLUDE_PATH}/VKDebugOut.h Vulkan/VKDebugOut.cpp) SET(VK_MEMORY_SOURCE ${SG_INCLUDE_PATH}/VKMemory.h + ${SG_INCLUDE_PATH}/VKMemoryAllocator.h ${SG_INCLUDE_PATH}/VKBuffer.h ${SG_INCLUDE_PATH}/VKVertexAttribBuffer.h ${SG_INCLUDE_PATH}/VKIndexBuffer.h ${SG_INCLUDE_PATH}/VKArrayBuffer.h Vulkan/VKMemory.cpp + Vulkan/VKMemoryAllocator.cpp Vulkan/VKBuffer.cpp Vulkan/VKArrayBuffer.cpp)