added uint8 IndexType

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-05-11 21:07:26 +08:00
parent 7c4a27771f
commit 4ef1283fce
3 changed files with 6 additions and 4 deletions

View File

@ -136,10 +136,11 @@ inline const uint32_t GetMipLevel(const VkExtent3D &ext)
/** /**
* ,VkIndexType * ,VkIndexType
*/ */
enum IndexType enum IndexType:uint
{ {
U16=0, U16=0,
U32 U32,
U8=VK_INDEX_TYPE_UINT8_EXT,
}; };
/** /**

View File

@ -26,8 +26,8 @@ namespace hgl
~IndexBuffer()=default; ~IndexBuffer()=default;
const IndexType GetType ()const{return index_type;} const IndexType GetType ()const{return index_type;}
const uint32 GetCount()const{return count;} const uint32 GetCount()const{return count;}
};//class IndexBuffer:public DeviceBuffer };//class IndexBuffer:public DeviceBuffer
}//namespace graph }//namespace graph
}//namespace hgl }//namespace hgl

View File

@ -76,6 +76,7 @@ IndexBuffer *GPUDevice::CreateIBO(IndexType index_type,uint32_t count,const void
{ {
uint32_t stride; uint32_t stride;
if(index_type==IndexType::U8 )stride=1;else
if(index_type==IndexType::U16)stride=2;else if(index_type==IndexType::U16)stride=2;else
if(index_type==IndexType::U32)stride=4;else if(index_type==IndexType::U32)stride=4;else
return(nullptr); return(nullptr);