summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_bufimage.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-09-28 13:50:56 +0200
committerSamuel Pitoiset <[email protected]>2017-10-02 11:56:20 +0200
commit06dbe0722f8109d8cc7b1c7edf0dc3d4ce6f0d08 (patch)
tree87cae3569168a1cf7565dbc43f4ed5d15384f9d4 /src/amd/vulkan/radv_meta_bufimage.c
parent2084629b632407ba3a4c769d0deb38cd2aa24772 (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_bufimage.c')
-rw-r--r--src/amd/vulkan/radv_meta_bufimage.c96
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