diff --git a/inc/hgl/graph/PrimitiveCreater.h b/inc/hgl/graph/PrimitiveCreater.h index 9c598bed..31aefb74 100644 --- a/inc/hgl/graph/PrimitiveCreater.h +++ b/inc/hgl/graph/PrimitiveCreater.h @@ -38,7 +38,7 @@ namespace hgl protected: - PrimitiveVertexBuffer *CreatePVB(const AnsiString &,const void *data); ///<创建一个顶点属性数据区 + PrimitiveVertexBuffer *AcquirePVB(const AnsiString &,const void *data); ///<请求一个顶点属性数据区 void ClearAllData(); @@ -57,7 +57,7 @@ namespace hgl if(format!=T::GetVulkanFormat()) return(nullptr); - PrimitiveVertexBuffer *pvb=this->CreatePVB(name,nullptr); + PrimitiveVertexBuffer *pvb=this->AcquirePVB(name,nullptr); if(!pvb) return(nullptr); diff --git a/inc/hgl/graph/VertexAttribDataAccess.h b/inc/hgl/graph/VertexAttribDataAccess.h index 9b886107..b6eee615 100644 --- a/inc/hgl/graph/VertexAttribDataAccess.h +++ b/inc/hgl/graph/VertexAttribDataAccess.h @@ -38,7 +38,6 @@ namespace hgl access =nullptr; start_access=nullptr; - } virtual ~VertexAttribDataAccess()=default; diff --git a/src/SceneGraph/PrimitiveCreater.cpp b/src/SceneGraph/PrimitiveCreater.cpp index 99740b5f..5768c3c3 100644 --- a/src/SceneGraph/PrimitiveCreater.cpp +++ b/src/SceneGraph/PrimitiveCreater.cpp @@ -24,7 +24,7 @@ namespace hgl return(true); } - PrimitiveCreater::PrimitiveVertexBuffer *PrimitiveCreater::CreatePVB(const AnsiString &name,const void *data) + PrimitiveCreater::PrimitiveVertexBuffer *PrimitiveCreater::AcquirePVB(const AnsiString &name,const void *data) { if(!vil)return(nullptr); if(name.IsEmpty())return(nullptr); @@ -70,7 +70,7 @@ namespace hgl if(vif->stride*vertices_number!=bytes) return(false); - return CreatePVB(name,data); + return AcquirePVB(name,data); } void PrimitiveCreater::ClearAllData() @@ -107,6 +107,12 @@ namespace hgl Primitive *primitive=db->CreatePrimitive(prim_name,vertices_number); + if(ibo) + { + ibo->Unmap(); + primitive->Set(ibo); + } + const auto *sp=vbo_map.GetDataList(); for(uint i=0;iUnmap(); - primitive->Set(ibo); - } - db->Add(primitive); return primitive;