merged GetUBO/GetUBODynamic and GetSSBO/GetSSBODynamic at MaterialDescriptorSets

This commit is contained in:
2021-09-22 18:08:46 +08:00
parent 3117b9673e
commit d3afabc170
6 changed files with 27 additions and 22 deletions

View File

@@ -35,11 +35,7 @@ namespace hgl
{
ubo_offset_alignment=device->GetUBOAlign();
uint32_t unit_size=sizeof(T);
const uint32_t align_size=ubo_offset_alignment-1;
unit_size=(unit_size+align_size)&(~align_size);
const uint32_t unit_size=hgl_align<uint32_t>(sizeof(T),ubo_offset_alignment);
vk_ma=new VKMemoryAllocator(device,buffer_usage_flags,unit_size); // construct function is going to set AllocUnitSize by minUniformOffsetAlignment
MemoryBlock *mb=new MemoryBlock(vk_ma);