From 91bc4e7cec4098000f3d9a265e7db7907a686e5a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 13 Nov 2015 21:49:39 -0800 Subject: [PATCH] anv/pipeline: Don't free blend states that don't exist Compute pipelines don't need a blend state so we shouldn't be unconditionally freeing it. --- src/vulkan/anv_pipeline.c | 3 ++- src/vulkan/gen8_pipeline.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 124140fa224..a9cf16f79c2 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -244,7 +244,8 @@ void anv_DestroyPipeline( anv_reloc_list_finish(&pipeline->batch_relocs, pipeline->device); anv_state_stream_finish(&pipeline->program_stream); - anv_state_pool_free(&device->dynamic_state_pool, pipeline->blend_state); + if (pipeline->blend_state.map) + anv_state_pool_free(&device->dynamic_state_pool, pipeline->blend_state); anv_device_free(pipeline->device, pipeline); } diff --git a/src/vulkan/gen8_pipeline.c b/src/vulkan/gen8_pipeline.c index a51cf4924ae..e98045248a4 100644 --- a/src/vulkan/gen8_pipeline.c +++ b/src/vulkan/gen8_pipeline.c @@ -598,6 +598,8 @@ VkResult gen8_compute_pipeline_create( pipeline->device = device; pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout); + pipeline->blend_state.map = NULL; + result = anv_reloc_list_init(&pipeline->batch_relocs, device); if (result != VK_SUCCESS) { anv_device_free(device, pipeline); -- 2.30.2