From 9ef198c59a0cf003b4545e345d34b93d9e4c538b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 30 Oct 2019 14:37:45 -0500 Subject: [PATCH] anv: Set the batch allocator for compute pipelines Otherwise relocations just up and crash. Fixes: a3153162a9b "anv: Delay allocation of relocation lists" Reviewed-by: Lionel Landwerlin --- src/intel/vulkan/genX_pipeline.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index b2cf2a0..27fe6d7 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -2216,12 +2216,15 @@ compute_pipeline_create( pipeline->blend_state.map = NULL; - result = anv_reloc_list_init(&pipeline->batch_relocs, - pAllocator ? pAllocator : &device->alloc); + const VkAllocationCallbacks *alloc = + pAllocator ? pAllocator : &device->alloc; + + result = anv_reloc_list_init(&pipeline->batch_relocs, alloc); if (result != VK_SUCCESS) { vk_free2(&device->alloc, pAllocator, pipeline); return result; } + pipeline->batch.alloc = alloc; pipeline->batch.next = pipeline->batch.start = pipeline->batch_data; pipeline->batch.end = pipeline->batch.start + sizeof(pipeline->batch_data); pipeline->batch.relocs = &pipeline->batch_relocs; -- 2.7.4