zink: avoid ballooning of copy box tracking
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 27 Feb 2023 23:57:04 +0000 (18:57 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 6 Mar 2023 03:47:06 +0000 (03:47 +0000)
commit0d8a54f9137ea639eb2118ec4a6d309529593e75
tree5246149542dd55608b2ad3eb0145fb32984854d5
parentd2de2bb9c5381dbee6a8942d523f3a08d4044cdd
zink: avoid ballooning of copy box tracking

* if the proposed box is smaller than an existing box then don't add it,
* if the proposed box is adjacent to an existing box, expand
* if the proposed box is larger than an existing box, replace

this reduces the chances of having a ton of copy boxes to iterate over

also add a perf warning in case a ton of copy boxes exist

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21665>
src/gallium/drivers/zink/zink_resource.c