Mesa (main): d3d12: Add a buffer busy callback to the bufmgr

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 8 21:13:47 UTC 2022


Module: Mesa
Branch: main
Commit: 96d68cb300d58a340fcfcf416fc7ba722ae7fb62
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=96d68cb300d58a340fcfcf416fc7ba722ae7fb62

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Feb  7 17:14:33 2022 -0800

d3d12: Add a buffer busy callback to the bufmgr

Not all cached buffers can be mapped, so using map with do-not-wait
is a terrible heuristic. Use an explicit buffer busy callback which
is always false, since buffers are only put into the cache once they're
free.

Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>

---

 src/gallium/drivers/d3d12/d3d12_bufmgr.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp b/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
index 07a0742e15e..91ec2c9eac9 100644
--- a/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
@@ -320,6 +320,13 @@ d3d12_bufmgr_destroy(struct pb_manager *_mgr)
    FREE(mgr);
 }
 
+static boolean
+d3d12_bufmgr_is_buffer_busy(struct pb_manager *_mgr, struct pb_buffer *_buf)
+{
+   /* We're only asked this on buffers that are known not busy */
+   return false;
+}
+
 struct pb_manager *
 d3d12_bufmgr_create(struct d3d12_screen *screen)
 {
@@ -332,6 +339,7 @@ d3d12_bufmgr_create(struct d3d12_screen *screen)
    mgr->base.destroy = d3d12_bufmgr_destroy;
    mgr->base.create_buffer = d3d12_bufmgr_create_buffer;
    mgr->base.flush = d3d12_bufmgr_flush;
+   mgr->base.is_buffer_busy = d3d12_bufmgr_is_buffer_busy;
 
    mgr->dev = screen->dev;
 



More information about the mesa-commit mailing list