radv: Use the meta fast clear destructor on construction failure.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 23 Dec 2017 11:37:13 +0000 (12:37 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 29 Dec 2017 11:21:35 +0000 (12:21 +0100)
Simplifies failure paths. The caller already calls
radv_device_finish_meta_fast_clear_flush_state on failure.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/amd/vulkan/radv_meta_fast_clear.c

index 44c2ff526173480155edad1ad1085cb40b4406b4..2603229a1f7f2543ca28bbe14494c7af726b1a2b 100644 (file)
@@ -248,7 +248,7 @@ create_pipeline(struct radv_device *device,
                                               &device->meta_state.alloc,
                                               &device->meta_state.fast_clear_flush.fmask_decompress_pipeline);
        if (result != VK_SUCCESS)
-               goto cleanup_cmask;
+               goto cleanup;
 
        result = radv_graphics_pipeline_create(device_h,
                                               radv_pipeline_cache_to_handle(&device->meta_state.cache),
@@ -294,13 +294,10 @@ create_pipeline(struct radv_device *device,
                                               &device->meta_state.alloc,
                                               &device->meta_state.fast_clear_flush.dcc_decompress_pipeline);
        if (result != VK_SUCCESS)
-               goto cleanup_fmask;
+               goto cleanup;
 
        goto cleanup;
-cleanup_fmask:
-       radv_DestroyPipeline(device_h, device->meta_state.fast_clear_flush.fmask_decompress_pipeline, &device->meta_state.alloc);
-cleanup_cmask:
-       radv_DestroyPipeline(device_h, device->meta_state.fast_clear_flush.cmask_eliminate_pipeline, &device->meta_state.alloc);
+
 cleanup:
        ralloc_free(fs_module.nir);
        return result;