Skip to content

virgl/gallium: robust readback on GLES

Erik Faye-Lund requested to merge kusma/mesa:virgl-readback-formats into master

When running VirGL on top of OpenGL ES, we can't read-back just any format, due to the limitations OpenGL ES impose on glReadPixels. This means we'll either have to add format conversion code to virglrenderer, or blit to a larger, readable format, and convert back afterwards.

Because maintaining a lot of pixel-format code in virgl-renderer only for a relatively rarely exercised code-path has a rather questionable cost-benefit trade-off, I opted with the second approach. Gallium already has pixel-format code that is almost good enough, and this series fixes it up to be good enough.

Disclaimer: the heuristics for what format to use is probably not the best, and might lead to fallbacks to overly wide formats too often. If someone feels they know better, any input here would be appreciated. But for now I'm also fine with waiting with optimizations like this until later.

Merge request reports