[Mesa-dev] [PATCH 2/2] mesa: Speedup the xrgb -> argb special case in fast_read_rgba_pixels_memcpy

Marek Olšák maraeo at gmail.com
Mon Mar 11 18:23:46 PDT 2013

On Mon, Mar 11, 2013 at 6:49 PM, Ian Romanick <idr at freedesktop.org> wrote:
> Once upon a time Matt Turner was talking about using pixman to accelerate
> operations like this in Mesa.  It has a lot of highly optimized paths for
> just this sort of thing.  Since it's used by other projects, it gets a lot
> more testing, etc.  It may be worth looking at using that to solve this
> problem.

I think that using pixman or any other CPU-based solution is a waste
of time (for dedicated GPUs at least). The OpenGL packing and
unpacking can be implemented entirely on the GPU using streamout and
TBOs, and we generally only want memcpy on the CPU side. That would
also allow us to finally accelerate pixel buffer objects.

For now, the easiest and fastest solution is to do a blit, which
should cover swizzling and format conversions. We just need a lot of
texture formats or do swizzling in the fragment shader. The
destination of the blit can be a temporary texture allocated in GTT.
The author of the patch (at least I think it's him) has actually
started working on the blit-based solution for ReadPixels in st/mesa
and the time spent in ReadPixels went from 2300 ms to 9 ms (so he can
still use additional 7.6 ms for rendering and be at 60 fps).


More information about the mesa-dev mailing list