Blumenkrantz "Massively Improves" Mesa's glReadPixels Performance With 7 Lines Of Code

Written by Michael Larabel in Mesa on 21 June 2024 at 03:44 PM EDT. 172 Comments
MESA
Mike Blumenkrantz of Valve's open-source/Linux graphics driver team has submitted a merge request to "massively" improve the OpenGL glReadPixels performance within the common Mesa state tracker.

Due to performance issues with a Steam Direct3D Windows game that embeds a number of video files and Proton in turn relying on GStreamer to play the video files, Blumenkrantz was exploring the perf profile and the overhead of all the memory copies from the pixel back buffer texture upload to glReadPixels memory copy download path as part of the video transcode pipeline.

Blumenkrantz has made the glReadPixels operation much more efficient by using compute pixel buffer object (PBO) downloads. He is reporting upwards of 100% better performance for glReadPixels in a number of cases.
"this massively improves (>100%) ReadPixels perf in a number of cases"

Most impressive out of this massive performance improvement? It's just seven lines of new code via this merge request.

Nice optimization, Mike


More details over on Mike's blog. Assuming the merge request lands soon, it will be part of next quarter's Mesa 24.2 feature release.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week