mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
Added sanity check for transient buffers.
This commit is contained in:
parent
aa814e9994
commit
d8bd7419f9
1 changed files with 5 additions and 0 deletions
|
@ -919,6 +919,7 @@ namespace bgfx
|
||||||
bool checkAvailTransientIndexBuffer(uint16_t _num)
|
bool checkAvailTransientIndexBuffer(uint16_t _num)
|
||||||
{
|
{
|
||||||
BGFX_CHECK_MAIN_THREAD();
|
BGFX_CHECK_MAIN_THREAD();
|
||||||
|
BX_CHECK(0 < _num, "Requesting 0 indices.");
|
||||||
return s_ctx.m_submit->checkAvailTransientIndexBuffer(_num);
|
return s_ctx.m_submit->checkAvailTransientIndexBuffer(_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -926,12 +927,14 @@ namespace bgfx
|
||||||
{
|
{
|
||||||
BGFX_CHECK_MAIN_THREAD();
|
BGFX_CHECK_MAIN_THREAD();
|
||||||
BX_CHECK(NULL != _tib, "_tib can't be NULL");
|
BX_CHECK(NULL != _tib, "_tib can't be NULL");
|
||||||
|
BX_CHECK(0 < _num, "Requesting 0 indices.");
|
||||||
return s_ctx.allocTransientIndexBuffer(_tib, _num);
|
return s_ctx.allocTransientIndexBuffer(_tib, _num);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkAvailTransientVertexBuffer(uint16_t _num, const VertexDecl& _decl)
|
bool checkAvailTransientVertexBuffer(uint16_t _num, const VertexDecl& _decl)
|
||||||
{
|
{
|
||||||
BGFX_CHECK_MAIN_THREAD();
|
BGFX_CHECK_MAIN_THREAD();
|
||||||
|
BX_CHECK(0 < _num, "Requesting 0 vertices.");
|
||||||
return s_ctx.m_submit->checkAvailTransientVertexBuffer(_num, _decl.m_stride);
|
return s_ctx.m_submit->checkAvailTransientVertexBuffer(_num, _decl.m_stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -939,12 +942,14 @@ namespace bgfx
|
||||||
{
|
{
|
||||||
BGFX_CHECK_MAIN_THREAD();
|
BGFX_CHECK_MAIN_THREAD();
|
||||||
BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
|
BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
|
||||||
|
BX_CHECK(0 < _num, "Requesting 0 vertices.");
|
||||||
return s_ctx.allocTransientVertexBuffer(_tvb, _num, _decl);
|
return s_ctx.allocTransientVertexBuffer(_tvb, _num, _decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
const InstanceDataBuffer* allocInstanceDataBuffer(uint16_t _num, uint16_t _stride)
|
const InstanceDataBuffer* allocInstanceDataBuffer(uint16_t _num, uint16_t _stride)
|
||||||
{
|
{
|
||||||
BGFX_CHECK_MAIN_THREAD();
|
BGFX_CHECK_MAIN_THREAD();
|
||||||
|
BX_CHECK(0 < _num, "Requesting 0 instanced data vertices.");
|
||||||
return s_ctx.allocInstanceDataBuffer(_num, _stride);
|
return s_ctx.allocInstanceDataBuffer(_num, _stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue