Shader Optimizations Greatly Speed-Up Wayland
Rob Clark, the Texas Instruments developer known for his work on the OMAP DRM driver, DMA-BUF, and hacking a Qualcomm open-source driver in his spare time, has been dabbling with Wayland. Rob's done some optimizations and simplifications to shaders used by Wayland's Weston reference compositor that greatly improve the performance.
With a patch posted under an "RFC" (Request For Comments) flag on the Wayland development list for Weston, he's optimized and simplified some shaders used by the Wayland compositor. When trying to run Wayland on a small SoC GPU like the TI OMAP4 PandaBoard at 1080p, Rob Clark can now obtain 60 FPS while pushing around windows. When pushing YUV buffers for hardware-accelerated decode of 1080p videos he gets 30 FPS. These numbers are compared to below 30 FPS and about 6 FPS, respectively, before writing these optimized shaders. This work should benefit all Weston users, but especially those on mobile/embedded hardware with less-powerful graphics processors.
Re-work how the shaders and emitted vertices work. Rather than always rendering clip-rect sized quads and doing transformation in tex coords (and requiring the corresponding clipping in frag shader), instead emit transformed vertices, clipped wrt. dirty region, and use simpler frag shaders. Also, split the rendering, so blended surfaces with an opaque region have the opaque region drawn with blend disabled. The result is considerably fewer pixels drawn with blend enabled, and much fewer cycles in the frag shader.Rob Clark will be speaking next week in San Diego, which will be covered on Phoronix.
Latest Articles & Reviews
Latest Linux News
Most Viewed News This Week