diff options
author | Samuel Pitoiset <[email protected]> | 2017-09-28 13:50:56 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-10-02 11:56:20 +0200 |
commit | 06dbe0722f8109d8cc7b1c7edf0dc3d4ce6f0d08 (patch) | |
tree | 87cae3569168a1cf7565dbc43f4ed5d15384f9d4 /src/amd/vulkan/radv_meta_blit.c | |
parent | 2084629b632407ba3a4c769d0deb38cd2aa24772 (diff) |
radv: cleanup radv_device_finish_meta_XXX() helpers
Unnecessary to double check that handles are not NULL.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_blit.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_blit.c | 91 |
1 files changed, 37 insertions, 54 deletions
diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c index 7d9f7f90263..a0be498de50 100644 --- a/src/amd/vulkan/radv_meta_blit.c +++ b/src/amd/vulkan/radv_meta_blit.c @@ -635,65 +635,48 @@ void radv_CmdBlitImage( void radv_device_finish_meta_blit_state(struct radv_device *device) { - for (unsigned i = 0; i < NUM_META_FS_KEYS; ++i) { - if (device->meta_state.blit.render_pass[i]) - radv_DestroyRenderPass(radv_device_to_handle(device), - device->meta_state.blit.render_pass[i], - &device->meta_state.alloc); - if (device->meta_state.blit.pipeline_1d_src[i]) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.pipeline_1d_src[i], - &device->meta_state.alloc); - if (device->meta_state.blit.pipeline_2d_src[i]) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.pipeline_2d_src[i], - &device->meta_state.alloc); - if (device->meta_state.blit.pipeline_3d_src[i]) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.pipeline_3d_src[i], - &device->meta_state.alloc); - } + struct radv_meta_state *state = &device->meta_state; - if (device->meta_state.blit.depth_only_rp) - radv_DestroyRenderPass(radv_device_to_handle(device), - device->meta_state.blit.depth_only_rp, - &device->meta_state.alloc); - if (device->meta_state.blit.depth_only_1d_pipeline) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.depth_only_1d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.depth_only_2d_pipeline) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.depth_only_2d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.depth_only_3d_pipeline) - radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.depth_only_3d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.stencil_only_rp) + for (unsigned i = 0; i < NUM_META_FS_KEYS; ++i) { radv_DestroyRenderPass(radv_device_to_handle(device), - device->meta_state.blit.stencil_only_rp, - &device->meta_state.alloc); - if (device->meta_state.blit.stencil_only_1d_pipeline) + state->blit.render_pass[i], + &state->alloc); radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.stencil_only_1d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.stencil_only_2d_pipeline) + state->blit.pipeline_1d_src[i], + &state->alloc); radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.stencil_only_2d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.stencil_only_3d_pipeline) + state->blit.pipeline_2d_src[i], + &state->alloc); radv_DestroyPipeline(radv_device_to_handle(device), - device->meta_state.blit.stencil_only_3d_pipeline, - &device->meta_state.alloc); - if (device->meta_state.blit.pipeline_layout) - radv_DestroyPipelineLayout(radv_device_to_handle(device), - device->meta_state.blit.pipeline_layout, - &device->meta_state.alloc); - if (device->meta_state.blit.ds_layout) - radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), - device->meta_state.blit.ds_layout, - &device->meta_state.alloc); + state->blit.pipeline_3d_src[i], + &state->alloc); + } + + radv_DestroyRenderPass(radv_device_to_handle(device), + state->blit.depth_only_rp, &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.depth_only_1d_pipeline, &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.depth_only_2d_pipeline, &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.depth_only_3d_pipeline, &state->alloc); + + radv_DestroyRenderPass(radv_device_to_handle(device), + state->blit.stencil_only_rp, &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.stencil_only_1d_pipeline, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.stencil_only_2d_pipeline, + &state->alloc); + radv_DestroyPipeline(radv_device_to_handle(device), + state->blit.stencil_only_3d_pipeline, + &state->alloc); + + radv_DestroyPipelineLayout(radv_device_to_handle(device), + state->blit.pipeline_layout, &state->alloc); + radv_DestroyDescriptorSetLayout(radv_device_to_handle(device), + state->blit.ds_layout, &state->alloc); } static VkFormat pipeline_formats[] = { |