OpenGL draw call batching
This code combines OpenGL draw calls with the same properties together, improving performance. On my high-end PC the improvement is around 20% in frame time.
This code is built on top of !985 (merged), so that should probably be merged first.