On GitHub: https://github.com/wraitii/0ad/tree/instancing
This uses GL_ARB_draw_instanced to render some models using instancing instead of individual draw calls.
On my computer I get some good performance increase with stuff like grass or very similar trees.
I can only instance up to 32 stuff because I'm using a uniform and the required lower limit is 512 floats, aka 32 matrixes.
Ideally, we'd use uniform buffer objects or just buffer textures, but those have much lower support (according to https://feedback.wildfiregames.com/results/ )
This is not "configurable" and I also couldn't get the "pgl" stuff to work properly somehow.
It also breaks player color for instanced models because I was really lazy.
On a separate note I think we could somewhat improve our FPS regardless of instancing via not resetting uniforms/queries so often.