added VABView,preparing new VABViewStadnalone,VABViewVDM

This commit is contained in:
2024-05-14 00:32:49 +08:00
parent 4e6adcd765
commit 14fbbd6fa6
5 changed files with 148 additions and 1 deletions

View File

@@ -73,6 +73,8 @@ public:
using VABAccessMap=Map<AnsiString,VABAccess>;
class VABView;
class IndexBuffer;
struct IndexBufferAccess

View File

@@ -36,6 +36,21 @@ namespace hgl
};//class VertexAttribBuffer:public DeviceBuffer
using VAB=VertexAttribBuffer;
class VABView
{
public:
VABView()=default;
virtual ~VABView()=default;
virtual VAB *GetVAB()=0;
virtual VkDeviceSize GetStart()const=0;
virtual VkDeviceSize GetSize()const=0;
virtual void *Map()=0;
virtual void Unmap()=0;
};//class VABView
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE

View File

@@ -3,11 +3,45 @@
#include<hgl/graph/VK.h>
#include<hgl/graph/VKIndexBuffer.h>
#include<hgl/type/DataChain.h>
#include<hgl/type/Pair.h>
namespace hgl
{
namespace graph
{
class VertexDataManager;
struct IBAccessNode:public IBAccess
{
private:
VertexDataManager *vdm;
DataChain::UserNode *dc_node;
public:
friend class VertexDataManager;
~IBAccessNode();
};
struct VABAccessNode
{
private:
VertexDataManager *vdm;
DataChain::UserNode *dc_node;
const VIL *vil;
VABAccess **vab;
public:
friend class VertexDataManager;
~VABAccessNode();
};
class VertexDataManager
{
GPUDevice *device;
@@ -30,6 +64,14 @@ namespace hgl
DataChain vbo_data_chain; ///<数据链
DataChain ibo_data_chain; ///<数据链
protected:
friend struct IBAccessNode;
friend struct VABAccessNode;
bool ReleaseIB(DataChain::UserNode *);
bool ReleaseVAB(DataChain::UserNode *);
public:
VertexDataManager(GPUDevice *dev,const VIL *_vil);
@@ -49,6 +91,10 @@ namespace hgl
public:
bool Init(const VkDeviceSize vbo_size,const VkDeviceSize ibo_size,const IndexType index_type);
IBAccessNode *AcquireIB(const VkDeviceSize count);
VABAccessNode *AcquireVAB(const VkDeviceSize count);
};//class VertexDataManager
}//namespace graph
}//namespace hgl