Mesa (main): d3d12: Avoid a debug warning trying to unmap a not-mapped resource

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 28 00:22:18 UTC 2021


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Tue Dec 21 18:22:50 2021 -0800

d3d12: Avoid a debug warning trying to unmap a not-mapped resource

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

---

 src/gallium/drivers/d3d12/d3d12_bufmgr.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp b/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
index 2cf1702f679..82beb4c6897 100644
--- a/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_bufmgr.cpp
@@ -218,7 +218,8 @@ d3d12_buffer_destroy(void *winsys, struct pb_buffer *pbuf)
 {
    struct d3d12_buffer *buf = d3d12_buffer(pbuf);
 
-   d3d12_bo_unmap(buf->bo, &buf->range);
+   if (buf->map)
+      d3d12_bo_unmap(buf->bo, &buf->range);
    d3d12_bo_unreference(buf->bo);
    FREE(buf);
 }



More information about the mesa-commit mailing list