[Glamor] [PATCH] Optimize gradient_fs_template shader

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 11 00:30:45 PDT 2013


On Mon, Jun 10, 2013 at 07:11:23PM -0700, Tom Stellard wrote:
> From: Tom Stellard <thomas.stellard at amd.com>
> 
> Replace:
> 
> while(t > 1.0)
>    t = t - 1.0;
> while(t < 0.0)
>    t = t + 1.0;
> 
> With:
> 
> t = fract(t);
> ---
> 
> This code is untested since I'm not usre which test suite to use
> for glamor.  Any suggestions?
> 
> This should improve the performance of any app that uses this shader via glamor.
> I think the cairo perf test firefox-canvas uses this, but the patch didn't
> improve perfomance.  I may try looking through the cairo micro benchmarks
> to see if I can find a more specific performance test.

firefox-particles and firefox-talos-svg are the heaviest users of radial
gradients. firefox-particles has the simpler geometry and drawing code,
so I would expect it to be the more sensitive test.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Glamor mailing list