recreate VertexAttribData and VertexAttribDataAccess
This commit is contained in:
@@ -24,14 +24,11 @@ namespace hgl
|
||||
|
||||
VkFormat vk_format; ///<在Vulkan中的数据类型
|
||||
|
||||
void *mem_end; ///<内存数据区访问结束地址
|
||||
|
||||
public:
|
||||
|
||||
VertexAttribData(uint32_t c,uint32_t dc,uint32_t cs,VkFormat fmt):count(c),dc_num(dc),comp_stride(cs),stride(dc*cs),total_bytes(dc*cs*c),vk_format(fmt)
|
||||
{
|
||||
mem_data = hgl_malloc(total_bytes); //在很多情况下,hgl_malloc分配的内存是对齐的,这样有效率上的提升
|
||||
mem_end = ((char *)mem_data) + total_bytes;
|
||||
}
|
||||
|
||||
virtual ~VertexAttribData()
|
||||
@@ -50,6 +47,14 @@ namespace hgl
|
||||
};//class VertexAttribData
|
||||
|
||||
using VAD=VertexAttribData;
|
||||
|
||||
/**
|
||||
* 根据格式要求,创建对应的顶点属性数据区(VAD)
|
||||
* @param base_type 基础格式,参见spirv_cross/spirv_common.hpp中的spirv_cross::SPIRType
|
||||
* @param vecsize vec数量
|
||||
* @param vertex_count 顶点数量
|
||||
*/
|
||||
VertexAttribData *CreateVertexAttribData(const uint32_t base_type,const uint32_t vecsize,const uint32_t vertex_count);
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
#endif//HGL_GRAPH_VERTEX_ATTRIB_DATA_INCLUDE
|
||||
|
Reference in New Issue
Block a user