1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2021 Collabora Ltd.
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Derived from tu_pipeline.c which is:
5bf215546Sopenharmony_ci * Copyright © 2016 Red Hat.
6bf215546Sopenharmony_ci * Copyright © 2016 Bas Nieuwenhuizen
7bf215546Sopenharmony_ci * Copyright © 2015 Intel Corporation
8bf215546Sopenharmony_ci *
9bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
10bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
11bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
12bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
14bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
17bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
18bf215546Sopenharmony_ci * Software.
19bf215546Sopenharmony_ci *
20bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
23bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26bf215546Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
27bf215546Sopenharmony_ci */
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ci#include "panvk_cs.h"
30bf215546Sopenharmony_ci#include "panvk_private.h"
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci#include "pan_bo.h"
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci#include "nir/nir.h"
35bf215546Sopenharmony_ci#include "nir/nir_builder.h"
36bf215546Sopenharmony_ci#include "spirv/nir_spirv.h"
37bf215546Sopenharmony_ci#include "util/debug.h"
38bf215546Sopenharmony_ci#include "util/mesa-sha1.h"
39bf215546Sopenharmony_ci#include "util/u_atomic.h"
40bf215546Sopenharmony_ci#include "vk_format.h"
41bf215546Sopenharmony_ci#include "vk_util.h"
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_civoid
45bf215546Sopenharmony_cipanvk_DestroyPipeline(VkDevice _device,
46bf215546Sopenharmony_ci                      VkPipeline _pipeline,
47bf215546Sopenharmony_ci                      const VkAllocationCallbacks *pAllocator)
48bf215546Sopenharmony_ci{
49bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
50bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_pipeline, pipeline, _pipeline);
51bf215546Sopenharmony_ci
52bf215546Sopenharmony_ci   panfrost_bo_unreference(pipeline->binary_bo);
53bf215546Sopenharmony_ci   panfrost_bo_unreference(pipeline->state_bo);
54bf215546Sopenharmony_ci   vk_object_free(&device->vk, pAllocator, pipeline);
55bf215546Sopenharmony_ci}
56