finished dynamic UBO for RenderList,,,but rendering breakout error.
This commit is contained in:
@@ -33,16 +33,17 @@ namespace hgl
|
||||
buffer_usage_flags=flags;
|
||||
|
||||
{
|
||||
uint32_t unit_size=sizeof(T);
|
||||
vk_ma=new VKMemoryAllocator(device,buffer_usage_flags); // construct function is going to set AllocUnitSize by minUniformOffsetAlignment
|
||||
MemoryBlock *mb=new MemoryBlock(vk_ma);
|
||||
ubo_offset_alignment=device->GetUBOAlign();
|
||||
|
||||
ubo_offset_alignment=vk_ma->GetAllocUnitSize();
|
||||
uint32_t unit_size=sizeof(T);
|
||||
|
||||
const uint32_t align_size=ubo_offset_alignment-1;
|
||||
|
||||
unit_size=(unit_size+align_size)&(~align_size);
|
||||
|
||||
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);
|
||||
|
||||
coll=new Collection(unit_size,mb);
|
||||
}
|
||||
}
|
||||
@@ -84,6 +85,11 @@ namespace hgl
|
||||
{
|
||||
return (T *)(coll->Map(start,count));
|
||||
}
|
||||
|
||||
void Flush(const uint32 count)
|
||||
{
|
||||
vk_ma->Flush(count*GetUnitSize());
|
||||
}
|
||||
};//class GPUArrayBuffer
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
|
Reference in New Issue
Block a user