supported uint8_index_type
This commit is contained in:
@@ -138,8 +138,9 @@ inline const uint32_t GetMipLevel(const VkExtent3D &ext)
|
||||
/**
|
||||
* 索引类型,等同于VkIndexType
|
||||
*/
|
||||
enum IndexType:uint
|
||||
enum IndexType:int
|
||||
{
|
||||
AUTO=-1,
|
||||
U16=0,
|
||||
U32,
|
||||
U8=VK_INDEX_TYPE_UINT8_EXT,
|
||||
@@ -147,6 +148,11 @@ enum IndexType:uint
|
||||
ERR=VK_INDEX_TYPE_MAX_ENUM
|
||||
};
|
||||
|
||||
inline const bool IsIndexType(const IndexType it)
|
||||
{
|
||||
return it>=U16&&it<=U8;
|
||||
}
|
||||
|
||||
//Push Constant max-lengths:
|
||||
//
|
||||
// 256 bytes: nvidia,arm
|
||||
|
@@ -117,6 +117,9 @@ public: //Buffer相关
|
||||
VBO * CreateVBO (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive);
|
||||
VBO * CreateVBO (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVBO(format,count,nullptr,sm);}
|
||||
|
||||
const IndexType GetIndexType(const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型
|
||||
const bool CheckIndexType(const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适
|
||||
|
||||
IndexBuffer * CreateIBO (IndexType type, uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive);
|
||||
IndexBuffer * CreateIBO8 ( uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive){return CreateIBO(IndexType::U8, count,(void *)data,sm);}
|
||||
IndexBuffer * CreateIBO16 ( uint32_t count,const uint16 *data, SharingMode sm=SharingMode::Exclusive){return CreateIBO(IndexType::U16, count,(void *)data,sm);}
|
||||
|
@@ -39,6 +39,8 @@ struct GPUDeviceAttribute
|
||||
VkSurfaceTransformFlagBitsKHR preTransform;
|
||||
VkCompositeAlphaFlagBitsKHR compositeAlpha =VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||
|
||||
bool uint8_index_type=false;
|
||||
|
||||
VkDevice device =VK_NULL_HANDLE;
|
||||
VkCommandPool cmd_pool =VK_NULL_HANDLE;
|
||||
|
||||
|
Reference in New Issue
Block a user