preparing PrimitiveCreater to support multi primitive
This commit is contained in:
@@ -18,24 +18,26 @@ protected:
|
||||
|
||||
const VIL * vil;
|
||||
|
||||
AnsiString prim_name;
|
||||
PrimitiveData * prim_data;
|
||||
|
||||
protected:
|
||||
|
||||
VkDeviceSize vertices_number; ///<顶点数量
|
||||
|
||||
VkDeviceSize index_number; ///<索引数量
|
||||
IndexType index_type; ///<索引类型
|
||||
IBAccess * iba; ///<索引缓冲区
|
||||
AnsiString prim_name;
|
||||
PrimitiveData * prim_data;
|
||||
|
||||
VkDeviceSize vertices_number; ///<顶点数量
|
||||
|
||||
VkDeviceSize index_number; ///<索引数量
|
||||
IndexType index_type; ///<索引类型
|
||||
IBAccess * iba; ///<索引缓冲区
|
||||
|
||||
public:
|
||||
|
||||
PrimitiveCreater(GPUDevice *,const VIL *,const AnsiString &name);
|
||||
PrimitiveCreater(VertexDataManager *,const VIL *,const AnsiString &name);
|
||||
PrimitiveCreater(GPUDevice *,const VIL *);
|
||||
PrimitiveCreater(VertexDataManager *,const VIL *);
|
||||
virtual ~PrimitiveCreater();
|
||||
|
||||
virtual bool Init(const VkDeviceSize vertices_count,const VkDeviceSize index_count,IndexType it=IndexType::AUTO); ///<初始化,参数为顶点数量
|
||||
virtual bool Init(const AnsiString &name,const VkDeviceSize vertices_count,const VkDeviceSize index_count,IndexType it=IndexType::AUTO); ///<初始化,参数为顶点数量
|
||||
|
||||
void Clear(); ///<清除创建器数据
|
||||
|
||||
public: //顶点缓冲区
|
||||
|
||||
@@ -61,7 +63,7 @@ public: //索引缓冲区
|
||||
|
||||
public: //创建可渲染对象
|
||||
|
||||
virtual Primitive * Create(); ///<创建一个可渲染对象
|
||||
virtual Primitive * Create(); ///<创建一个可渲染对象,并清除创建器数据
|
||||
};//class PrimitiveCreater
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#ifndef HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|
||||
#ifndef HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|
||||
#define HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|
||||
|
||||
#include<hgl/graph/VKBuffer.h>
|
||||
@@ -9,9 +9,9 @@ namespace hgl
|
||||
{
|
||||
class VertexAttribBuffer:public DeviceBuffer
|
||||
{
|
||||
VkFormat format; ///<<EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD>ʽ
|
||||
uint32_t stride; ///<<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD>
|
||||
uint32_t count; ///<<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
VkFormat format; ///<数据格式
|
||||
uint32_t stride; ///<单个数据字节数
|
||||
uint32_t count; ///<数据数量
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -40,9 +40,9 @@ public:
|
||||
const VkDeviceSize GetVABMaxCount ()const{return vab_max_size;} ///<取得顶点属性缓冲区分配的空间最大数量
|
||||
const VkDeviceSize GetVABCurCount ()const{return vab_cur_size;} ///<取得顶点属性缓冲区当前数量
|
||||
|
||||
const IndexType GetIBOType ()const{return ibo?ibo->GetType():IndexType::ERR;} ///<取得索引缓冲区类型
|
||||
const VkDeviceSize GetIBOMaxCount ()const{return ibo?ibo->GetCount():-1;} ///<取得索引缓冲区分配的空间最大数量
|
||||
const VkDeviceSize GetIBOCurCount ()const{return ibo?ibo_cur_size:-1;} ///<取得索引缓冲区当前数量
|
||||
const IndexType GetIndexType ()const{return ibo?ibo->GetType():IndexType::ERR;} ///<取得索引缓冲区类型
|
||||
const VkDeviceSize GetIndexMaxCount ()const{return ibo?ibo->GetCount():-1;} ///<取得索引缓冲区分配的空间最大数量
|
||||
const VkDeviceSize GetIndexCurCount ()const{return ibo?ibo_cur_size:-1;} ///<取得索引缓冲区当前数量
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user