Code review comment for lp:~mc-return/compiz/compiz.merge-cube-speed-improvements

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

>
> > The other changes are mostly fine for now.
> >
> +1. Thanks for your review.
>
> > Something to keep in mind: The linked bug report about the redundant state
> > changes goes more towards the fundamental architecture of compiz rather than
> > something that can be fixed on a case by case basis. Currently the only
> > mechanism that we have in order to avoid such calls into OpenGL is
> effectively
> > more calls into OpenGL by querying the state, which in some cases can
> actually
> > be worse than the state change because it requires looking up the current
> > state of the pipeline as it might have been modified internally.
> >
> Well, I have not found a better way to do that faster...
>
> > In this case, it doesn't really matter too much - we check to see if a
> > particular state was enabled or disabled before doing both (eg, if enabled,
> > leave it enabled and don't disable it later, if not enabled, disable it
> > later).
>
> This should be the fastest and our only way to do it correctly...
> The plan of course is to do that for all global OpenGL state changes, not only
> for GL_BLEND...
> But GL_BLEND is a state that is often used by multiple plugins at the same
> time,
> especially when activating the cube, so instead of enabling/disabling blending
> redundantly in each plugin (for example: cube+cubeaddon+gears+rotate) we just
> do
> it once and skip the other state changes...
> I think this should be much more efficient, but if you have other ideas I
> would
> be happy to hear those...

I was thinking of something like this:

http://code.google.com/p/gamekit/source/browse/trunk/Ogre-1.9a/RenderSystems/GLES2/src/StateCacheManager/OgreGLES2StateCacheManagerImp.cpp?r=1213

« Back to merge proposal