Skip to content

Commit

Permalink
[VertexBuffer] Ensure it's valid after creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent 60c0fa5 commit 699d3bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/client/graphics/VertexBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ void VertexBuffer::init(const void *data, u32 size, bool isDynamic) {
if (m_isDynamic) {
auto *mem = (data ? bgfx::copy(data, size) : bgfx::alloc(size));
m_dynamicHandle = bgfx::createDynamicVertexBuffer(mem, m_layout);
assert(bgfx::isValid(m_dynamicHandle));
}
else {
auto *mem = bgfx::copy(data, size);
m_staticHandle = bgfx::createVertexBuffer(mem, m_layout);
assert(bgfx::isValid(m_staticHandle));
}
};

Expand Down

0 comments on commit 699d3bf

Please sign in to comment.