asahi: Prefer blit-based texture transfer
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 15 Dec 2022 20:47:41 +0000 (15:47 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sat, 4 Feb 2023 07:45:12 +0000 (07:45 +0000)
commit64ae63c41f0b0cf4307fb54cebaa51b42043b571
treebdd7613c1617ca608e37798ca148137b3040d39a
parent0a5c3764c7c976ede0849493742699ef76e9d40c
asahi: Prefer blit-based texture transfer

This speeds up glReadPixels. Instead of reading from the write-combined
framebuffer and converting colours on the CPU, this blits on the GPU to a
writeback staging resource with the colour conversion for free, and memcpies
from the writeback staging resource on the CPU.

In general, due to textures being write combined and tiled/compressed by default
by staging resources being linear writeback, blit-based texture transfer should
win out (you were going to blit anyway), particularly when format conversion is
involved

33% reduction in wall clock time for grim at 4K. No change in deqp-gles2
runtime.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
src/gallium/drivers/asahi/agx_pipe.c