updated VKArrayBuffer.h

This commit is contained in:
hyzboy 2021-05-08 19:02:08 +08:00
parent 1696c27cbb
commit 7f0a786122
2 changed files with 6 additions and 3 deletions

View File

@ -30,10 +30,14 @@ namespace hgl
buffer_usage_flags=flags;
{
const size_t unit_size=sizeof(T);
uint32_t unit_size=sizeof(T);
VKMemoryAllocator *ma=new VKMemoryAllocator(device,buffer_usage_flags);
MemoryBlock *mb=new MemoryBlock(ma);
uint32_t align_size=ma->GetAllocUnitSize()-1; ///< this value is "min UBO Offset alignment"
unit_size=(unit_size+align_size)&(~align_size);
coll=new Collection(unit_size,mb);
}
}

View File

@ -107,11 +107,10 @@ SET(VK_MEMORY_SOURCE ${SG_INCLUDE_PATH}/VKMemory.h
${SG_INCLUDE_PATH}/VKBuffer.h
${SG_INCLUDE_PATH}/VKVertexAttribBuffer.h
${SG_INCLUDE_PATH}/VKIndexBuffer.h
# ${SG_INCLUDE_PATH}/VKArrayBuffer.h
${SG_INCLUDE_PATH}/VKArrayBuffer.h
Vulkan/VKMemory.cpp
Vulkan/VKMemoryAllocator.cpp
Vulkan/VKBuffer.cpp
# Vulkan/VKArrayBuffer.cpp
)
SET(VK_DEVICE_SOURCE ${SG_INCLUDE_PATH}/VKDevice.h