openframeworks/openFrameworks — pull request #3283 by tgfrerer (2014-10-02 16:13:29+00:00)
Title: Feature gpu optimisations

This PR has a couple of GPU optimisations, based on things i learned during a recent large-scale project. They aim to optimise CPU and GPU workloads, and reduce driver overhead.

Optimisations affect both renderers.

I've tested this on OS X (10.10) and Windows 8. Also tested advanced OpenGL example to double-check viewports were set correctly. Profiling on windows 8 with Nvidia NSight shows the following:

## Before (without optimisations)
![before](https://cloud.githubusercontent.com/assets/423509/4493832/ce64f9ec-4a4c-11e4-8130-ce82c0fc9b3b.PNG)

## After (with optimisations)
![after](https://cloud.githubusercontent.com/assets/423509/4493838/da148e1a-4a4c-11e4-9051-dad5d0e23a71.PNG)

Notice that GPU workload stays the same (it's still the same amount of draw calls overall), while the time spent processing the work (i.e. driver overhead) is reduced by a factor of 5.6. A statistician more confident than me would call this a 500% speedup.

Individual commits go into more detail about the changes proposed.

Here's a one-file gist to my test case:
https://gist.github.com/tgfrerer/bce463cfa2213b7bf23f