updated VertexDataManager
This commit is contained in:
parent
1c03e838e5
commit
01bf8b3dd2
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit cf13064ceada8814ced7aac89eaac3dd2d681d45
|
Subproject commit 71d198a3356cb8958003753339abf4eb8599d7c7
|
@ -1 +1 @@
|
|||||||
Subproject commit d395ee152f64b1eb7d058c355767f25c44ed8dcb
|
Subproject commit 0f9713fb95f4bf1e23a46d3d256db2fb416dbdc3
|
@ -11,6 +11,8 @@
|
|||||||
#include<hgl/graph/mtl/Material3DCreateConfig.h>
|
#include<hgl/graph/mtl/Material3DCreateConfig.h>
|
||||||
#include<hgl/graph/mtl/BlinnPhong.h>
|
#include<hgl/graph/mtl/BlinnPhong.h>
|
||||||
#include<hgl/color/Color.h>
|
#include<hgl/color/Color.h>
|
||||||
|
#include<hgl/type/DataChain.h>
|
||||||
|
#include<hgl/type/MemoryBlock.h>
|
||||||
|
|
||||||
using namespace hgl;
|
using namespace hgl;
|
||||||
using namespace hgl::graph;
|
using namespace hgl::graph;
|
||||||
@ -35,17 +37,6 @@ constexpr const COLOR AxisColor[4]=
|
|||||||
|
|
||||||
class VertexDataManager
|
class VertexDataManager
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
struct DataOffset
|
|
||||||
{
|
|
||||||
VkDeviceSize vbo_start;
|
|
||||||
VkDeviceSize vbo_size;
|
|
||||||
|
|
||||||
VkDeviceSize ibo_start;
|
|
||||||
VkDeviceSize ibo_size;
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
uint vi_count; ///<顶点输入流数量
|
uint vi_count; ///<顶点输入流数量
|
||||||
@ -60,14 +51,14 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//List<DataOffset> 我们可能需要一个数据块链表管理器,并且支持最小数据分块。以方便支持数据块回收。
|
DataChain data_chain; ///<数据链
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VertexDataManager(const VIL &_vil)
|
VertexDataManager(const VIL &_vil)
|
||||||
{
|
{
|
||||||
vi_count=_vil.GetCount();
|
vi_count=_vil.GetCount();
|
||||||
vif_list=_vil.GetVIFList();
|
vif_list=_vil.GetVIFList(); //来自于Material,不会被释放,所以指针有效
|
||||||
|
|
||||||
vbo_max_size=0;
|
vbo_max_size=0;
|
||||||
vbo_cur_size=0;
|
vbo_cur_size=0;
|
||||||
@ -77,6 +68,12 @@ public:
|
|||||||
ibo=nullptr;
|
ibo=nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~VertexDataManager()
|
||||||
|
{
|
||||||
|
SAFE_CLEAR_OBJECT_ARRAY(vbo,vi_count);
|
||||||
|
SAFE_CLEAR(ibo);
|
||||||
|
}
|
||||||
|
|
||||||
const VkDeviceSize GetVBOMaxCount ()const{return vbo_max_size;} ///<取得顶点缓冲区分配的空间最大数量
|
const VkDeviceSize GetVBOMaxCount ()const{return vbo_max_size;} ///<取得顶点缓冲区分配的空间最大数量
|
||||||
const VkDeviceSize GetVBOCurCount ()const{return vbo_cur_size;} ///<取得顶点缓冲区当前数量
|
const VkDeviceSize GetVBOCurCount ()const{return vbo_cur_size;} ///<取得顶点缓冲区当前数量
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ class VILConfig;
|
|||||||
class VertexInput;
|
class VertexInput;
|
||||||
|
|
||||||
struct VertexInputFormat;
|
struct VertexInputFormat;
|
||||||
|
using VIF=VertexInputFormat;
|
||||||
|
|
||||||
class VertexInputLayout;
|
class VertexInputLayout;
|
||||||
using VIL=VertexInputLayout;
|
using VIL=VertexInputLayout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user