d3d12: Use buffer pipe usage to inform allocation
authorJesse Natalie <jenatali@microsoft.com>
Mon, 14 Dec 2020 19:53:13 +0000 (11:53 -0800)
committerJesse Natalie <jenatali@microsoft.com>
Tue, 5 Jan 2021 22:51:00 +0000 (14:51 -0800)
commitee1463db3c829a00040d4436befd6cd2f9ac4c01
treec5aee2941baf697c09987463e24fe63cbe76128e
parentbe19eb771acd77843bf463a12d37510ca0070ce3
d3d12: Use buffer pipe usage to inform allocation

For non-CPU-accessible pipe resource types (DEFAULT/IMMUTABLE),
allocate non-CPU-accessible buffers directly from the cache_bufmgr.
Update the d3d12_bo creation to handle nonmappable buffers.

For CPU-write-only (DYNAMIC/STREAM), use the upload slab_bufmgr.
Update this slab manager to use CPU_WRITE | GPU_READ PB usage.

For CPU-read-write (STAGING), use the readback_slab_bufmgr.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>
src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
src/gallium/drivers/d3d12/d3d12_context.cpp
src/gallium/drivers/d3d12/d3d12_resource.cpp
src/gallium/drivers/d3d12/d3d12_screen.cpp