Removed 64K/indices dynamic index buffer limit.

This commit is contained in:
bkaradzic 2013-10-21 22:04:41 -07:00
parent 9646ecfc9c
commit cbac476ee1
3 changed files with 33 additions and 4 deletions

View File

@ -654,27 +654,56 @@ namespace bgfx
void destroyIndexBuffer(IndexBufferHandle _handle);
/// Create static vertex buffer.
///
/// @param _mem Vertex buffer data.
/// @param _decl Vertex declaration.
/// @returns Static vertex buffer handle.
///
VertexBufferHandle createVertexBuffer(const Memory* _mem, const VertexDecl& _decl);
/// Destroy static vertex buffer.
///
/// @param _handle Static vertex buffer handle.
///
void destroyVertexBuffer(VertexBufferHandle _handle);
/// Create empty dynamic index buffer.
DynamicIndexBufferHandle createDynamicIndexBuffer(uint16_t _num);
///
/// @param _num Number of indices.
///
DynamicIndexBufferHandle createDynamicIndexBuffer(uint32_t _num);
/// Create dynamic index buffer and initialized it.
///
/// @param _mem Index buffer data.
///
DynamicIndexBufferHandle createDynamicIndexBuffer(const Memory* _mem);
/// Update dynamic index buffer.
///
/// @param _handle Dynamic index buffer handle.
/// @param _mem Index buffer data.
///
void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem);
/// Destroy dynamic index buffer.
///
/// @param _handle Dynamic index buffer handle.
///
void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle);
/// Create empty dynamic vertex buffer.
///
/// @param _num Number of vertices.
/// @param _decl Vertex declaration.
///
DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl);
/// Create dynamic vertex buffer and initialize it.
///
/// @param _mem Vertex buffer data.
/// @param _decl Vertex declaration.
///
DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexDecl& _decl);
/// Update dynamic vertex buffer.

View File

@ -1637,7 +1637,7 @@ namespace bgfx
s_ctx->destroyVertexBuffer(_handle);
}
DynamicIndexBufferHandle createDynamicIndexBuffer(uint16_t _num)
DynamicIndexBufferHandle createDynamicIndexBuffer(uint32_t _num)
{
BGFX_CHECK_MAIN_THREAD();
return s_ctx->createDynamicIndexBuffer(_num);

View File

@ -1689,10 +1689,10 @@ namespace bgfx
m_vertexBufferHandle.free(_handle.idx);
}
BGFX_API_FUNC(DynamicIndexBufferHandle createDynamicIndexBuffer(uint16_t _num) )
BGFX_API_FUNC(DynamicIndexBufferHandle createDynamicIndexBuffer(uint32_t _num) )
{
DynamicIndexBufferHandle handle = BGFX_INVALID_HANDLE;
uint32_t size = BX_ALIGN_16(uint32_t(_num*2) );
uint32_t size = BX_ALIGN_16(_num*2);
uint64_t ptr = m_dynamicIndexBufferAllocator.alloc(size);
if (ptr == NonLocalAllocator::invalidBlock)
{