Merge pull request #19814 from PatriceJiang/fix_obb_collision_test

[lua-tests] extend buffer size of Draw3DNode
This commit is contained in:
minggo 2019-06-09 18:55:19 -07:00 committed by GitHub
commit 82e9024e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -205,6 +205,11 @@ void DrawNode3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
auto mvp = matrixP * transform;
_programState->setUniform(_locMVPMatrix, mvp.m, sizeof(mvp.m));
if (_customCommand.getVertexCapacity() < _buffer.size()) {
auto s = _buffer.size();
_customCommand.createVertexBuffer(sizeof(V3F_C4B), s + s/2, CustomCommand::BufferUsage::DYNAMIC);
}
if (_dirty && !_buffer.empty())
{
_customCommand.updateVertexBuffer(_buffer.data(), (unsigned int)(_buffer.size() * sizeof(_buffer[0])));