diff options
Diffstat (limited to 'src/amd/vulkan/radv_meta_bufimage.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_bufimage.c | 96 |
1 files changed, 36 insertions, 60 deletions
diff --git a/src/amd/vulkan/radv_meta_bufimage.c b/src/amd/vulkan/radv_meta_bufimage.c index d73420aef9c..cb028dccdcc 100644 --- a/src/amd/vulkan/radv_meta_bufimage.c +++ b/src/amd/vulkan/radv_meta_bufimage.c @@ -212,21 +212,15 @@ fail: static void radv_device_finish_meta_itob_state(struct radv_device *device) { - if (device->meta_state.itob.img_p_layout) { - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.itob.img_p_layout, - &device->meta_state.alloc); - } - if (device->meta_state.itob.img_ds_layout) { - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.itob.img_ds_layout, - &device->meta_state.alloc); - } - if (device->meta_state.itob.pipeline) { - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.itob.pipeline, - &device->meta_state.alloc); - } + struct radv_meta_state *state = &device->meta_state; + + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->itob.img_p_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->itob.img_ds_layout, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->itob.pipeline, &state->alloc); } static nir_shader * @@ -410,21 +404,15 @@ fail: static void radv_device_finish_meta_btoi_state(struct radv_device *device) { - if (device->meta_state.btoi.img_p_layout) { - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.btoi.img_p_layout, - &device->meta_state.alloc); - } - if (device->meta_state.btoi.img_ds_layout) { - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.btoi.img_ds_layout, - &device->meta_state.alloc); - } - if (device->meta_state.btoi.pipeline) { - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.btoi.pipeline, - &device->meta_state.alloc); - } + struct radv_meta_state *state = &device->meta_state; + + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->btoi.img_p_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->btoi.img_ds_layout, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->btoi.pipeline, &state->alloc); } static nir_shader * @@ -602,21 +590,15 @@ fail: static void radv_device_finish_meta_itoi_state(struct radv_device *device) { - if (device->meta_state.itoi.img_p_layout) { - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.itoi.img_p_layout, - &device->meta_state.alloc); - } - if (device->meta_state.itoi.img_ds_layout) { - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.itoi.img_ds_layout, - &device->meta_state.alloc); - } - if (device->meta_state.itoi.pipeline) { - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.itoi.pipeline, - &device->meta_state.alloc); - } + struct radv_meta_state *state = &device->meta_state; + + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->itoi.img_p_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->itoi.img_ds_layout, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->itoi.pipeline, &state->alloc); } static nir_shader * @@ -749,21 +731,15 @@ fail: static void radv_device_finish_meta_cleari_state(struct radv_device *device) { - if (device->meta_state.cleari.img_p_layout) { - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.cleari.img_p_layout, - &device->meta_state.alloc); - } - if (device->meta_state.cleari.img_ds_layout) { - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.cleari.img_ds_layout, - &device->meta_state.alloc); - } - if (device->meta_state.cleari.pipeline) { - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.cleari.pipeline, - &device->meta_state.alloc); - } + struct radv_meta_state *state = &device->meta_state; + + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->cleari.img_p_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->cleari.img_ds_layout, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->cleari.pipeline, &state->alloc); } void |