zink: implement sparse buffer creation/mapping
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 4 Apr 2021 17:25:51 +0000 (13:25 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 May 2021 02:46:06 +0000 (02:46 +0000)
commitc90246b682686597b09109858fb2c220dca1ad59
tree4dae4fb84ced8a668e5c61863006c6f1ce3fe8e5
parentdcbdb6820f08b885ff2bd5bd53f7d5cd3e8c3e20
zink: implement sparse buffer creation/mapping

sparse buffers are not cpu-readable, so any mapping requires that they
use a staging buffer, either the stream uploader for writes or a manual
copy for readback

future work here should attempt to resolve two perf issues:
* sparse allocations should be allocated dynamically using a suballocator
  or some other, more useful strategy
* readback shouldn't allocate a huge staging buffer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10509>
src/gallium/drivers/zink/zink_resource.c