[Glamor] [PATCH] Optimize gradient_fs_template shader

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 13 13:36:41 PDT 2013


On Thu, Jun 13, 2013 at 01:12:19PM -0700, Tom Stellard wrote:
> On Tue, Jun 11, 2013 at 08:30:45AM +0100, Chris Wilson wrote:
> > 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
> 
> Maybe I've overlooked something, but as far as I can tell
> neither the firefox-particles or the gradient-demo use the
> gradient_radial_fs_template shader, but instead use the
> gradient_fs_template, which looks very similar when compiled.

firefox-particles should be dominated by radial gradients, see
http://ie.microsoft.com/testdrive/Performance/ParticleAcceleration/
it is used for the background and to generate the shading on the spheres.
To make cairo-demos/gradient-demo use radial gradients pass --radial...
Oops, that seems to have been lost, so I'll redo that.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Glamor mailing list