From: Jason Ekstrand Date: Wed, 30 Oct 2019 19:37:45 +0000 (-0500) Subject: anv: Set the batch allocator for compute pipelines X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ef198c59a0cf003b4545e345d34b93d9e4c538b;p=mesa.git 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 --- diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index b2cf2a0ac47..27fe6d78912 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;