updated VertexDataManager

This commit is contained in:
hyzboy 2024-04-01 23:32:18 +08:00
parent 1c03e838e5
commit 01bf8b3dd2
4 changed files with 13 additions and 15 deletions

2
CMCore

@ -1 +1 @@
Subproject commit cf13064ceada8814ced7aac89eaac3dd2d681d45
Subproject commit 71d198a3356cb8958003753339abf4eb8599d7c7

@ -1 +1 @@
Subproject commit d395ee152f64b1eb7d058c355767f25c44ed8dcb
Subproject commit 0f9713fb95f4bf1e23a46d3d256db2fb416dbdc3

View File

@ -11,6 +11,8 @@
#include<hgl/graph/mtl/Material3DCreateConfig.h>
#include<hgl/graph/mtl/BlinnPhong.h>
#include<hgl/color/Color.h>
#include<hgl/type/DataChain.h>
#include<hgl/type/MemoryBlock.h>
using namespace hgl;
using namespace hgl::graph;
@ -35,17 +37,6 @@ constexpr const COLOR AxisColor[4]=
class VertexDataManager
{
public:
struct DataOffset
{
VkDeviceSize vbo_start;
VkDeviceSize vbo_size;
VkDeviceSize ibo_start;
VkDeviceSize ibo_size;
};
protected:
uint vi_count; ///<顶点输入流数量
@ -60,14 +51,14 @@ protected:
protected:
//List<DataOffset> 我们可能需要一个数据块链表管理器,并且支持最小数据分块。以方便支持数据块回收。
DataChain data_chain; ///<数据链
public:
VertexDataManager(const VIL &_vil)
{
vi_count=_vil.GetCount();
vif_list=_vil.GetVIFList();
vif_list=_vil.GetVIFList(); //来自于Material不会被释放所以指针有效
vbo_max_size=0;
vbo_cur_size=0;
@ -77,6 +68,12 @@ public:
ibo=nullptr;
}
~VertexDataManager()
{
SAFE_CLEAR_OBJECT_ARRAY(vbo,vi_count);
SAFE_CLEAR(ibo);
}
const VkDeviceSize GetVBOMaxCount ()const{return vbo_max_size;} ///<取得顶点缓冲区分配的空间最大数量
const VkDeviceSize GetVBOCurCount ()const{return vbo_cur_size;} ///<取得顶点缓冲区当前数量

View File

@ -99,6 +99,7 @@ class VILConfig;
class VertexInput;
struct VertexInputFormat;
using VIF=VertexInputFormat;
class VertexInputLayout;
using VIL=VertexInputLayout;