avoid allocations in renderer (messes up AMD buggy OpenGL driver)

add missing file in cmake build system (BroadphaseCollision/b3GpuParallelLinearBvhBroadphase.cpp and BroadphaseCollision/b3GpuParallelLinearBvh.cpp)
This commit is contained in:
erwincoumans
2014-04-09 21:23:22 -07:00
parent 6311824bc1
commit 5dafea7c06
4 changed files with 17 additions and 4 deletions

View File

@@ -742,6 +742,12 @@ void GLInstancingRenderer::InitShaders()
glGenBuffers(1, &lineVertexBufferObject);
glGenBuffers(1, &lineIndexVbo);
int sz = 8*sizeof(float);
glBindVertexArray(lineVertexArrayObject);
glBindBuffer(GL_ARRAY_BUFFER, lineVertexBufferObject);
glBufferData(GL_ARRAY_BUFFER, sz, 0, GL_DYNAMIC_DRAW);
glBindVertexArray(0);
@@ -1456,8 +1462,12 @@ void GLInstancingRenderer::drawLine(const float from[4], const float to[4], cons
err = glGetError();
b3Assert(err==GL_NO_ERROR);
glBufferData(GL_ARRAY_BUFFER, sz, vertexPositions, GL_STATIC_DRAW);
{
glBufferSubData(GL_ARRAY_BUFFER, 0,sz, vertexPositions);
}
err = glGetError();
b3Assert(err==GL_NO_ERROR);