mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Added check available memory for instance buffer.
This commit is contained in:
parent
52511156ac
commit
e79102bf0e
2 changed files with 14 additions and 0 deletions
|
@ -606,6 +606,13 @@ namespace bgfx
|
|||
///
|
||||
bool checkAvailTransientVertexBuffer(uint32_t _num, const VertexDecl& _decl);
|
||||
|
||||
/// Returns true if internal instance data buffer has enough space.
|
||||
///
|
||||
/// @param _num Number of instances.
|
||||
/// @param _stride Stride per instance.
|
||||
///
|
||||
bool checkAvailInstanceDataBuffer(uint32_t _num, uint16_t _stride);
|
||||
|
||||
/// Returns true if both internal transient index and vertex buffer have
|
||||
/// enough space.
|
||||
///
|
||||
|
|
|
@ -938,6 +938,13 @@ namespace bgfx
|
|||
return s_ctx.m_submit->checkAvailTransientVertexBuffer(_num, _decl.m_stride);
|
||||
}
|
||||
|
||||
bool checkAvailInstanceDataBuffer(uint32_t _num, uint16_t _stride)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
BX_CHECK(0 < _num, "Requesting 0 instances.");
|
||||
return s_ctx.m_submit->checkAvailTransientVertexBuffer(_num, _stride);
|
||||
}
|
||||
|
||||
bool checkAvailTransientBuffers(uint32_t _numVertices, const VertexDecl& _decl, uint32_t _numIndices)
|
||||
{
|
||||
return checkAvailTransientVertexBuffer(_numVertices, _decl)
|
||||
|
|
Loading…
Reference in a new issue