• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This file is generated by venus-protocol.  See vn_protocol_driver.h. */
2 
3 /*
4  * Copyright 2020 Google LLC
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #ifndef VN_PROTOCOL_DRIVER_DESCRIPTOR_SET_H
9 #define VN_PROTOCOL_DRIVER_DESCRIPTOR_SET_H
10 
11 #include "vn_instance.h"
12 #include "vn_protocol_driver_structs.h"
13 
14 /*
15  * These structs/unions/commands are not included
16  *
17  *   vkUpdateDescriptorSetWithTemplate
18  */
19 
20 /* struct VkDescriptorSetVariableDescriptorCountAllocateInfo chain */
21 
22 static inline size_t
vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(const void * val)23 vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(const void *val)
24 {
25     /* no known/supported struct */
26     return vn_sizeof_simple_pointer(NULL);
27 }
28 
29 static inline size_t
vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(const VkDescriptorSetVariableDescriptorCountAllocateInfo * val)30 vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(const VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
31 {
32     size_t size = 0;
33     /* skip val->{sType,pNext} */
34     size += vn_sizeof_uint32_t(&val->descriptorSetCount);
35     if (val->pDescriptorCounts) {
36         size += vn_sizeof_array_size(val->descriptorSetCount);
37         size += vn_sizeof_uint32_t_array(val->pDescriptorCounts, val->descriptorSetCount);
38     } else {
39         size += vn_sizeof_array_size(0);
40     }
41     return size;
42 }
43 
44 static inline size_t
vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo(const VkDescriptorSetVariableDescriptorCountAllocateInfo * val)45 vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo(const VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
46 {
47     size_t size = 0;
48 
49     size += vn_sizeof_VkStructureType(&val->sType);
50     size += vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(val->pNext);
51     size += vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(val);
52 
53     return size;
54 }
55 
56 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(struct vn_cs_encoder * enc,const void * val)57 vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
58 {
59     /* no known/supported struct */
60     vn_encode_simple_pointer(enc, NULL);
61 }
62 
63 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(struct vn_cs_encoder * enc,const VkDescriptorSetVariableDescriptorCountAllocateInfo * val)64 vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
65 {
66     /* skip val->{sType,pNext} */
67     vn_encode_uint32_t(enc, &val->descriptorSetCount);
68     if (val->pDescriptorCounts) {
69         vn_encode_array_size(enc, val->descriptorSetCount);
70         vn_encode_uint32_t_array(enc, val->pDescriptorCounts, val->descriptorSetCount);
71     } else {
72         vn_encode_array_size(enc, 0);
73     }
74 }
75 
76 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo(struct vn_cs_encoder * enc,const VkDescriptorSetVariableDescriptorCountAllocateInfo * val)77 vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
78 {
79     assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO);
80     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO });
81     vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext(enc, val->pNext);
82     vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(enc, val);
83 }
84 
85 /* struct VkDescriptorSetAllocateInfo chain */
86 
87 static inline size_t
vn_sizeof_VkDescriptorSetAllocateInfo_pnext(const void * val)88 vn_sizeof_VkDescriptorSetAllocateInfo_pnext(const void *val)
89 {
90     const VkBaseInStructure *pnext = val;
91     size_t size = 0;
92 
93     while (pnext) {
94         switch ((int32_t)pnext->sType) {
95         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
96             size += vn_sizeof_simple_pointer(pnext);
97             size += vn_sizeof_VkStructureType(&pnext->sType);
98             size += vn_sizeof_VkDescriptorSetAllocateInfo_pnext(pnext->pNext);
99             size += vn_sizeof_VkDescriptorSetVariableDescriptorCountAllocateInfo_self((const VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
100             return size;
101         default:
102             /* ignore unknown/unsupported struct */
103             break;
104         }
105         pnext = pnext->pNext;
106     }
107 
108     return vn_sizeof_simple_pointer(NULL);
109 }
110 
111 static inline size_t
vn_sizeof_VkDescriptorSetAllocateInfo_self(const VkDescriptorSetAllocateInfo * val)112 vn_sizeof_VkDescriptorSetAllocateInfo_self(const VkDescriptorSetAllocateInfo *val)
113 {
114     size_t size = 0;
115     /* skip val->{sType,pNext} */
116     size += vn_sizeof_VkDescriptorPool(&val->descriptorPool);
117     size += vn_sizeof_uint32_t(&val->descriptorSetCount);
118     if (val->pSetLayouts) {
119         size += vn_sizeof_array_size(val->descriptorSetCount);
120         for (uint32_t i = 0; i < val->descriptorSetCount; i++)
121             size += vn_sizeof_VkDescriptorSetLayout(&val->pSetLayouts[i]);
122     } else {
123         size += vn_sizeof_array_size(0);
124     }
125     return size;
126 }
127 
128 static inline size_t
vn_sizeof_VkDescriptorSetAllocateInfo(const VkDescriptorSetAllocateInfo * val)129 vn_sizeof_VkDescriptorSetAllocateInfo(const VkDescriptorSetAllocateInfo *val)
130 {
131     size_t size = 0;
132 
133     size += vn_sizeof_VkStructureType(&val->sType);
134     size += vn_sizeof_VkDescriptorSetAllocateInfo_pnext(val->pNext);
135     size += vn_sizeof_VkDescriptorSetAllocateInfo_self(val);
136 
137     return size;
138 }
139 
140 static inline void
vn_encode_VkDescriptorSetAllocateInfo_pnext(struct vn_cs_encoder * enc,const void * val)141 vn_encode_VkDescriptorSetAllocateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
142 {
143     const VkBaseInStructure *pnext = val;
144 
145     while (pnext) {
146         switch ((int32_t)pnext->sType) {
147         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
148             vn_encode_simple_pointer(enc, pnext);
149             vn_encode_VkStructureType(enc, &pnext->sType);
150             vn_encode_VkDescriptorSetAllocateInfo_pnext(enc, pnext->pNext);
151             vn_encode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self(enc, (const VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
152             return;
153         default:
154             /* ignore unknown/unsupported struct */
155             break;
156         }
157         pnext = pnext->pNext;
158     }
159 
160     vn_encode_simple_pointer(enc, NULL);
161 }
162 
163 static inline void
vn_encode_VkDescriptorSetAllocateInfo_self(struct vn_cs_encoder * enc,const VkDescriptorSetAllocateInfo * val)164 vn_encode_VkDescriptorSetAllocateInfo_self(struct vn_cs_encoder *enc, const VkDescriptorSetAllocateInfo *val)
165 {
166     /* skip val->{sType,pNext} */
167     vn_encode_VkDescriptorPool(enc, &val->descriptorPool);
168     vn_encode_uint32_t(enc, &val->descriptorSetCount);
169     if (val->pSetLayouts) {
170         vn_encode_array_size(enc, val->descriptorSetCount);
171         for (uint32_t i = 0; i < val->descriptorSetCount; i++)
172             vn_encode_VkDescriptorSetLayout(enc, &val->pSetLayouts[i]);
173     } else {
174         vn_encode_array_size(enc, 0);
175     }
176 }
177 
178 static inline void
vn_encode_VkDescriptorSetAllocateInfo(struct vn_cs_encoder * enc,const VkDescriptorSetAllocateInfo * val)179 vn_encode_VkDescriptorSetAllocateInfo(struct vn_cs_encoder *enc, const VkDescriptorSetAllocateInfo *val)
180 {
181     assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO);
182     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO });
183     vn_encode_VkDescriptorSetAllocateInfo_pnext(enc, val->pNext);
184     vn_encode_VkDescriptorSetAllocateInfo_self(enc, val);
185 }
186 
187 /* struct VkDescriptorImageInfo */
188 
189 static inline size_t
vn_sizeof_VkDescriptorImageInfo(const VkDescriptorImageInfo * val)190 vn_sizeof_VkDescriptorImageInfo(const VkDescriptorImageInfo *val)
191 {
192     size_t size = 0;
193     size += vn_sizeof_VkSampler(&val->sampler);
194     size += vn_sizeof_VkImageView(&val->imageView);
195     size += vn_sizeof_VkImageLayout(&val->imageLayout);
196     return size;
197 }
198 
199 static inline void
vn_encode_VkDescriptorImageInfo(struct vn_cs_encoder * enc,const VkDescriptorImageInfo * val)200 vn_encode_VkDescriptorImageInfo(struct vn_cs_encoder *enc, const VkDescriptorImageInfo *val)
201 {
202     vn_encode_VkSampler(enc, &val->sampler);
203     vn_encode_VkImageView(enc, &val->imageView);
204     vn_encode_VkImageLayout(enc, &val->imageLayout);
205 }
206 
207 /* struct VkDescriptorBufferInfo */
208 
209 static inline size_t
vn_sizeof_VkDescriptorBufferInfo(const VkDescriptorBufferInfo * val)210 vn_sizeof_VkDescriptorBufferInfo(const VkDescriptorBufferInfo *val)
211 {
212     size_t size = 0;
213     size += vn_sizeof_VkBuffer(&val->buffer);
214     size += vn_sizeof_VkDeviceSize(&val->offset);
215     size += vn_sizeof_VkDeviceSize(&val->range);
216     return size;
217 }
218 
219 static inline void
vn_encode_VkDescriptorBufferInfo(struct vn_cs_encoder * enc,const VkDescriptorBufferInfo * val)220 vn_encode_VkDescriptorBufferInfo(struct vn_cs_encoder *enc, const VkDescriptorBufferInfo *val)
221 {
222     vn_encode_VkBuffer(enc, &val->buffer);
223     vn_encode_VkDeviceSize(enc, &val->offset);
224     vn_encode_VkDeviceSize(enc, &val->range);
225 }
226 
227 /* struct VkWriteDescriptorSetInlineUniformBlock chain */
228 
229 static inline size_t
vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_pnext(const void * val)230 vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_pnext(const void *val)
231 {
232     /* no known/supported struct */
233     return vn_sizeof_simple_pointer(NULL);
234 }
235 
236 static inline size_t
vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_self(const VkWriteDescriptorSetInlineUniformBlock * val)237 vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_self(const VkWriteDescriptorSetInlineUniformBlock *val)
238 {
239     size_t size = 0;
240     /* skip val->{sType,pNext} */
241     size += vn_sizeof_uint32_t(&val->dataSize);
242     if (val->pData) {
243         size += vn_sizeof_array_size(val->dataSize);
244         size += vn_sizeof_blob_array(val->pData, val->dataSize);
245     } else {
246         size += vn_sizeof_array_size(0);
247     }
248     return size;
249 }
250 
251 static inline size_t
vn_sizeof_VkWriteDescriptorSetInlineUniformBlock(const VkWriteDescriptorSetInlineUniformBlock * val)252 vn_sizeof_VkWriteDescriptorSetInlineUniformBlock(const VkWriteDescriptorSetInlineUniformBlock *val)
253 {
254     size_t size = 0;
255 
256     size += vn_sizeof_VkStructureType(&val->sType);
257     size += vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_pnext(val->pNext);
258     size += vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_self(val);
259 
260     return size;
261 }
262 
263 static inline void
vn_encode_VkWriteDescriptorSetInlineUniformBlock_pnext(struct vn_cs_encoder * enc,const void * val)264 vn_encode_VkWriteDescriptorSetInlineUniformBlock_pnext(struct vn_cs_encoder *enc, const void *val)
265 {
266     /* no known/supported struct */
267     vn_encode_simple_pointer(enc, NULL);
268 }
269 
270 static inline void
vn_encode_VkWriteDescriptorSetInlineUniformBlock_self(struct vn_cs_encoder * enc,const VkWriteDescriptorSetInlineUniformBlock * val)271 vn_encode_VkWriteDescriptorSetInlineUniformBlock_self(struct vn_cs_encoder *enc, const VkWriteDescriptorSetInlineUniformBlock *val)
272 {
273     /* skip val->{sType,pNext} */
274     vn_encode_uint32_t(enc, &val->dataSize);
275     if (val->pData) {
276         vn_encode_array_size(enc, val->dataSize);
277         vn_encode_blob_array(enc, val->pData, val->dataSize);
278     } else {
279         vn_encode_array_size(enc, 0);
280     }
281 }
282 
283 static inline void
vn_encode_VkWriteDescriptorSetInlineUniformBlock(struct vn_cs_encoder * enc,const VkWriteDescriptorSetInlineUniformBlock * val)284 vn_encode_VkWriteDescriptorSetInlineUniformBlock(struct vn_cs_encoder *enc, const VkWriteDescriptorSetInlineUniformBlock *val)
285 {
286     assert(val->sType == VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK);
287     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK });
288     vn_encode_VkWriteDescriptorSetInlineUniformBlock_pnext(enc, val->pNext);
289     vn_encode_VkWriteDescriptorSetInlineUniformBlock_self(enc, val);
290 }
291 
292 /* struct VkWriteDescriptorSet chain */
293 
294 static inline size_t
vn_sizeof_VkWriteDescriptorSet_pnext(const void * val)295 vn_sizeof_VkWriteDescriptorSet_pnext(const void *val)
296 {
297     const VkBaseInStructure *pnext = val;
298     size_t size = 0;
299 
300     while (pnext) {
301         switch ((int32_t)pnext->sType) {
302         case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK:
303             if (!vn_cs_renderer_protocol_has_extension(139 /* VK_EXT_inline_uniform_block */))
304                 break;
305             size += vn_sizeof_simple_pointer(pnext);
306             size += vn_sizeof_VkStructureType(&pnext->sType);
307             size += vn_sizeof_VkWriteDescriptorSet_pnext(pnext->pNext);
308             size += vn_sizeof_VkWriteDescriptorSetInlineUniformBlock_self((const VkWriteDescriptorSetInlineUniformBlock *)pnext);
309             return size;
310         default:
311             /* ignore unknown/unsupported struct */
312             break;
313         }
314         pnext = pnext->pNext;
315     }
316 
317     return vn_sizeof_simple_pointer(NULL);
318 }
319 
320 static inline size_t
vn_sizeof_VkWriteDescriptorSet_self(const VkWriteDescriptorSet * val)321 vn_sizeof_VkWriteDescriptorSet_self(const VkWriteDescriptorSet *val)
322 {
323     size_t size = 0;
324     /* skip val->{sType,pNext} */
325     size += vn_sizeof_VkDescriptorSet(&val->dstSet);
326     size += vn_sizeof_uint32_t(&val->dstBinding);
327     size += vn_sizeof_uint32_t(&val->dstArrayElement);
328     size += vn_sizeof_uint32_t(&val->descriptorCount);
329     size += vn_sizeof_VkDescriptorType(&val->descriptorType);
330     if (val->pImageInfo) {
331         size += vn_sizeof_array_size(val->descriptorCount);
332         for (uint32_t i = 0; i < val->descriptorCount; i++)
333             size += vn_sizeof_VkDescriptorImageInfo(&val->pImageInfo[i]);
334     } else {
335         size += vn_sizeof_array_size(0);
336     }
337     if (val->pBufferInfo) {
338         size += vn_sizeof_array_size(val->descriptorCount);
339         for (uint32_t i = 0; i < val->descriptorCount; i++)
340             size += vn_sizeof_VkDescriptorBufferInfo(&val->pBufferInfo[i]);
341     } else {
342         size += vn_sizeof_array_size(0);
343     }
344     if (val->pTexelBufferView) {
345         size += vn_sizeof_array_size(val->descriptorCount);
346         for (uint32_t i = 0; i < val->descriptorCount; i++)
347             size += vn_sizeof_VkBufferView(&val->pTexelBufferView[i]);
348     } else {
349         size += vn_sizeof_array_size(0);
350     }
351     return size;
352 }
353 
354 static inline size_t
vn_sizeof_VkWriteDescriptorSet(const VkWriteDescriptorSet * val)355 vn_sizeof_VkWriteDescriptorSet(const VkWriteDescriptorSet *val)
356 {
357     size_t size = 0;
358 
359     size += vn_sizeof_VkStructureType(&val->sType);
360     size += vn_sizeof_VkWriteDescriptorSet_pnext(val->pNext);
361     size += vn_sizeof_VkWriteDescriptorSet_self(val);
362 
363     return size;
364 }
365 
366 static inline void
vn_encode_VkWriteDescriptorSet_pnext(struct vn_cs_encoder * enc,const void * val)367 vn_encode_VkWriteDescriptorSet_pnext(struct vn_cs_encoder *enc, const void *val)
368 {
369     const VkBaseInStructure *pnext = val;
370 
371     while (pnext) {
372         switch ((int32_t)pnext->sType) {
373         case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK:
374             if (!vn_cs_renderer_protocol_has_extension(139 /* VK_EXT_inline_uniform_block */))
375                 break;
376             vn_encode_simple_pointer(enc, pnext);
377             vn_encode_VkStructureType(enc, &pnext->sType);
378             vn_encode_VkWriteDescriptorSet_pnext(enc, pnext->pNext);
379             vn_encode_VkWriteDescriptorSetInlineUniformBlock_self(enc, (const VkWriteDescriptorSetInlineUniformBlock *)pnext);
380             return;
381         default:
382             /* ignore unknown/unsupported struct */
383             break;
384         }
385         pnext = pnext->pNext;
386     }
387 
388     vn_encode_simple_pointer(enc, NULL);
389 }
390 
391 static inline void
vn_encode_VkWriteDescriptorSet_self(struct vn_cs_encoder * enc,const VkWriteDescriptorSet * val)392 vn_encode_VkWriteDescriptorSet_self(struct vn_cs_encoder *enc, const VkWriteDescriptorSet *val)
393 {
394     /* skip val->{sType,pNext} */
395     vn_encode_VkDescriptorSet(enc, &val->dstSet);
396     vn_encode_uint32_t(enc, &val->dstBinding);
397     vn_encode_uint32_t(enc, &val->dstArrayElement);
398     vn_encode_uint32_t(enc, &val->descriptorCount);
399     vn_encode_VkDescriptorType(enc, &val->descriptorType);
400     if (val->pImageInfo) {
401         vn_encode_array_size(enc, val->descriptorCount);
402         for (uint32_t i = 0; i < val->descriptorCount; i++)
403             vn_encode_VkDescriptorImageInfo(enc, &val->pImageInfo[i]);
404     } else {
405         vn_encode_array_size(enc, 0);
406     }
407     if (val->pBufferInfo) {
408         vn_encode_array_size(enc, val->descriptorCount);
409         for (uint32_t i = 0; i < val->descriptorCount; i++)
410             vn_encode_VkDescriptorBufferInfo(enc, &val->pBufferInfo[i]);
411     } else {
412         vn_encode_array_size(enc, 0);
413     }
414     if (val->pTexelBufferView) {
415         vn_encode_array_size(enc, val->descriptorCount);
416         for (uint32_t i = 0; i < val->descriptorCount; i++)
417             vn_encode_VkBufferView(enc, &val->pTexelBufferView[i]);
418     } else {
419         vn_encode_array_size(enc, 0);
420     }
421 }
422 
423 static inline void
vn_encode_VkWriteDescriptorSet(struct vn_cs_encoder * enc,const VkWriteDescriptorSet * val)424 vn_encode_VkWriteDescriptorSet(struct vn_cs_encoder *enc, const VkWriteDescriptorSet *val)
425 {
426     assert(val->sType == VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET);
427     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET });
428     vn_encode_VkWriteDescriptorSet_pnext(enc, val->pNext);
429     vn_encode_VkWriteDescriptorSet_self(enc, val);
430 }
431 
432 /* struct VkCopyDescriptorSet chain */
433 
434 static inline size_t
vn_sizeof_VkCopyDescriptorSet_pnext(const void * val)435 vn_sizeof_VkCopyDescriptorSet_pnext(const void *val)
436 {
437     /* no known/supported struct */
438     return vn_sizeof_simple_pointer(NULL);
439 }
440 
441 static inline size_t
vn_sizeof_VkCopyDescriptorSet_self(const VkCopyDescriptorSet * val)442 vn_sizeof_VkCopyDescriptorSet_self(const VkCopyDescriptorSet *val)
443 {
444     size_t size = 0;
445     /* skip val->{sType,pNext} */
446     size += vn_sizeof_VkDescriptorSet(&val->srcSet);
447     size += vn_sizeof_uint32_t(&val->srcBinding);
448     size += vn_sizeof_uint32_t(&val->srcArrayElement);
449     size += vn_sizeof_VkDescriptorSet(&val->dstSet);
450     size += vn_sizeof_uint32_t(&val->dstBinding);
451     size += vn_sizeof_uint32_t(&val->dstArrayElement);
452     size += vn_sizeof_uint32_t(&val->descriptorCount);
453     return size;
454 }
455 
456 static inline size_t
vn_sizeof_VkCopyDescriptorSet(const VkCopyDescriptorSet * val)457 vn_sizeof_VkCopyDescriptorSet(const VkCopyDescriptorSet *val)
458 {
459     size_t size = 0;
460 
461     size += vn_sizeof_VkStructureType(&val->sType);
462     size += vn_sizeof_VkCopyDescriptorSet_pnext(val->pNext);
463     size += vn_sizeof_VkCopyDescriptorSet_self(val);
464 
465     return size;
466 }
467 
468 static inline void
vn_encode_VkCopyDescriptorSet_pnext(struct vn_cs_encoder * enc,const void * val)469 vn_encode_VkCopyDescriptorSet_pnext(struct vn_cs_encoder *enc, const void *val)
470 {
471     /* no known/supported struct */
472     vn_encode_simple_pointer(enc, NULL);
473 }
474 
475 static inline void
vn_encode_VkCopyDescriptorSet_self(struct vn_cs_encoder * enc,const VkCopyDescriptorSet * val)476 vn_encode_VkCopyDescriptorSet_self(struct vn_cs_encoder *enc, const VkCopyDescriptorSet *val)
477 {
478     /* skip val->{sType,pNext} */
479     vn_encode_VkDescriptorSet(enc, &val->srcSet);
480     vn_encode_uint32_t(enc, &val->srcBinding);
481     vn_encode_uint32_t(enc, &val->srcArrayElement);
482     vn_encode_VkDescriptorSet(enc, &val->dstSet);
483     vn_encode_uint32_t(enc, &val->dstBinding);
484     vn_encode_uint32_t(enc, &val->dstArrayElement);
485     vn_encode_uint32_t(enc, &val->descriptorCount);
486 }
487 
488 static inline void
vn_encode_VkCopyDescriptorSet(struct vn_cs_encoder * enc,const VkCopyDescriptorSet * val)489 vn_encode_VkCopyDescriptorSet(struct vn_cs_encoder *enc, const VkCopyDescriptorSet *val)
490 {
491     assert(val->sType == VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET);
492     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET });
493     vn_encode_VkCopyDescriptorSet_pnext(enc, val->pNext);
494     vn_encode_VkCopyDescriptorSet_self(enc, val);
495 }
496 
vn_sizeof_vkAllocateDescriptorSets(VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)497 static inline size_t vn_sizeof_vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
498 {
499     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT;
500     const VkFlags cmd_flags = 0;
501     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
502 
503     cmd_size += vn_sizeof_VkDevice(&device);
504     cmd_size += vn_sizeof_simple_pointer(pAllocateInfo);
505     if (pAllocateInfo)
506         cmd_size += vn_sizeof_VkDescriptorSetAllocateInfo(pAllocateInfo);
507     if (pDescriptorSets) {
508         cmd_size += vn_sizeof_array_size((pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0));
509         for (uint32_t i = 0; i < (pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0); i++)
510             cmd_size += vn_sizeof_VkDescriptorSet(&pDescriptorSets[i]);
511     } else {
512         cmd_size += vn_sizeof_array_size(0);
513     }
514 
515     return cmd_size;
516 }
517 
vn_encode_vkAllocateDescriptorSets(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)518 static inline void vn_encode_vkAllocateDescriptorSets(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
519 {
520     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT;
521 
522     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
523     vn_encode_VkFlags(enc, &cmd_flags);
524 
525     vn_encode_VkDevice(enc, &device);
526     if (vn_encode_simple_pointer(enc, pAllocateInfo))
527         vn_encode_VkDescriptorSetAllocateInfo(enc, pAllocateInfo);
528     if (pDescriptorSets) {
529         vn_encode_array_size(enc, (pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0));
530         for (uint32_t i = 0; i < (pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0); i++)
531             vn_encode_VkDescriptorSet(enc, &pDescriptorSets[i]);
532     } else {
533         vn_encode_array_size(enc, 0);
534     }
535 }
536 
vn_sizeof_vkAllocateDescriptorSets_reply(VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)537 static inline size_t vn_sizeof_vkAllocateDescriptorSets_reply(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
538 {
539     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT;
540     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
541 
542     VkResult ret;
543     cmd_size += vn_sizeof_VkResult(&ret);
544     /* skip device */
545     /* skip pAllocateInfo */
546     if (pDescriptorSets) {
547         cmd_size += vn_sizeof_array_size((pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0));
548         for (uint32_t i = 0; i < (pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0); i++)
549             cmd_size += vn_sizeof_VkDescriptorSet(&pDescriptorSets[i]);
550     } else {
551         cmd_size += vn_sizeof_array_size(0);
552     }
553 
554     return cmd_size;
555 }
556 
vn_decode_vkAllocateDescriptorSets_reply(struct vn_cs_decoder * dec,VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)557 static inline VkResult vn_decode_vkAllocateDescriptorSets_reply(struct vn_cs_decoder *dec, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
558 {
559     VkCommandTypeEXT command_type;
560     vn_decode_VkCommandTypeEXT(dec, &command_type);
561     assert(command_type == VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT);
562 
563     VkResult ret;
564     vn_decode_VkResult(dec, &ret);
565     /* skip device */
566     /* skip pAllocateInfo */
567     if (vn_peek_array_size(dec)) {
568         const uint32_t iter_count = vn_decode_array_size(dec, (pAllocateInfo ? pAllocateInfo->descriptorSetCount : 0));
569         for (uint32_t i = 0; i < iter_count; i++)
570             vn_decode_VkDescriptorSet(dec, &pDescriptorSets[i]);
571     } else {
572         vn_decode_array_size_unchecked(dec);
573         pDescriptorSets = NULL;
574     }
575 
576     return ret;
577 }
578 
vn_sizeof_vkFreeDescriptorSets(VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)579 static inline size_t vn_sizeof_vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
580 {
581     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT;
582     const VkFlags cmd_flags = 0;
583     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
584 
585     cmd_size += vn_sizeof_VkDevice(&device);
586     cmd_size += vn_sizeof_VkDescriptorPool(&descriptorPool);
587     cmd_size += vn_sizeof_uint32_t(&descriptorSetCount);
588     if (pDescriptorSets) {
589         cmd_size += vn_sizeof_array_size(descriptorSetCount);
590         for (uint32_t i = 0; i < descriptorSetCount; i++)
591             cmd_size += vn_sizeof_VkDescriptorSet(&pDescriptorSets[i]);
592     } else {
593         cmd_size += vn_sizeof_array_size(0);
594     }
595 
596     return cmd_size;
597 }
598 
vn_encode_vkFreeDescriptorSets(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)599 static inline void vn_encode_vkFreeDescriptorSets(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
600 {
601     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT;
602 
603     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
604     vn_encode_VkFlags(enc, &cmd_flags);
605 
606     vn_encode_VkDevice(enc, &device);
607     vn_encode_VkDescriptorPool(enc, &descriptorPool);
608     vn_encode_uint32_t(enc, &descriptorSetCount);
609     if (pDescriptorSets) {
610         vn_encode_array_size(enc, descriptorSetCount);
611         for (uint32_t i = 0; i < descriptorSetCount; i++)
612             vn_encode_VkDescriptorSet(enc, &pDescriptorSets[i]);
613     } else {
614         vn_encode_array_size(enc, 0);
615     }
616 }
617 
vn_sizeof_vkFreeDescriptorSets_reply(VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)618 static inline size_t vn_sizeof_vkFreeDescriptorSets_reply(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
619 {
620     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT;
621     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
622 
623     VkResult ret;
624     cmd_size += vn_sizeof_VkResult(&ret);
625     /* skip device */
626     /* skip descriptorPool */
627     /* skip descriptorSetCount */
628     /* skip pDescriptorSets */
629 
630     return cmd_size;
631 }
632 
vn_decode_vkFreeDescriptorSets_reply(struct vn_cs_decoder * dec,VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)633 static inline VkResult vn_decode_vkFreeDescriptorSets_reply(struct vn_cs_decoder *dec, VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
634 {
635     VkCommandTypeEXT command_type;
636     vn_decode_VkCommandTypeEXT(dec, &command_type);
637     assert(command_type == VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT);
638 
639     VkResult ret;
640     vn_decode_VkResult(dec, &ret);
641     /* skip device */
642     /* skip descriptorPool */
643     /* skip descriptorSetCount */
644     /* skip pDescriptorSets */
645 
646     return ret;
647 }
648 
vn_sizeof_vkUpdateDescriptorSets(VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)649 static inline size_t vn_sizeof_vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
650 {
651     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT;
652     const VkFlags cmd_flags = 0;
653     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
654 
655     cmd_size += vn_sizeof_VkDevice(&device);
656     cmd_size += vn_sizeof_uint32_t(&descriptorWriteCount);
657     if (pDescriptorWrites) {
658         cmd_size += vn_sizeof_array_size(descriptorWriteCount);
659         for (uint32_t i = 0; i < descriptorWriteCount; i++)
660             cmd_size += vn_sizeof_VkWriteDescriptorSet(&pDescriptorWrites[i]);
661     } else {
662         cmd_size += vn_sizeof_array_size(0);
663     }
664     cmd_size += vn_sizeof_uint32_t(&descriptorCopyCount);
665     if (pDescriptorCopies) {
666         cmd_size += vn_sizeof_array_size(descriptorCopyCount);
667         for (uint32_t i = 0; i < descriptorCopyCount; i++)
668             cmd_size += vn_sizeof_VkCopyDescriptorSet(&pDescriptorCopies[i]);
669     } else {
670         cmd_size += vn_sizeof_array_size(0);
671     }
672 
673     return cmd_size;
674 }
675 
vn_encode_vkUpdateDescriptorSets(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)676 static inline void vn_encode_vkUpdateDescriptorSets(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
677 {
678     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT;
679 
680     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
681     vn_encode_VkFlags(enc, &cmd_flags);
682 
683     vn_encode_VkDevice(enc, &device);
684     vn_encode_uint32_t(enc, &descriptorWriteCount);
685     if (pDescriptorWrites) {
686         vn_encode_array_size(enc, descriptorWriteCount);
687         for (uint32_t i = 0; i < descriptorWriteCount; i++)
688             vn_encode_VkWriteDescriptorSet(enc, &pDescriptorWrites[i]);
689     } else {
690         vn_encode_array_size(enc, 0);
691     }
692     vn_encode_uint32_t(enc, &descriptorCopyCount);
693     if (pDescriptorCopies) {
694         vn_encode_array_size(enc, descriptorCopyCount);
695         for (uint32_t i = 0; i < descriptorCopyCount; i++)
696             vn_encode_VkCopyDescriptorSet(enc, &pDescriptorCopies[i]);
697     } else {
698         vn_encode_array_size(enc, 0);
699     }
700 }
701 
vn_sizeof_vkUpdateDescriptorSets_reply(VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)702 static inline size_t vn_sizeof_vkUpdateDescriptorSets_reply(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
703 {
704     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT;
705     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
706 
707     /* skip device */
708     /* skip descriptorWriteCount */
709     /* skip pDescriptorWrites */
710     /* skip descriptorCopyCount */
711     /* skip pDescriptorCopies */
712 
713     return cmd_size;
714 }
715 
vn_decode_vkUpdateDescriptorSets_reply(struct vn_cs_decoder * dec,VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)716 static inline void vn_decode_vkUpdateDescriptorSets_reply(struct vn_cs_decoder *dec, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
717 {
718     VkCommandTypeEXT command_type;
719     vn_decode_VkCommandTypeEXT(dec, &command_type);
720     assert(command_type == VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT);
721 
722     /* skip device */
723     /* skip descriptorWriteCount */
724     /* skip pDescriptorWrites */
725     /* skip descriptorCopyCount */
726     /* skip pDescriptorCopies */
727 }
728 
vn_submit_vkAllocateDescriptorSets(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets,struct vn_instance_submit_command * submit)729 static inline void vn_submit_vkAllocateDescriptorSets(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets, struct vn_instance_submit_command *submit)
730 {
731     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
732     void *cmd_data = local_cmd_data;
733     size_t cmd_size = vn_sizeof_vkAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
734     if (cmd_size > sizeof(local_cmd_data)) {
735         cmd_data = malloc(cmd_size);
736         if (!cmd_data)
737             cmd_size = 0;
738     }
739     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkAllocateDescriptorSets_reply(device, pAllocateInfo, pDescriptorSets) : 0;
740 
741     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
742     if (cmd_size) {
743         vn_encode_vkAllocateDescriptorSets(enc, cmd_flags, device, pAllocateInfo, pDescriptorSets);
744         vn_instance_submit_command(vn_instance, submit);
745         if (cmd_data != local_cmd_data)
746             free(cmd_data);
747     }
748 }
749 
vn_submit_vkFreeDescriptorSets(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets,struct vn_instance_submit_command * submit)750 static inline void vn_submit_vkFreeDescriptorSets(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, struct vn_instance_submit_command *submit)
751 {
752     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
753     void *cmd_data = local_cmd_data;
754     size_t cmd_size = vn_sizeof_vkFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
755     if (cmd_size > sizeof(local_cmd_data)) {
756         cmd_data = malloc(cmd_size);
757         if (!cmd_data)
758             cmd_size = 0;
759     }
760     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkFreeDescriptorSets_reply(device, descriptorPool, descriptorSetCount, pDescriptorSets) : 0;
761 
762     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
763     if (cmd_size) {
764         vn_encode_vkFreeDescriptorSets(enc, cmd_flags, device, descriptorPool, descriptorSetCount, pDescriptorSets);
765         vn_instance_submit_command(vn_instance, submit);
766         if (cmd_data != local_cmd_data)
767             free(cmd_data);
768     }
769 }
770 
vn_submit_vkUpdateDescriptorSets(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies,struct vn_instance_submit_command * submit)771 static inline void vn_submit_vkUpdateDescriptorSets(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies, struct vn_instance_submit_command *submit)
772 {
773     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
774     void *cmd_data = local_cmd_data;
775     size_t cmd_size = vn_sizeof_vkUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
776     if (cmd_size > sizeof(local_cmd_data)) {
777         cmd_data = malloc(cmd_size);
778         if (!cmd_data)
779             cmd_size = 0;
780     }
781     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkUpdateDescriptorSets_reply(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies) : 0;
782 
783     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
784     if (cmd_size) {
785         vn_encode_vkUpdateDescriptorSets(enc, cmd_flags, device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
786         vn_instance_submit_command(vn_instance, submit);
787         if (cmd_data != local_cmd_data)
788             free(cmd_data);
789     }
790 }
791 
vn_call_vkAllocateDescriptorSets(struct vn_instance * vn_instance,VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)792 static inline VkResult vn_call_vkAllocateDescriptorSets(struct vn_instance *vn_instance, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
793 {
794     VN_TRACE_FUNC();
795 
796     struct vn_instance_submit_command submit;
797     vn_submit_vkAllocateDescriptorSets(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pAllocateInfo, pDescriptorSets, &submit);
798     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
799     if (dec) {
800         const VkResult ret = vn_decode_vkAllocateDescriptorSets_reply(dec, device, pAllocateInfo, pDescriptorSets);
801         vn_instance_free_command_reply(vn_instance, &submit);
802         return ret;
803     } else {
804         return VK_ERROR_OUT_OF_HOST_MEMORY;
805     }
806 }
807 
vn_async_vkAllocateDescriptorSets(struct vn_instance * vn_instance,VkDevice device,const VkDescriptorSetAllocateInfo * pAllocateInfo,VkDescriptorSet * pDescriptorSets)808 static inline void vn_async_vkAllocateDescriptorSets(struct vn_instance *vn_instance, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets)
809 {
810     struct vn_instance_submit_command submit;
811     vn_submit_vkAllocateDescriptorSets(vn_instance, 0, device, pAllocateInfo, pDescriptorSets, &submit);
812 }
813 
vn_call_vkFreeDescriptorSets(struct vn_instance * vn_instance,VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)814 static inline VkResult vn_call_vkFreeDescriptorSets(struct vn_instance *vn_instance, VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
815 {
816     VN_TRACE_FUNC();
817 
818     struct vn_instance_submit_command submit;
819     vn_submit_vkFreeDescriptorSets(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, descriptorPool, descriptorSetCount, pDescriptorSets, &submit);
820     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
821     if (dec) {
822         const VkResult ret = vn_decode_vkFreeDescriptorSets_reply(dec, device, descriptorPool, descriptorSetCount, pDescriptorSets);
823         vn_instance_free_command_reply(vn_instance, &submit);
824         return ret;
825     } else {
826         return VK_ERROR_OUT_OF_HOST_MEMORY;
827     }
828 }
829 
vn_async_vkFreeDescriptorSets(struct vn_instance * vn_instance,VkDevice device,VkDescriptorPool descriptorPool,uint32_t descriptorSetCount,const VkDescriptorSet * pDescriptorSets)830 static inline void vn_async_vkFreeDescriptorSets(struct vn_instance *vn_instance, VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets)
831 {
832     struct vn_instance_submit_command submit;
833     vn_submit_vkFreeDescriptorSets(vn_instance, 0, device, descriptorPool, descriptorSetCount, pDescriptorSets, &submit);
834 }
835 
vn_call_vkUpdateDescriptorSets(struct vn_instance * vn_instance,VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)836 static inline void vn_call_vkUpdateDescriptorSets(struct vn_instance *vn_instance, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
837 {
838     VN_TRACE_FUNC();
839 
840     struct vn_instance_submit_command submit;
841     vn_submit_vkUpdateDescriptorSets(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies, &submit);
842     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
843     if (dec) {
844         vn_decode_vkUpdateDescriptorSets_reply(dec, device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
845         vn_instance_free_command_reply(vn_instance, &submit);
846     }
847 }
848 
vn_async_vkUpdateDescriptorSets(struct vn_instance * vn_instance,VkDevice device,uint32_t descriptorWriteCount,const VkWriteDescriptorSet * pDescriptorWrites,uint32_t descriptorCopyCount,const VkCopyDescriptorSet * pDescriptorCopies)849 static inline void vn_async_vkUpdateDescriptorSets(struct vn_instance *vn_instance, VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies)
850 {
851     struct vn_instance_submit_command submit;
852     vn_submit_vkUpdateDescriptorSets(vn_instance, 0, device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies, &submit);
853 }
854 
855 #endif /* VN_PROTOCOL_DRIVER_DESCRIPTOR_SET_H */
856