/*use_repclear*/ false, pipeline);
}
+static void
+free_color_pipelines(struct anv_device *device)
+{
+ for (uint32_t i = 0;
+ i < ARRAY_SIZE(device->meta_state.clear.color_pipelines); ++i) {
+ if (device->meta_state.clear.color_pipelines[i] == NULL)
+ continue;
+
+ ANV_CALL(DestroyPipeline)(
+ anv_device_to_handle(device),
+ anv_pipeline_to_handle(device->meta_state.clear.color_pipelines[i]),
+ &device->meta_state.alloc);
+ }
+}
+
static VkResult
init_color_pipelines(struct anv_device *device)
{
return VK_SUCCESS;
fail:
- for (uint32_t i = 0; i < n; ++i) {
- if (pipelines[i] == NULL)
- break;
-
- anv_DestroyPipeline(anv_device_to_handle(device),
- anv_pipeline_to_handle(pipelines[i]),
- &device->meta_state.alloc);
- }
+ free_color_pipelines(device);
return result;
}
return result;
result = init_depthstencil_pipelines(device);
- if (result != VK_SUCCESS)
+ if (result != VK_SUCCESS) {
+ free_color_pipelines(device);
return result;
+ }
return VK_SUCCESS;
}
{
VkDevice device_h = anv_device_to_handle(device);
- for (uint32_t i = 0;
- i < ARRAY_SIZE(device->meta_state.clear.color_pipelines); ++i) {
- ANV_CALL(DestroyPipeline)(device_h,
- anv_pipeline_to_handle(device->meta_state.clear.color_pipelines[i]),
- NULL);
- }
+ free_color_pipelines(device);
ANV_CALL(DestroyPipeline)(device_h,
anv_pipeline_to_handle(device->meta_state.clear.depth_only_pipeline),