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 <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2021-02-17 16:24:56 +01:00 committed by Hans-Kristian Arntzen
parent e12afd31d9
commit 6fc8b67576
1 changed files with 1 additions and 1 deletions

View File

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