I have question about MESH_COMMAND Batching. The function
void Renderer::processRenderCommand(RenderCommand* command)
has the following code:
if (cmd->isSkipBatching() || _lastBatchedMeshCommand == nullptr || _lastBatchedMeshCommand->getMaterialID() != cmd->getMaterialID())
If you see to the
MeshCommand::genMaterialID(GLuint texID, void* glProgramState, GLuint vertexBuffer, GLuint indexBuffer, BlendFunc blend)
you will find that it use glProgramState pointer when hash is calculated.
But this pointer is different for each MESH. Thus butching does not work for mesh even it has the same material as previouse in the rendering cycle.
Could you please confirm that, or I miss something?