anv/pipeline: Don't free blend states that don't exist
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 14 Nov 2015 05:49:39 +0000 (21:49 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 14 Nov 2015 05:49:41 +0000 (21:49 -0800)
Compute pipelines don't need a blend state so we shouldn't be
unconditionally freeing it.

src/vulkan/anv_pipeline.c
src/vulkan/gen8_pipeline.c

index 124140fa22457f8ebec1c5345d6995c76a50984f..a9cf16f79c21856c1a517f985f8a7a9d731ac7fd 100644 (file)
@@ -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);
 }
 
index a51cf4924ae05b948a3b0ca0b17b7e8c7c047277..e98045248a4a5e1a0366d9aa055c026750885c16 100644 (file)
@@ -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);