moved CreateVertexAttribData(...) to PrimitiveCreater.cpp from VertexAttribData.cpp and then delete VertexAttribData.cpp

This commit is contained in:
hyzboy 2024-04-02 22:25:06 +08:00
parent d4c1dd312e
commit c1183d351d
4 changed files with 18 additions and 30 deletions

View File

@ -44,14 +44,6 @@ namespace hgl
};//class VertexAttribData
using VAD=VertexAttribData;
/**
* (VAD)
* @param vertex_count
* @param vif
*/
VAD *CreateVertexAttribData(const uint32_t vertex_count,const VertexInputFormat *vif);
//这个函数比较重要就不搞成CreateVAD的简写了
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_VERTEX_ATTRIB_DATA_INCLUDE

View File

@ -8,8 +8,7 @@ SET(SG_TEXTURE_SOURCE ${SG_INCLUDE_PATH}/TextureLoader.h
SOURCE_GROUP("Texture" FILES ${SG_TEXTURE_SOURCE})
SET(SG_VAD_SOURCE ${SG_INCLUDE_PATH}/VertexAttribData.h
${SG_INCLUDE_PATH}/VertexAttribDataAccess.h
VertexAttribData.cpp)
${SG_INCLUDE_PATH}/VertexAttribDataAccess.h)
SOURCE_GROUP("VertexAttribData" FILES ${SG_VAD_SOURCE})

View File

@ -1,10 +1,26 @@
#include<hgl/graph/PrimitiveCreater.h>
#include<hgl/graph/PrimitiveCreater.h>
#include<hgl/graph/VKShaderModule.h>
namespace hgl
{
namespace graph
{
/**
* (VAD)
* @param vertex_count
* @param vif
*/
VAD *CreateVertexAttribData(const uint32_t vertex_count,const VertexInputFormat *vif)
{
if(vertex_count<=0
||vif->vec_size<1||vif->vec_size>4
||vif->stride<1||vif->stride>8*4
||!CheckVulkanFormat(vif->format))
return(nullptr);
return(new VertexAttribData(vertex_count,vif->format,vif->stride*vertex_count));
}
PrimitiveCreater::PrimitiveCreater(RenderResource *sdb,const VIL *v)
{
db =sdb;

View File

@ -1,19 +0,0 @@
#include<hgl/graph/VertexAttribData.h>
#include<hgl/graph/VKVertexInputFormat.h>
namespace hgl
{
namespace graph
{
VAD *CreateVertexAttribData(const uint32_t vertex_count,const VertexInputFormat *vif)
{
if(vertex_count<=0
||vif->vec_size<1||vif->vec_size>4
||vif->stride<1||vif->stride>8*4
||!CheckVulkanFormat(vif->format))
return(nullptr);
return(new VertexAttribData(vertex_count,vif->format,vif->stride*vertex_count));
}
}//namespace graph
}//namespace hgl