From 6fc8b675766ed17a2785ff9799e2449bb375ca9a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 17 Feb 2021 16:24:56 +0100 Subject: [PATCH] vkd3d: Fix incorrect chunk assignment for chunk allocations. Our clear code assume that this is NULL for allocations owned by a chunk, so we should actually do it that way. Fixes some issues where we do not wait for clears to complete if a chunk gets destroyed. Signed-off-by: Philip Rebohle --- libs/vkd3d/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d/memory.c b/libs/vkd3d/memory.c index 72968995..1f0d0b8f 100644 --- a/libs/vkd3d/memory.c +++ b/libs/vkd3d/memory.c @@ -485,6 +485,7 @@ static HRESULT vkd3d_memory_chunk_allocate_range(struct vkd3d_memory_chunk *chun vkd3d_memory_allocation_slice(allocation, &chunk->allocation, align(pick_range->offset, memory_requirements->alignment), memory_requirements->size); + allocation->chunk = chunk; /* Remove allocated range from the free list */ l_length = allocation->offset - pick_range->offset; @@ -607,7 +608,6 @@ static HRESULT vkd3d_memory_chunk_create(struct d3d12_device *device, struct vkd return hr; } - object->allocation.chunk = object; vkd3d_memory_chunk_insert_range(object, 0, 0, object->allocation.resource.size); *chunk = object;