mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 13:03:05 +01:00
Fixed transient vertex buffer when vertex layout allocation fails.
This commit is contained in:
@@ -4236,7 +4236,14 @@ namespace bgfx
|
||||
BX_ASSERT(0 < _num, "Requesting 0 vertices.");
|
||||
BX_ASSERT(isValid(_layout), "Invalid VertexLayout.");
|
||||
|
||||
s_ctx->allocTransientVertexBuffer(_tvb, _num, _layout);
|
||||
VertexLayoutHandle layoutHandle;
|
||||
{
|
||||
BGFX_MUTEX_SCOPE(s_ctx->m_resourceApiLock);
|
||||
layoutHandle = s_ctx->findOrCreateVertexLayout(_layout, true);
|
||||
}
|
||||
BX_ASSERT(isValid(layoutHandle), "Failed to allocate vertex layout handle (BGFX_CONFIG_MAX_VERTEX_LAYOUTS, max: %d).", BGFX_CONFIG_MAX_VERTEX_LAYOUTS);
|
||||
|
||||
s_ctx->allocTransientVertexBuffer(_tvb, _num, layoutHandle, _layout.m_stride);
|
||||
|
||||
BX_ASSERT(_num == _tvb->size / _layout.m_stride
|
||||
, "Failed to allocate transient vertex buffer (requested %d, available %d). "
|
||||
|
||||
Reference in New Issue
Block a user