Add proper support for IndexType and uint32 indices

This commit is contained in:
SirLynix
2022-04-04 09:02:00 +02:00
parent 66ff6cfa81
commit 9d526741b9
34 changed files with 188 additions and 57 deletions

View File

@@ -23,9 +23,27 @@ namespace Nz
return m_indexCount;
}
inline IndexType IndexBuffer::GetIndexType() const
{
return m_indexType;
}
inline UInt64 IndexBuffer::GetStride() const
{
return (m_largeIndices) ? sizeof(UInt32) : sizeof(UInt16);
switch (m_indexType)
{
case IndexType::U8:
return sizeof(UInt8);
case IndexType::U16:
return sizeof(UInt16);
case IndexType::U32:
return sizeof(UInt32);
}
NazaraError("invalid index size");
return 0;
}
inline UInt64 IndexBuffer::GetStartOffset() const
@@ -33,11 +51,6 @@ namespace Nz
return m_startOffset;
}
inline bool IndexBuffer::HasLargeIndices() const
{
return m_largeIndices;
}
inline bool IndexBuffer::IsValid() const
{
return m_buffer != nullptr;