1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2021 Collabora Ltd.
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Derived from:
5bf215546Sopenharmony_ci * Copyright © 2016 Red Hat.
6bf215546Sopenharmony_ci * Copyright © 2016 Bas Nieuwenhuizen
7bf215546Sopenharmony_ci *
8bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
9bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
10bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
11bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
13bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
16bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
17bf215546Sopenharmony_ci * Software.
18bf215546Sopenharmony_ci *
19bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
22bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25bf215546Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
26bf215546Sopenharmony_ci */
27bf215546Sopenharmony_ci#include "panvk_private.h"
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ci#include <assert.h>
30bf215546Sopenharmony_ci#include <fcntl.h>
31bf215546Sopenharmony_ci#include <stdbool.h>
32bf215546Sopenharmony_ci#include <string.h>
33bf215546Sopenharmony_ci#include <unistd.h>
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci#include "util/mesa-sha1.h"
36bf215546Sopenharmony_ci#include "vk_descriptors.h"
37bf215546Sopenharmony_ci#include "vk_util.h"
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_ci#include "pan_bo.h"
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci/* FIXME: make sure those values are correct */
42bf215546Sopenharmony_ci#define PANVK_MAX_TEXTURES     (1 << 16)
43bf215546Sopenharmony_ci#define PANVK_MAX_IMAGES       (1 << 8)
44bf215546Sopenharmony_ci#define PANVK_MAX_SAMPLERS     (1 << 16)
45bf215546Sopenharmony_ci#define PANVK_MAX_UBOS         255
46bf215546Sopenharmony_ci
47bf215546Sopenharmony_civoid
48bf215546Sopenharmony_cipanvk_GetDescriptorSetLayoutSupport(VkDevice _device,
49bf215546Sopenharmony_ci                                    const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
50bf215546Sopenharmony_ci                                    VkDescriptorSetLayoutSupport *pSupport)
51bf215546Sopenharmony_ci{
52bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
53bf215546Sopenharmony_ci
54bf215546Sopenharmony_ci   pSupport->supported = false;
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci   VkDescriptorSetLayoutBinding *bindings;
57bf215546Sopenharmony_ci   VkResult result =
58bf215546Sopenharmony_ci      vk_create_sorted_bindings(pCreateInfo->pBindings,
59bf215546Sopenharmony_ci                                pCreateInfo->bindingCount,
60bf215546Sopenharmony_ci                                &bindings);
61bf215546Sopenharmony_ci   if (result != VK_SUCCESS) {
62bf215546Sopenharmony_ci      vk_error(device, result);
63bf215546Sopenharmony_ci      return;
64bf215546Sopenharmony_ci   }
65bf215546Sopenharmony_ci
66bf215546Sopenharmony_ci   unsigned sampler_idx = 0, tex_idx = 0, ubo_idx = 0;
67bf215546Sopenharmony_ci   unsigned dynoffset_idx = 0, img_idx = 0;
68bf215546Sopenharmony_ci
69bf215546Sopenharmony_ci   for (unsigned i = 0; i < pCreateInfo->bindingCount; i++) {
70bf215546Sopenharmony_ci      const VkDescriptorSetLayoutBinding *binding = &bindings[i];
71bf215546Sopenharmony_ci
72bf215546Sopenharmony_ci      switch (binding->descriptorType) {
73bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_SAMPLER:
74bf215546Sopenharmony_ci         sampler_idx += binding->descriptorCount;
75bf215546Sopenharmony_ci         break;
76bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
77bf215546Sopenharmony_ci         sampler_idx += binding->descriptorCount;
78bf215546Sopenharmony_ci         tex_idx += binding->descriptorCount;
79bf215546Sopenharmony_ci         break;
80bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
81bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
82bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
83bf215546Sopenharmony_ci         tex_idx += binding->descriptorCount;
84bf215546Sopenharmony_ci         break;
85bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
86bf215546Sopenharmony_ci         dynoffset_idx += binding->descriptorCount;
87bf215546Sopenharmony_ci         FALLTHROUGH;
88bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
89bf215546Sopenharmony_ci         ubo_idx += binding->descriptorCount;
90bf215546Sopenharmony_ci         break;
91bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
92bf215546Sopenharmony_ci         dynoffset_idx += binding->descriptorCount;
93bf215546Sopenharmony_ci         FALLTHROUGH;
94bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
95bf215546Sopenharmony_ci         break;
96bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
97bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
98bf215546Sopenharmony_ci         img_idx += binding->descriptorCount;
99bf215546Sopenharmony_ci         break;
100bf215546Sopenharmony_ci      default:
101bf215546Sopenharmony_ci         unreachable("Invalid descriptor type");
102bf215546Sopenharmony_ci      }
103bf215546Sopenharmony_ci   }
104bf215546Sopenharmony_ci
105bf215546Sopenharmony_ci   /* The maximum values apply to all sets attached to a pipeline since all
106bf215546Sopenharmony_ci    * sets descriptors have to be merged in a single array.
107bf215546Sopenharmony_ci    */
108bf215546Sopenharmony_ci   if (tex_idx > PANVK_MAX_TEXTURES / MAX_SETS ||
109bf215546Sopenharmony_ci       sampler_idx > PANVK_MAX_SAMPLERS / MAX_SETS ||
110bf215546Sopenharmony_ci       ubo_idx > PANVK_MAX_UBOS / MAX_SETS ||
111bf215546Sopenharmony_ci       img_idx > PANVK_MAX_IMAGES / MAX_SETS)
112bf215546Sopenharmony_ci      return;
113bf215546Sopenharmony_ci
114bf215546Sopenharmony_ci   pSupport->supported = true;
115bf215546Sopenharmony_ci}
116bf215546Sopenharmony_ci
117bf215546Sopenharmony_ci/*
118bf215546Sopenharmony_ci * Pipeline layouts.  These have nothing to do with the pipeline.  They are
119bf215546Sopenharmony_ci * just multiple descriptor set layouts pasted together.
120bf215546Sopenharmony_ci */
121bf215546Sopenharmony_ci
122bf215546Sopenharmony_ciVkResult
123bf215546Sopenharmony_cipanvk_CreatePipelineLayout(VkDevice _device,
124bf215546Sopenharmony_ci                           const VkPipelineLayoutCreateInfo *pCreateInfo,
125bf215546Sopenharmony_ci                           const VkAllocationCallbacks *pAllocator,
126bf215546Sopenharmony_ci                           VkPipelineLayout *pPipelineLayout)
127bf215546Sopenharmony_ci{
128bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
129bf215546Sopenharmony_ci   struct panvk_pipeline_layout *layout;
130bf215546Sopenharmony_ci   struct mesa_sha1 ctx;
131bf215546Sopenharmony_ci
132bf215546Sopenharmony_ci   layout = vk_pipeline_layout_zalloc(&device->vk, sizeof(*layout),
133bf215546Sopenharmony_ci                                      pCreateInfo);
134bf215546Sopenharmony_ci   if (layout == NULL)
135bf215546Sopenharmony_ci      return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
136bf215546Sopenharmony_ci
137bf215546Sopenharmony_ci   _mesa_sha1_init(&ctx);
138bf215546Sopenharmony_ci
139bf215546Sopenharmony_ci   unsigned sampler_idx = 0, tex_idx = 0, ubo_idx = 0;
140bf215546Sopenharmony_ci   unsigned dyn_ubo_idx = 0, dyn_ssbo_idx = 0, img_idx = 0;
141bf215546Sopenharmony_ci   for (unsigned set = 0; set < pCreateInfo->setLayoutCount; set++) {
142bf215546Sopenharmony_ci      const struct panvk_descriptor_set_layout *set_layout =
143bf215546Sopenharmony_ci         vk_to_panvk_descriptor_set_layout(layout->vk.set_layouts[set]);
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_ci      layout->sets[set].sampler_offset = sampler_idx;
146bf215546Sopenharmony_ci      layout->sets[set].tex_offset = tex_idx;
147bf215546Sopenharmony_ci      layout->sets[set].ubo_offset = ubo_idx;
148bf215546Sopenharmony_ci      layout->sets[set].dyn_ubo_offset = dyn_ubo_idx;
149bf215546Sopenharmony_ci      layout->sets[set].dyn_ssbo_offset = dyn_ssbo_idx;
150bf215546Sopenharmony_ci      layout->sets[set].img_offset = img_idx;
151bf215546Sopenharmony_ci      sampler_idx += set_layout->num_samplers;
152bf215546Sopenharmony_ci      tex_idx += set_layout->num_textures;
153bf215546Sopenharmony_ci      ubo_idx += set_layout->num_ubos;
154bf215546Sopenharmony_ci      dyn_ubo_idx += set_layout->num_dyn_ubos;
155bf215546Sopenharmony_ci      dyn_ssbo_idx += set_layout->num_dyn_ssbos;
156bf215546Sopenharmony_ci      img_idx += set_layout->num_imgs;
157bf215546Sopenharmony_ci
158bf215546Sopenharmony_ci      for (unsigned b = 0; b < set_layout->binding_count; b++) {
159bf215546Sopenharmony_ci         const struct panvk_descriptor_set_binding_layout *binding_layout =
160bf215546Sopenharmony_ci            &set_layout->bindings[b];
161bf215546Sopenharmony_ci
162bf215546Sopenharmony_ci         if (binding_layout->immutable_samplers) {
163bf215546Sopenharmony_ci            for (unsigned s = 0; s < binding_layout->array_size; s++) {
164bf215546Sopenharmony_ci               struct panvk_sampler *sampler = binding_layout->immutable_samplers[s];
165bf215546Sopenharmony_ci
166bf215546Sopenharmony_ci               _mesa_sha1_update(&ctx, &sampler->desc, sizeof(sampler->desc));
167bf215546Sopenharmony_ci            }
168bf215546Sopenharmony_ci         }
169bf215546Sopenharmony_ci         _mesa_sha1_update(&ctx, &binding_layout->type, sizeof(binding_layout->type));
170bf215546Sopenharmony_ci         _mesa_sha1_update(&ctx, &binding_layout->array_size, sizeof(binding_layout->array_size));
171bf215546Sopenharmony_ci         _mesa_sha1_update(&ctx, &binding_layout->shader_stages, sizeof(binding_layout->shader_stages));
172bf215546Sopenharmony_ci      }
173bf215546Sopenharmony_ci   }
174bf215546Sopenharmony_ci
175bf215546Sopenharmony_ci   for (unsigned range = 0; range < pCreateInfo->pushConstantRangeCount; range++) {
176bf215546Sopenharmony_ci      layout->push_constants.size =
177bf215546Sopenharmony_ci         MAX2(pCreateInfo->pPushConstantRanges[range].offset +
178bf215546Sopenharmony_ci              pCreateInfo->pPushConstantRanges[range].size,
179bf215546Sopenharmony_ci              layout->push_constants.size);
180bf215546Sopenharmony_ci   }
181bf215546Sopenharmony_ci
182bf215546Sopenharmony_ci   layout->num_samplers = sampler_idx;
183bf215546Sopenharmony_ci   layout->num_textures = tex_idx;
184bf215546Sopenharmony_ci   layout->num_ubos = ubo_idx;
185bf215546Sopenharmony_ci   layout->num_dyn_ubos = dyn_ubo_idx;
186bf215546Sopenharmony_ci   layout->num_dyn_ssbos = dyn_ssbo_idx;
187bf215546Sopenharmony_ci   layout->num_imgs = img_idx;
188bf215546Sopenharmony_ci
189bf215546Sopenharmony_ci   /* Some NIR texture operations don't require a sampler, but Bifrost/Midgard
190bf215546Sopenharmony_ci    * ones always expect one. Add a dummy sampler to deal with this limitation.
191bf215546Sopenharmony_ci    */
192bf215546Sopenharmony_ci   if (layout->num_textures) {
193bf215546Sopenharmony_ci      layout->num_samplers++;
194bf215546Sopenharmony_ci      for (unsigned set = 0; set < pCreateInfo->setLayoutCount; set++)
195bf215546Sopenharmony_ci         layout->sets[set].sampler_offset++;
196bf215546Sopenharmony_ci   }
197bf215546Sopenharmony_ci
198bf215546Sopenharmony_ci   _mesa_sha1_final(&ctx, layout->sha1);
199bf215546Sopenharmony_ci
200bf215546Sopenharmony_ci   *pPipelineLayout = panvk_pipeline_layout_to_handle(layout);
201bf215546Sopenharmony_ci   return VK_SUCCESS;
202bf215546Sopenharmony_ci}
203bf215546Sopenharmony_ci
204bf215546Sopenharmony_ciVkResult
205bf215546Sopenharmony_cipanvk_CreateDescriptorPool(VkDevice _device,
206bf215546Sopenharmony_ci                           const VkDescriptorPoolCreateInfo *pCreateInfo,
207bf215546Sopenharmony_ci                           const VkAllocationCallbacks *pAllocator,
208bf215546Sopenharmony_ci                           VkDescriptorPool *pDescriptorPool)
209bf215546Sopenharmony_ci{
210bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
211bf215546Sopenharmony_ci   struct panvk_descriptor_pool *pool;
212bf215546Sopenharmony_ci
213bf215546Sopenharmony_ci   pool = vk_object_zalloc(&device->vk, pAllocator,
214bf215546Sopenharmony_ci                           sizeof(struct panvk_descriptor_pool),
215bf215546Sopenharmony_ci                           VK_OBJECT_TYPE_DESCRIPTOR_POOL);
216bf215546Sopenharmony_ci   if (!pool)
217bf215546Sopenharmony_ci      return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
218bf215546Sopenharmony_ci
219bf215546Sopenharmony_ci   pool->max.sets = pCreateInfo->maxSets;
220bf215546Sopenharmony_ci
221bf215546Sopenharmony_ci   for (unsigned i = 0; i < pCreateInfo->poolSizeCount; ++i) {
222bf215546Sopenharmony_ci      unsigned desc_count = pCreateInfo->pPoolSizes[i].descriptorCount;
223bf215546Sopenharmony_ci
224bf215546Sopenharmony_ci      switch(pCreateInfo->pPoolSizes[i].type) {
225bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_SAMPLER:
226bf215546Sopenharmony_ci         pool->max.samplers += desc_count;
227bf215546Sopenharmony_ci         break;
228bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
229bf215546Sopenharmony_ci         pool->max.combined_image_samplers += desc_count;
230bf215546Sopenharmony_ci         break;
231bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
232bf215546Sopenharmony_ci         pool->max.sampled_images += desc_count;
233bf215546Sopenharmony_ci         break;
234bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
235bf215546Sopenharmony_ci         pool->max.storage_images += desc_count;
236bf215546Sopenharmony_ci         break;
237bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
238bf215546Sopenharmony_ci         pool->max.uniform_texel_bufs += desc_count;
239bf215546Sopenharmony_ci         break;
240bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
241bf215546Sopenharmony_ci         pool->max.storage_texel_bufs += desc_count;
242bf215546Sopenharmony_ci         break;
243bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
244bf215546Sopenharmony_ci         pool->max.input_attachments += desc_count;
245bf215546Sopenharmony_ci         break;
246bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
247bf215546Sopenharmony_ci         pool->max.uniform_bufs += desc_count;
248bf215546Sopenharmony_ci         break;
249bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
250bf215546Sopenharmony_ci         pool->max.storage_bufs += desc_count;
251bf215546Sopenharmony_ci         break;
252bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
253bf215546Sopenharmony_ci         pool->max.uniform_dyn_bufs += desc_count;
254bf215546Sopenharmony_ci         break;
255bf215546Sopenharmony_ci      case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
256bf215546Sopenharmony_ci         pool->max.storage_dyn_bufs += desc_count;
257bf215546Sopenharmony_ci         break;
258bf215546Sopenharmony_ci      default:
259bf215546Sopenharmony_ci         unreachable("Invalid descriptor type");
260bf215546Sopenharmony_ci      }
261bf215546Sopenharmony_ci   }
262bf215546Sopenharmony_ci
263bf215546Sopenharmony_ci   *pDescriptorPool = panvk_descriptor_pool_to_handle(pool);
264bf215546Sopenharmony_ci   return VK_SUCCESS;
265bf215546Sopenharmony_ci}
266bf215546Sopenharmony_ci
267bf215546Sopenharmony_civoid
268bf215546Sopenharmony_cipanvk_DestroyDescriptorPool(VkDevice _device,
269bf215546Sopenharmony_ci                            VkDescriptorPool _pool,
270bf215546Sopenharmony_ci                            const VkAllocationCallbacks *pAllocator)
271bf215546Sopenharmony_ci{
272bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
273bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_descriptor_pool, pool, _pool);
274bf215546Sopenharmony_ci
275bf215546Sopenharmony_ci   if (pool)
276bf215546Sopenharmony_ci      vk_object_free(&device->vk, pAllocator, pool);
277bf215546Sopenharmony_ci}
278bf215546Sopenharmony_ci
279bf215546Sopenharmony_ciVkResult
280bf215546Sopenharmony_cipanvk_ResetDescriptorPool(VkDevice _device,
281bf215546Sopenharmony_ci                          VkDescriptorPool _pool,
282bf215546Sopenharmony_ci                          VkDescriptorPoolResetFlags flags)
283bf215546Sopenharmony_ci{
284bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_descriptor_pool, pool, _pool);
285bf215546Sopenharmony_ci   memset(&pool->cur, 0, sizeof(pool->cur));
286bf215546Sopenharmony_ci   return VK_SUCCESS;
287bf215546Sopenharmony_ci}
288bf215546Sopenharmony_ci
289bf215546Sopenharmony_cistatic void
290bf215546Sopenharmony_cipanvk_descriptor_set_destroy(struct panvk_device *device,
291bf215546Sopenharmony_ci                             struct panvk_descriptor_pool *pool,
292bf215546Sopenharmony_ci                             struct panvk_descriptor_set *set)
293bf215546Sopenharmony_ci{
294bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->textures);
295bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->samplers);
296bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->ubos);
297bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->dyn_ubos);
298bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->dyn_ssbos);
299bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->img_fmts);
300bf215546Sopenharmony_ci   vk_free(&device->vk.alloc, set->img_attrib_bufs);
301bf215546Sopenharmony_ci   if (set->desc_bo)
302bf215546Sopenharmony_ci      panfrost_bo_unreference(set->desc_bo);
303bf215546Sopenharmony_ci   vk_object_free(&device->vk, NULL, set);
304bf215546Sopenharmony_ci}
305bf215546Sopenharmony_ci
306bf215546Sopenharmony_ciVkResult
307bf215546Sopenharmony_cipanvk_FreeDescriptorSets(VkDevice _device,
308bf215546Sopenharmony_ci                         VkDescriptorPool descriptorPool,
309bf215546Sopenharmony_ci                         uint32_t count,
310bf215546Sopenharmony_ci                         const VkDescriptorSet *pDescriptorSets)
311bf215546Sopenharmony_ci{
312bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_device, device, _device);
313bf215546Sopenharmony_ci   VK_FROM_HANDLE(panvk_descriptor_pool, pool, descriptorPool);
314bf215546Sopenharmony_ci
315bf215546Sopenharmony_ci   for (unsigned i = 0; i < count; i++) {
316bf215546Sopenharmony_ci      VK_FROM_HANDLE(panvk_descriptor_set, set, pDescriptorSets[i]);
317bf215546Sopenharmony_ci
318bf215546Sopenharmony_ci      if (set)
319bf215546Sopenharmony_ci         panvk_descriptor_set_destroy(device, pool, set);
320bf215546Sopenharmony_ci   }
321bf215546Sopenharmony_ci   return VK_SUCCESS;
322bf215546Sopenharmony_ci}
323bf215546Sopenharmony_ci
324bf215546Sopenharmony_ciVkResult
325bf215546Sopenharmony_cipanvk_CreateDescriptorUpdateTemplate(VkDevice _device,
326bf215546Sopenharmony_ci                                     const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo,
327bf215546Sopenharmony_ci                                     const VkAllocationCallbacks *pAllocator,
328bf215546Sopenharmony_ci                                     VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate)
329bf215546Sopenharmony_ci{
330bf215546Sopenharmony_ci   panvk_stub();
331bf215546Sopenharmony_ci   return VK_SUCCESS;
332bf215546Sopenharmony_ci}
333bf215546Sopenharmony_ci
334bf215546Sopenharmony_civoid
335bf215546Sopenharmony_cipanvk_DestroyDescriptorUpdateTemplate(VkDevice _device,
336bf215546Sopenharmony_ci                                      VkDescriptorUpdateTemplate descriptorUpdateTemplate,
337bf215546Sopenharmony_ci                                      const VkAllocationCallbacks *pAllocator)
338bf215546Sopenharmony_ci{
339bf215546Sopenharmony_ci   panvk_stub();
340bf215546Sopenharmony_ci}
341bf215546Sopenharmony_ci
342bf215546Sopenharmony_civoid
343bf215546Sopenharmony_cipanvk_UpdateDescriptorSetWithTemplate(VkDevice _device,
344bf215546Sopenharmony_ci                                      VkDescriptorSet descriptorSet,
345bf215546Sopenharmony_ci                                      VkDescriptorUpdateTemplate descriptorUpdateTemplate,
346bf215546Sopenharmony_ci                                      const void *pData)
347bf215546Sopenharmony_ci{
348bf215546Sopenharmony_ci   panvk_stub();
349bf215546Sopenharmony_ci}
350bf215546Sopenharmony_ci
351bf215546Sopenharmony_ciVkResult
352bf215546Sopenharmony_cipanvk_CreateSamplerYcbcrConversion(VkDevice device,
353bf215546Sopenharmony_ci                                   const VkSamplerYcbcrConversionCreateInfo *pCreateInfo,
354bf215546Sopenharmony_ci                                   const VkAllocationCallbacks *pAllocator,
355bf215546Sopenharmony_ci                                   VkSamplerYcbcrConversion *pYcbcrConversion)
356bf215546Sopenharmony_ci{
357bf215546Sopenharmony_ci   panvk_stub();
358bf215546Sopenharmony_ci   return VK_SUCCESS;
359bf215546Sopenharmony_ci}
360bf215546Sopenharmony_ci
361bf215546Sopenharmony_civoid
362bf215546Sopenharmony_cipanvk_DestroySamplerYcbcrConversion(VkDevice device,
363bf215546Sopenharmony_ci                                    VkSamplerYcbcrConversion ycbcrConversion,
364bf215546Sopenharmony_ci                                    const VkAllocationCallbacks *pAllocator)
365bf215546Sopenharmony_ci{
366bf215546Sopenharmony_ci   panvk_stub();
367bf215546Sopenharmony_ci}
368