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

@@ -16,9 +16,9 @@ namespace Nz
{
public:
IndexBuffer() = default;
IndexBuffer(bool largeIndices, std::shared_ptr<Buffer> buffer);
IndexBuffer(bool largeIndices, std::shared_ptr<Buffer> buffer, UInt64 offset, UInt64 size);
IndexBuffer(bool largeIndices, UInt64 indexCount, BufferUsageFlags usage, const BufferFactory& bufferFactory, const void* initialData = nullptr);
IndexBuffer(IndexType indexType, std::shared_ptr<Buffer> buffer);
IndexBuffer(IndexType indexType, std::shared_ptr<Buffer> buffer, UInt64 offset, UInt64 size);
IndexBuffer(IndexType indexType, UInt64 indexCount, BufferUsageFlags usage, const BufferFactory& bufferFactory, const void* initialData = nullptr);
IndexBuffer(const IndexBuffer&) = default;
IndexBuffer(IndexBuffer&&) noexcept = default;
~IndexBuffer() = default;
@@ -31,11 +31,10 @@ namespace Nz
inline const std::shared_ptr<Buffer>& GetBuffer() const;
inline UInt64 GetEndOffset() const;
inline UInt64 GetIndexCount() const;
inline IndexType GetIndexType() const;
inline UInt64 GetStride() const;
inline UInt64 GetStartOffset() const;
inline bool HasLargeIndices() const;
inline bool IsValid() const;
inline void* Map(UInt64 startIndex, UInt64 length);
@@ -52,10 +51,10 @@ namespace Nz
private:
std::shared_ptr<Buffer> m_buffer;
IndexType m_indexType;
UInt32 m_indexCount;
UInt64 m_endOffset;
UInt64 m_startOffset;
bool m_largeIndices;
};
}