From 71328b9be715a1b38f4f38e4edcd726d50ae5027 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 15 Nov 2020 16:57:11 +0000 Subject: [PATCH] vkd3d: Handle reserved resources in host barrier code Signed-off-by: Joshua Ashton --- libs/vkd3d/resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 1fb0aa07..42d6150a 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -626,6 +626,13 @@ static HRESULT d3d12_resource_create(struct d3d12_device *device, bool d3d12_heap_needs_host_barrier_for_write(struct d3d12_heap *heap) { + if (!heap) + { + /* This is a reserved resource and we have no guarantee + * it's not mapped to something with readback. */ + return true; + } + switch (heap->desc.Properties.Type) { case D3D12_HEAP_TYPE_DEFAULT: