Add a check for instance buffer overflow

This commit is contained in:
Vincent Lejeune 2014-11-02 01:00:10 +01:00
parent 5557a0165a
commit 8588720f6b

View File

@ -121,6 +121,7 @@ FillInstances_impl(std::vector<std::pair<GLMesh *, scene::ISceneNode *> > Instan
auto &Tp = InstanceList[i];
scene::ISceneNode *node = Tp.second;
InstanceFiller<T>::add(mesh, node, InstanceBuffer[InstanceBufferOffset++]);
assert(InstanceBufferOffset * sizeof(T) < 10000 * sizeof(InstanceDataDualTex));
}
DrawElementsIndirectCommand &CurrentCommand = CommandBuffer[CommandBufferOffset++];