[very strong] deleted class VertexAttribData

This commit is contained in:
2024-04-02 22:51:14 +08:00
parent c1183d351d
commit 8c51d3a52b
7 changed files with 62 additions and 145 deletions

View File

@@ -4,6 +4,7 @@
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VertexAttribDataAccess.h>
#include<hgl/graph/VKShaderModule.h>
#include<hgl/graph/VKVertexAttribBuffer.h>
namespace hgl
{
namespace graph
@@ -16,16 +17,9 @@ namespace hgl
struct PrimitiveVertexBuffer
{
AnsiString name;
uint binding;
VAD * vad =nullptr;
VBO * vbo =nullptr;
public:
~PrimitiveVertexBuffer()
{
SAFE_CLEAR(vad);
}
int binding;
VBO * vbo;
void * map_data;
};//struct PrimitiveVertexBuffer
using PVBMap=ObjectMap<AnsiString,PrimitiveVertexBuffer>;
@@ -45,7 +39,9 @@ namespace hgl
protected:
VAD * CreateVAD(const AnsiString &name); ///<创建一个顶点属性缓冲
PrimitiveVertexBuffer *CreatePVB(const AnsiString &,const void *data); ///<创建一个顶点属性数据
void ClearAllData();
public:
@@ -62,12 +58,12 @@ namespace hgl
if(format!=T::GetVulkanFormat())
return(nullptr);
VAD *vad=this->CreateVAD(name);
PrimitiveVertexBuffer *pvb=this->CreatePVB(name,nullptr);
if(!vad)
if(!pvb)
return(nullptr);
T *access=T::Create(vad);
T *access=T::Create(vertices_number,pvb->map_data);
access->Begin();