浏览代码

Removed 16-bit API limit from vertex buffer.

Branimir Karadžić 11 年之前
父节点
当前提交
895f697f50
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      include/bgfx.h
  2. 2 2
      src/bgfx.cpp
  3. 1 1
      src/bgfx_p.h

+ 2 - 2
include/bgfx.h

@@ -687,7 +687,7 @@ namespace bgfx
 	///   When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated
 	///   When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated
 	///   from CPU.
 	///   from CPU.
 	///
 	///
-	DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE);
+	DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE);
 
 
 	/// Create dynamic vertex buffer and initialize it.
 	/// Create dynamic vertex buffer and initialize it.
 	///
 	///
@@ -766,7 +766,7 @@ namespace bgfx
 	/// @remarks
 	/// @remarks
 	///   Only 16-bit index buffer is supported.
 	///   Only 16-bit index buffer is supported.
 	///
 	///
-	bool allocTransientBuffers(TransientVertexBuffer* _tvb, const VertexDecl& _decl, uint16_t _numVertices, TransientIndexBuffer* _tib, uint16_t _numIndices);
+	bool allocTransientBuffers(TransientVertexBuffer* _tvb, const VertexDecl& _decl, uint32_t _numVertices, TransientIndexBuffer* _tib, uint32_t _numIndices);
 
 
 	/// Allocate instance data buffer.
 	/// Allocate instance data buffer.
 	///
 	///

+ 2 - 2
src/bgfx.cpp

@@ -2163,7 +2163,7 @@ again:
 		s_ctx->destroyDynamicIndexBuffer(_handle);
 		s_ctx->destroyDynamicIndexBuffer(_handle);
 	}
 	}
 
 
-	DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags)
+	DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags)
 	{
 	{
 		BGFX_CHECK_MAIN_THREAD();
 		BGFX_CHECK_MAIN_THREAD();
 		BX_CHECK(0 != _decl.m_stride, "Invalid VertexDecl.");
 		BX_CHECK(0 != _decl.m_stride, "Invalid VertexDecl.");
@@ -2239,7 +2239,7 @@ again:
 		return s_ctx->allocTransientVertexBuffer(_tvb, _num, _decl);
 		return s_ctx->allocTransientVertexBuffer(_tvb, _num, _decl);
 	}
 	}
 
 
-	bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexDecl& _decl, uint16_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint16_t _numIndices)
+	bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexDecl& _decl, uint32_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint32_t _numIndices)
 	{
 	{
 		if (checkAvailTransientBuffers(_numVertices, _decl, _numIndices) )
 		if (checkAvailTransientBuffers(_numVertices, _decl, _numIndices) )
 		{
 		{

+ 1 - 1
src/bgfx_p.h

@@ -2178,7 +2178,7 @@ namespace bgfx
 			return ptr;
 			return ptr;
 		}
 		}
 
 
-		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags) )
+		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags) )
 		{
 		{
 			DynamicVertexBufferHandle handle = BGFX_INVALID_HANDLE;
 			DynamicVertexBufferHandle handle = BGFX_INVALID_HANDLE;
 			uint32_t size = strideAlign16( (_num+1)*_decl.m_stride, _decl.m_stride);
 			uint32_t size = strideAlign16( (_num+1)*_decl.m_stride, _decl.m_stride);