Shader optimizations. Patch provided by Robin Burchell.
svn path=/trunk/KDE/kdebase/workspace/; revision=1007918