[cairo] [PATCH] gl: Move glGetUniformLocation to shader compile time.

Chris Wilson chris at chris-wilson.co.uk
Fri Jun 28 03:59:44 PDT 2013

On Mon, Jun 24, 2013 at 11:28:47PM -0700, Eric Anholt wrote:
> The lookup of the string names has significant overhead, which is why GL
> gives you glGetUniformLocation so that you reference uniforms by
> constant integers in your high performance path.
> Reduces cairo-perf-trace runtime of firefox-planet-gnome by 1.06767% +/-
> 0.289265% (n=72) on my IVB macbook air.

Tested on a variety of machines, nouveau/nvidia, radeon/fglrx and intel.
Only on Haswell did I see a significant improvement - but out of
proportion with reduction in CPU overhead here, so likely a secondary

Patch looks ok, I was just quibbling over whether using an id enum and a
single location array would make the callers more readable.

Reviewed and pushed, thanks.

Chris Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list