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

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14294>
This commit is contained in:
Jesse Natalie
2021-12-21 18:22:50 -08:00
committed by Marge Bot
parent 0c5fde39e4
commit 5c69c44a99

View File

@@ -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);
}