gallium: Allow copy_region blits with matching formats.
authorEmma Anholt <emma@anholt.net>
Mon, 9 Jan 2023 18:29:28 +0000 (10:29 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 12 Jan 2023 01:04:45 +0000 (01:04 +0000)
commit0accbe03e83b5b6400d4fa1180f2c5d9bb7a3657
tree88ca470f324c223441b1c2bc36688acb1a531730
parent673837bb8b4c41b002961d73388e96bd7f2426a7
gallium: Allow copy_region blits with matching formats.

If the blit formats match and the resource formats match, then that's a
memcpy whether or not the blit's view of the resource matches the
resource's format.

Improves perf of portal-2-v2's last frame on zink+anv by 1.33212% +/-
0.302829% (n=5), where there's a blit that is viewing the RGBA8_UNORM
src/dst resources as RGBA8_SRGB.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20594>
src/gallium/auxiliary/util/u_surface.c
src/gallium/auxiliary/util/u_surface_test.cpp