VulkanDevice增加IsSupport(IndexType)函数
This commit is contained in:
@@ -96,6 +96,7 @@ public: //Buffer相关
|
|||||||
VAB * CreateVAB (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive);
|
VAB * CreateVAB (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive);
|
||||||
VAB * CreateVAB (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVAB(format,count,nullptr,sm);}
|
VAB * CreateVAB (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVAB(format,count,nullptr,sm);}
|
||||||
|
|
||||||
|
const bool IsSupport (const IndexType &type)const; ///<检测是否支持某种索引类型
|
||||||
const IndexType ChooseIndexType (const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型
|
const IndexType ChooseIndexType (const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型
|
||||||
const bool CheckIndexType (const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适
|
const bool CheckIndexType (const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适
|
||||||
|
|
||||||
|
@@ -77,6 +77,14 @@ VAB *VulkanDevice::CreateVAB(VkFormat format,uint32_t count,const void *data,Sha
|
|||||||
return(new VertexAttribBuffer(attr->device,buf,format,stride,count));
|
return(new VertexAttribBuffer(attr->device,buf,format,stride,count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool VulkanDevice::IsSupport(const IndexType &type)const
|
||||||
|
{
|
||||||
|
if(type==IndexType::U16)return(true);
|
||||||
|
if(type==IndexType::U8 &&attr->uint8_index_type)return(true);
|
||||||
|
if(type==IndexType::U32&&attr->uint32_index_type)return(true);
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
|
||||||
const IndexType VulkanDevice::ChooseIndexType(const VkDeviceSize &vertex_count)const
|
const IndexType VulkanDevice::ChooseIndexType(const VkDeviceSize &vertex_count)const
|
||||||
{
|
{
|
||||||
if(vertex_count<=0)return(IndexType::ERR);
|
if(vertex_count<=0)return(IndexType::ERR);
|
||||||
|
Reference in New Issue
Block a user