Improve sorting of mesh instances for drawing.