From 06dbe0722f8109d8cc7b1c7edf0dc3d4ce6f0d08 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 28 Sep 2017 13:50:56 +0200 Subject: radv: cleanup radv_device_finish_meta_XXX() helpers Unnecessary to double check that handles are not NULL. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_meta_buffer.c | 45 ++++++++++++++------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'src/amd/vulkan/radv_meta_buffer.c') diff --git a/src/amd/vulkan/radv_meta_buffer.c b/src/amd/vulkan/radv_meta_buffer.c index f95d8823fcc..ea11ed18c4f 100644 --- a/src/amd/vulkan/radv_meta_buffer.c +++ b/src/amd/vulkan/radv_meta_buffer.c @@ -261,35 +261,22 @@ fail: void radv_device_finish_meta_buffer_state(struct radv_device *device) { - if (device->meta_state.buffer.copy_pipeline) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.buffer.copy_pipeline, - &device->meta_state.alloc); - - if (device->meta_state.buffer.fill_pipeline) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.buffer.fill_pipeline, - &device->meta_state.alloc); - - if (device->meta_state.buffer.copy_p_layout) - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.buffer.copy_p_layout, - &device->meta_state.alloc); - - if (device->meta_state.buffer.fill_p_layout) - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.buffer.fill_p_layout, - &device->meta_state.alloc); - - if (device->meta_state.buffer.copy_ds_layout) - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.buffer.copy_ds_layout, - &device->meta_state.alloc); - - if (device->meta_state.buffer.fill_ds_layout) - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.buffer.fill_ds_layout, - &device->meta_state.alloc); + struct radv_meta_state *state = &device->meta_state; + + radv_DestroyPipeline(radv_device_to_handle(device), + state->buffer.copy_pipeline, &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->buffer.fill_pipeline, &state->alloc); + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->buffer.copy_p_layout, &state->alloc); + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->buffer.fill_p_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->buffer.copy_ds_layout, + &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->buffer.fill_ds_layout, + &state->alloc); } static void fill_buffer_shader(struct radv_cmd_buffer *cmd_buffer, -- cgit v1.2.3