• 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_RENDER_PASS_H
9 #define VN_PROTOCOL_DRIVER_RENDER_PASS_H
10 
11 #include "vn_instance.h"
12 #include "vn_protocol_driver_structs.h"
13 
14 /* struct VkAttachmentDescription */
15 
16 static inline size_t
vn_sizeof_VkAttachmentDescription(const VkAttachmentDescription * val)17 vn_sizeof_VkAttachmentDescription(const VkAttachmentDescription *val)
18 {
19     size_t size = 0;
20     size += vn_sizeof_VkFlags(&val->flags);
21     size += vn_sizeof_VkFormat(&val->format);
22     size += vn_sizeof_VkSampleCountFlagBits(&val->samples);
23     size += vn_sizeof_VkAttachmentLoadOp(&val->loadOp);
24     size += vn_sizeof_VkAttachmentStoreOp(&val->storeOp);
25     size += vn_sizeof_VkAttachmentLoadOp(&val->stencilLoadOp);
26     size += vn_sizeof_VkAttachmentStoreOp(&val->stencilStoreOp);
27     size += vn_sizeof_VkImageLayout(&val->initialLayout);
28     size += vn_sizeof_VkImageLayout(&val->finalLayout);
29     return size;
30 }
31 
32 static inline void
vn_encode_VkAttachmentDescription(struct vn_cs_encoder * enc,const VkAttachmentDescription * val)33 vn_encode_VkAttachmentDescription(struct vn_cs_encoder *enc, const VkAttachmentDescription *val)
34 {
35     vn_encode_VkFlags(enc, &val->flags);
36     vn_encode_VkFormat(enc, &val->format);
37     vn_encode_VkSampleCountFlagBits(enc, &val->samples);
38     vn_encode_VkAttachmentLoadOp(enc, &val->loadOp);
39     vn_encode_VkAttachmentStoreOp(enc, &val->storeOp);
40     vn_encode_VkAttachmentLoadOp(enc, &val->stencilLoadOp);
41     vn_encode_VkAttachmentStoreOp(enc, &val->stencilStoreOp);
42     vn_encode_VkImageLayout(enc, &val->initialLayout);
43     vn_encode_VkImageLayout(enc, &val->finalLayout);
44 }
45 
46 /* struct VkAttachmentReference */
47 
48 static inline size_t
vn_sizeof_VkAttachmentReference(const VkAttachmentReference * val)49 vn_sizeof_VkAttachmentReference(const VkAttachmentReference *val)
50 {
51     size_t size = 0;
52     size += vn_sizeof_uint32_t(&val->attachment);
53     size += vn_sizeof_VkImageLayout(&val->layout);
54     return size;
55 }
56 
57 static inline void
vn_encode_VkAttachmentReference(struct vn_cs_encoder * enc,const VkAttachmentReference * val)58 vn_encode_VkAttachmentReference(struct vn_cs_encoder *enc, const VkAttachmentReference *val)
59 {
60     vn_encode_uint32_t(enc, &val->attachment);
61     vn_encode_VkImageLayout(enc, &val->layout);
62 }
63 
64 /* struct VkSubpassDescription */
65 
66 static inline size_t
vn_sizeof_VkSubpassDescription(const VkSubpassDescription * val)67 vn_sizeof_VkSubpassDescription(const VkSubpassDescription *val)
68 {
69     size_t size = 0;
70     size += vn_sizeof_VkFlags(&val->flags);
71     size += vn_sizeof_VkPipelineBindPoint(&val->pipelineBindPoint);
72     size += vn_sizeof_uint32_t(&val->inputAttachmentCount);
73     if (val->pInputAttachments) {
74         size += vn_sizeof_array_size(val->inputAttachmentCount);
75         for (uint32_t i = 0; i < val->inputAttachmentCount; i++)
76             size += vn_sizeof_VkAttachmentReference(&val->pInputAttachments[i]);
77     } else {
78         size += vn_sizeof_array_size(0);
79     }
80     size += vn_sizeof_uint32_t(&val->colorAttachmentCount);
81     if (val->pColorAttachments) {
82         size += vn_sizeof_array_size(val->colorAttachmentCount);
83         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
84             size += vn_sizeof_VkAttachmentReference(&val->pColorAttachments[i]);
85     } else {
86         size += vn_sizeof_array_size(0);
87     }
88     if (val->pResolveAttachments) {
89         size += vn_sizeof_array_size(val->colorAttachmentCount);
90         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
91             size += vn_sizeof_VkAttachmentReference(&val->pResolveAttachments[i]);
92     } else {
93         size += vn_sizeof_array_size(0);
94     }
95     size += vn_sizeof_simple_pointer(val->pDepthStencilAttachment);
96     if (val->pDepthStencilAttachment)
97         size += vn_sizeof_VkAttachmentReference(val->pDepthStencilAttachment);
98     size += vn_sizeof_uint32_t(&val->preserveAttachmentCount);
99     if (val->pPreserveAttachments) {
100         size += vn_sizeof_array_size(val->preserveAttachmentCount);
101         size += vn_sizeof_uint32_t_array(val->pPreserveAttachments, val->preserveAttachmentCount);
102     } else {
103         size += vn_sizeof_array_size(0);
104     }
105     return size;
106 }
107 
108 static inline void
vn_encode_VkSubpassDescription(struct vn_cs_encoder * enc,const VkSubpassDescription * val)109 vn_encode_VkSubpassDescription(struct vn_cs_encoder *enc, const VkSubpassDescription *val)
110 {
111     vn_encode_VkFlags(enc, &val->flags);
112     vn_encode_VkPipelineBindPoint(enc, &val->pipelineBindPoint);
113     vn_encode_uint32_t(enc, &val->inputAttachmentCount);
114     if (val->pInputAttachments) {
115         vn_encode_array_size(enc, val->inputAttachmentCount);
116         for (uint32_t i = 0; i < val->inputAttachmentCount; i++)
117             vn_encode_VkAttachmentReference(enc, &val->pInputAttachments[i]);
118     } else {
119         vn_encode_array_size(enc, 0);
120     }
121     vn_encode_uint32_t(enc, &val->colorAttachmentCount);
122     if (val->pColorAttachments) {
123         vn_encode_array_size(enc, val->colorAttachmentCount);
124         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
125             vn_encode_VkAttachmentReference(enc, &val->pColorAttachments[i]);
126     } else {
127         vn_encode_array_size(enc, 0);
128     }
129     if (val->pResolveAttachments) {
130         vn_encode_array_size(enc, val->colorAttachmentCount);
131         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
132             vn_encode_VkAttachmentReference(enc, &val->pResolveAttachments[i]);
133     } else {
134         vn_encode_array_size(enc, 0);
135     }
136     if (vn_encode_simple_pointer(enc, val->pDepthStencilAttachment))
137         vn_encode_VkAttachmentReference(enc, val->pDepthStencilAttachment);
138     vn_encode_uint32_t(enc, &val->preserveAttachmentCount);
139     if (val->pPreserveAttachments) {
140         vn_encode_array_size(enc, val->preserveAttachmentCount);
141         vn_encode_uint32_t_array(enc, val->pPreserveAttachments, val->preserveAttachmentCount);
142     } else {
143         vn_encode_array_size(enc, 0);
144     }
145 }
146 
147 /* struct VkSubpassDependency */
148 
149 static inline size_t
vn_sizeof_VkSubpassDependency(const VkSubpassDependency * val)150 vn_sizeof_VkSubpassDependency(const VkSubpassDependency *val)
151 {
152     size_t size = 0;
153     size += vn_sizeof_uint32_t(&val->srcSubpass);
154     size += vn_sizeof_uint32_t(&val->dstSubpass);
155     size += vn_sizeof_VkFlags(&val->srcStageMask);
156     size += vn_sizeof_VkFlags(&val->dstStageMask);
157     size += vn_sizeof_VkFlags(&val->srcAccessMask);
158     size += vn_sizeof_VkFlags(&val->dstAccessMask);
159     size += vn_sizeof_VkFlags(&val->dependencyFlags);
160     return size;
161 }
162 
163 static inline void
vn_encode_VkSubpassDependency(struct vn_cs_encoder * enc,const VkSubpassDependency * val)164 vn_encode_VkSubpassDependency(struct vn_cs_encoder *enc, const VkSubpassDependency *val)
165 {
166     vn_encode_uint32_t(enc, &val->srcSubpass);
167     vn_encode_uint32_t(enc, &val->dstSubpass);
168     vn_encode_VkFlags(enc, &val->srcStageMask);
169     vn_encode_VkFlags(enc, &val->dstStageMask);
170     vn_encode_VkFlags(enc, &val->srcAccessMask);
171     vn_encode_VkFlags(enc, &val->dstAccessMask);
172     vn_encode_VkFlags(enc, &val->dependencyFlags);
173 }
174 
175 /* struct VkRenderPassMultiviewCreateInfo chain */
176 
177 static inline size_t
vn_sizeof_VkRenderPassMultiviewCreateInfo_pnext(const void * val)178 vn_sizeof_VkRenderPassMultiviewCreateInfo_pnext(const void *val)
179 {
180     /* no known/supported struct */
181     return vn_sizeof_simple_pointer(NULL);
182 }
183 
184 static inline size_t
vn_sizeof_VkRenderPassMultiviewCreateInfo_self(const VkRenderPassMultiviewCreateInfo * val)185 vn_sizeof_VkRenderPassMultiviewCreateInfo_self(const VkRenderPassMultiviewCreateInfo *val)
186 {
187     size_t size = 0;
188     /* skip val->{sType,pNext} */
189     size += vn_sizeof_uint32_t(&val->subpassCount);
190     if (val->pViewMasks) {
191         size += vn_sizeof_array_size(val->subpassCount);
192         size += vn_sizeof_uint32_t_array(val->pViewMasks, val->subpassCount);
193     } else {
194         size += vn_sizeof_array_size(0);
195     }
196     size += vn_sizeof_uint32_t(&val->dependencyCount);
197     if (val->pViewOffsets) {
198         size += vn_sizeof_array_size(val->dependencyCount);
199         size += vn_sizeof_int32_t_array(val->pViewOffsets, val->dependencyCount);
200     } else {
201         size += vn_sizeof_array_size(0);
202     }
203     size += vn_sizeof_uint32_t(&val->correlationMaskCount);
204     if (val->pCorrelationMasks) {
205         size += vn_sizeof_array_size(val->correlationMaskCount);
206         size += vn_sizeof_uint32_t_array(val->pCorrelationMasks, val->correlationMaskCount);
207     } else {
208         size += vn_sizeof_array_size(0);
209     }
210     return size;
211 }
212 
213 static inline size_t
vn_sizeof_VkRenderPassMultiviewCreateInfo(const VkRenderPassMultiviewCreateInfo * val)214 vn_sizeof_VkRenderPassMultiviewCreateInfo(const VkRenderPassMultiviewCreateInfo *val)
215 {
216     size_t size = 0;
217 
218     size += vn_sizeof_VkStructureType(&val->sType);
219     size += vn_sizeof_VkRenderPassMultiviewCreateInfo_pnext(val->pNext);
220     size += vn_sizeof_VkRenderPassMultiviewCreateInfo_self(val);
221 
222     return size;
223 }
224 
225 static inline void
vn_encode_VkRenderPassMultiviewCreateInfo_pnext(struct vn_cs_encoder * enc,const void * val)226 vn_encode_VkRenderPassMultiviewCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
227 {
228     /* no known/supported struct */
229     vn_encode_simple_pointer(enc, NULL);
230 }
231 
232 static inline void
vn_encode_VkRenderPassMultiviewCreateInfo_self(struct vn_cs_encoder * enc,const VkRenderPassMultiviewCreateInfo * val)233 vn_encode_VkRenderPassMultiviewCreateInfo_self(struct vn_cs_encoder *enc, const VkRenderPassMultiviewCreateInfo *val)
234 {
235     /* skip val->{sType,pNext} */
236     vn_encode_uint32_t(enc, &val->subpassCount);
237     if (val->pViewMasks) {
238         vn_encode_array_size(enc, val->subpassCount);
239         vn_encode_uint32_t_array(enc, val->pViewMasks, val->subpassCount);
240     } else {
241         vn_encode_array_size(enc, 0);
242     }
243     vn_encode_uint32_t(enc, &val->dependencyCount);
244     if (val->pViewOffsets) {
245         vn_encode_array_size(enc, val->dependencyCount);
246         vn_encode_int32_t_array(enc, val->pViewOffsets, val->dependencyCount);
247     } else {
248         vn_encode_array_size(enc, 0);
249     }
250     vn_encode_uint32_t(enc, &val->correlationMaskCount);
251     if (val->pCorrelationMasks) {
252         vn_encode_array_size(enc, val->correlationMaskCount);
253         vn_encode_uint32_t_array(enc, val->pCorrelationMasks, val->correlationMaskCount);
254     } else {
255         vn_encode_array_size(enc, 0);
256     }
257 }
258 
259 static inline void
vn_encode_VkRenderPassMultiviewCreateInfo(struct vn_cs_encoder * enc,const VkRenderPassMultiviewCreateInfo * val)260 vn_encode_VkRenderPassMultiviewCreateInfo(struct vn_cs_encoder *enc, const VkRenderPassMultiviewCreateInfo *val)
261 {
262     assert(val->sType == VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO);
263     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO });
264     vn_encode_VkRenderPassMultiviewCreateInfo_pnext(enc, val->pNext);
265     vn_encode_VkRenderPassMultiviewCreateInfo_self(enc, val);
266 }
267 
268 /* struct VkInputAttachmentAspectReference */
269 
270 static inline size_t
vn_sizeof_VkInputAttachmentAspectReference(const VkInputAttachmentAspectReference * val)271 vn_sizeof_VkInputAttachmentAspectReference(const VkInputAttachmentAspectReference *val)
272 {
273     size_t size = 0;
274     size += vn_sizeof_uint32_t(&val->subpass);
275     size += vn_sizeof_uint32_t(&val->inputAttachmentIndex);
276     size += vn_sizeof_VkFlags(&val->aspectMask);
277     return size;
278 }
279 
280 static inline void
vn_encode_VkInputAttachmentAspectReference(struct vn_cs_encoder * enc,const VkInputAttachmentAspectReference * val)281 vn_encode_VkInputAttachmentAspectReference(struct vn_cs_encoder *enc, const VkInputAttachmentAspectReference *val)
282 {
283     vn_encode_uint32_t(enc, &val->subpass);
284     vn_encode_uint32_t(enc, &val->inputAttachmentIndex);
285     vn_encode_VkFlags(enc, &val->aspectMask);
286 }
287 
288 /* struct VkRenderPassInputAttachmentAspectCreateInfo chain */
289 
290 static inline size_t
vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_pnext(const void * val)291 vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_pnext(const void *val)
292 {
293     /* no known/supported struct */
294     return vn_sizeof_simple_pointer(NULL);
295 }
296 
297 static inline size_t
vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_self(const VkRenderPassInputAttachmentAspectCreateInfo * val)298 vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_self(const VkRenderPassInputAttachmentAspectCreateInfo *val)
299 {
300     size_t size = 0;
301     /* skip val->{sType,pNext} */
302     size += vn_sizeof_uint32_t(&val->aspectReferenceCount);
303     if (val->pAspectReferences) {
304         size += vn_sizeof_array_size(val->aspectReferenceCount);
305         for (uint32_t i = 0; i < val->aspectReferenceCount; i++)
306             size += vn_sizeof_VkInputAttachmentAspectReference(&val->pAspectReferences[i]);
307     } else {
308         size += vn_sizeof_array_size(0);
309     }
310     return size;
311 }
312 
313 static inline size_t
vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo(const VkRenderPassInputAttachmentAspectCreateInfo * val)314 vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo(const VkRenderPassInputAttachmentAspectCreateInfo *val)
315 {
316     size_t size = 0;
317 
318     size += vn_sizeof_VkStructureType(&val->sType);
319     size += vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_pnext(val->pNext);
320     size += vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_self(val);
321 
322     return size;
323 }
324 
325 static inline void
vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_pnext(struct vn_cs_encoder * enc,const void * val)326 vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
327 {
328     /* no known/supported struct */
329     vn_encode_simple_pointer(enc, NULL);
330 }
331 
332 static inline void
vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_self(struct vn_cs_encoder * enc,const VkRenderPassInputAttachmentAspectCreateInfo * val)333 vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_self(struct vn_cs_encoder *enc, const VkRenderPassInputAttachmentAspectCreateInfo *val)
334 {
335     /* skip val->{sType,pNext} */
336     vn_encode_uint32_t(enc, &val->aspectReferenceCount);
337     if (val->pAspectReferences) {
338         vn_encode_array_size(enc, val->aspectReferenceCount);
339         for (uint32_t i = 0; i < val->aspectReferenceCount; i++)
340             vn_encode_VkInputAttachmentAspectReference(enc, &val->pAspectReferences[i]);
341     } else {
342         vn_encode_array_size(enc, 0);
343     }
344 }
345 
346 static inline void
vn_encode_VkRenderPassInputAttachmentAspectCreateInfo(struct vn_cs_encoder * enc,const VkRenderPassInputAttachmentAspectCreateInfo * val)347 vn_encode_VkRenderPassInputAttachmentAspectCreateInfo(struct vn_cs_encoder *enc, const VkRenderPassInputAttachmentAspectCreateInfo *val)
348 {
349     assert(val->sType == VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO);
350     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO });
351     vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_pnext(enc, val->pNext);
352     vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_self(enc, val);
353 }
354 
355 /* struct VkRenderPassCreateInfo chain */
356 
357 static inline size_t
vn_sizeof_VkRenderPassCreateInfo_pnext(const void * val)358 vn_sizeof_VkRenderPassCreateInfo_pnext(const void *val)
359 {
360     const VkBaseInStructure *pnext = val;
361     size_t size = 0;
362 
363     while (pnext) {
364         switch ((int32_t)pnext->sType) {
365         case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO:
366             size += vn_sizeof_simple_pointer(pnext);
367             size += vn_sizeof_VkStructureType(&pnext->sType);
368             size += vn_sizeof_VkRenderPassCreateInfo_pnext(pnext->pNext);
369             size += vn_sizeof_VkRenderPassMultiviewCreateInfo_self((const VkRenderPassMultiviewCreateInfo *)pnext);
370             return size;
371         case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO:
372             size += vn_sizeof_simple_pointer(pnext);
373             size += vn_sizeof_VkStructureType(&pnext->sType);
374             size += vn_sizeof_VkRenderPassCreateInfo_pnext(pnext->pNext);
375             size += vn_sizeof_VkRenderPassInputAttachmentAspectCreateInfo_self((const VkRenderPassInputAttachmentAspectCreateInfo *)pnext);
376             return size;
377         default:
378             /* ignore unknown/unsupported struct */
379             break;
380         }
381         pnext = pnext->pNext;
382     }
383 
384     return vn_sizeof_simple_pointer(NULL);
385 }
386 
387 static inline size_t
vn_sizeof_VkRenderPassCreateInfo_self(const VkRenderPassCreateInfo * val)388 vn_sizeof_VkRenderPassCreateInfo_self(const VkRenderPassCreateInfo *val)
389 {
390     size_t size = 0;
391     /* skip val->{sType,pNext} */
392     size += vn_sizeof_VkFlags(&val->flags);
393     size += vn_sizeof_uint32_t(&val->attachmentCount);
394     if (val->pAttachments) {
395         size += vn_sizeof_array_size(val->attachmentCount);
396         for (uint32_t i = 0; i < val->attachmentCount; i++)
397             size += vn_sizeof_VkAttachmentDescription(&val->pAttachments[i]);
398     } else {
399         size += vn_sizeof_array_size(0);
400     }
401     size += vn_sizeof_uint32_t(&val->subpassCount);
402     if (val->pSubpasses) {
403         size += vn_sizeof_array_size(val->subpassCount);
404         for (uint32_t i = 0; i < val->subpassCount; i++)
405             size += vn_sizeof_VkSubpassDescription(&val->pSubpasses[i]);
406     } else {
407         size += vn_sizeof_array_size(0);
408     }
409     size += vn_sizeof_uint32_t(&val->dependencyCount);
410     if (val->pDependencies) {
411         size += vn_sizeof_array_size(val->dependencyCount);
412         for (uint32_t i = 0; i < val->dependencyCount; i++)
413             size += vn_sizeof_VkSubpassDependency(&val->pDependencies[i]);
414     } else {
415         size += vn_sizeof_array_size(0);
416     }
417     return size;
418 }
419 
420 static inline size_t
vn_sizeof_VkRenderPassCreateInfo(const VkRenderPassCreateInfo * val)421 vn_sizeof_VkRenderPassCreateInfo(const VkRenderPassCreateInfo *val)
422 {
423     size_t size = 0;
424 
425     size += vn_sizeof_VkStructureType(&val->sType);
426     size += vn_sizeof_VkRenderPassCreateInfo_pnext(val->pNext);
427     size += vn_sizeof_VkRenderPassCreateInfo_self(val);
428 
429     return size;
430 }
431 
432 static inline void
vn_encode_VkRenderPassCreateInfo_pnext(struct vn_cs_encoder * enc,const void * val)433 vn_encode_VkRenderPassCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
434 {
435     const VkBaseInStructure *pnext = val;
436 
437     while (pnext) {
438         switch ((int32_t)pnext->sType) {
439         case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO:
440             vn_encode_simple_pointer(enc, pnext);
441             vn_encode_VkStructureType(enc, &pnext->sType);
442             vn_encode_VkRenderPassCreateInfo_pnext(enc, pnext->pNext);
443             vn_encode_VkRenderPassMultiviewCreateInfo_self(enc, (const VkRenderPassMultiviewCreateInfo *)pnext);
444             return;
445         case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO:
446             vn_encode_simple_pointer(enc, pnext);
447             vn_encode_VkStructureType(enc, &pnext->sType);
448             vn_encode_VkRenderPassCreateInfo_pnext(enc, pnext->pNext);
449             vn_encode_VkRenderPassInputAttachmentAspectCreateInfo_self(enc, (const VkRenderPassInputAttachmentAspectCreateInfo *)pnext);
450             return;
451         default:
452             /* ignore unknown/unsupported struct */
453             break;
454         }
455         pnext = pnext->pNext;
456     }
457 
458     vn_encode_simple_pointer(enc, NULL);
459 }
460 
461 static inline void
vn_encode_VkRenderPassCreateInfo_self(struct vn_cs_encoder * enc,const VkRenderPassCreateInfo * val)462 vn_encode_VkRenderPassCreateInfo_self(struct vn_cs_encoder *enc, const VkRenderPassCreateInfo *val)
463 {
464     /* skip val->{sType,pNext} */
465     vn_encode_VkFlags(enc, &val->flags);
466     vn_encode_uint32_t(enc, &val->attachmentCount);
467     if (val->pAttachments) {
468         vn_encode_array_size(enc, val->attachmentCount);
469         for (uint32_t i = 0; i < val->attachmentCount; i++)
470             vn_encode_VkAttachmentDescription(enc, &val->pAttachments[i]);
471     } else {
472         vn_encode_array_size(enc, 0);
473     }
474     vn_encode_uint32_t(enc, &val->subpassCount);
475     if (val->pSubpasses) {
476         vn_encode_array_size(enc, val->subpassCount);
477         for (uint32_t i = 0; i < val->subpassCount; i++)
478             vn_encode_VkSubpassDescription(enc, &val->pSubpasses[i]);
479     } else {
480         vn_encode_array_size(enc, 0);
481     }
482     vn_encode_uint32_t(enc, &val->dependencyCount);
483     if (val->pDependencies) {
484         vn_encode_array_size(enc, val->dependencyCount);
485         for (uint32_t i = 0; i < val->dependencyCount; i++)
486             vn_encode_VkSubpassDependency(enc, &val->pDependencies[i]);
487     } else {
488         vn_encode_array_size(enc, 0);
489     }
490 }
491 
492 static inline void
vn_encode_VkRenderPassCreateInfo(struct vn_cs_encoder * enc,const VkRenderPassCreateInfo * val)493 vn_encode_VkRenderPassCreateInfo(struct vn_cs_encoder *enc, const VkRenderPassCreateInfo *val)
494 {
495     assert(val->sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO);
496     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO });
497     vn_encode_VkRenderPassCreateInfo_pnext(enc, val->pNext);
498     vn_encode_VkRenderPassCreateInfo_self(enc, val);
499 }
500 
501 /* struct VkAttachmentDescriptionStencilLayout chain */
502 
503 static inline size_t
vn_sizeof_VkAttachmentDescriptionStencilLayout_pnext(const void * val)504 vn_sizeof_VkAttachmentDescriptionStencilLayout_pnext(const void *val)
505 {
506     /* no known/supported struct */
507     return vn_sizeof_simple_pointer(NULL);
508 }
509 
510 static inline size_t
vn_sizeof_VkAttachmentDescriptionStencilLayout_self(const VkAttachmentDescriptionStencilLayout * val)511 vn_sizeof_VkAttachmentDescriptionStencilLayout_self(const VkAttachmentDescriptionStencilLayout *val)
512 {
513     size_t size = 0;
514     /* skip val->{sType,pNext} */
515     size += vn_sizeof_VkImageLayout(&val->stencilInitialLayout);
516     size += vn_sizeof_VkImageLayout(&val->stencilFinalLayout);
517     return size;
518 }
519 
520 static inline size_t
vn_sizeof_VkAttachmentDescriptionStencilLayout(const VkAttachmentDescriptionStencilLayout * val)521 vn_sizeof_VkAttachmentDescriptionStencilLayout(const VkAttachmentDescriptionStencilLayout *val)
522 {
523     size_t size = 0;
524 
525     size += vn_sizeof_VkStructureType(&val->sType);
526     size += vn_sizeof_VkAttachmentDescriptionStencilLayout_pnext(val->pNext);
527     size += vn_sizeof_VkAttachmentDescriptionStencilLayout_self(val);
528 
529     return size;
530 }
531 
532 static inline void
vn_encode_VkAttachmentDescriptionStencilLayout_pnext(struct vn_cs_encoder * enc,const void * val)533 vn_encode_VkAttachmentDescriptionStencilLayout_pnext(struct vn_cs_encoder *enc, const void *val)
534 {
535     /* no known/supported struct */
536     vn_encode_simple_pointer(enc, NULL);
537 }
538 
539 static inline void
vn_encode_VkAttachmentDescriptionStencilLayout_self(struct vn_cs_encoder * enc,const VkAttachmentDescriptionStencilLayout * val)540 vn_encode_VkAttachmentDescriptionStencilLayout_self(struct vn_cs_encoder *enc, const VkAttachmentDescriptionStencilLayout *val)
541 {
542     /* skip val->{sType,pNext} */
543     vn_encode_VkImageLayout(enc, &val->stencilInitialLayout);
544     vn_encode_VkImageLayout(enc, &val->stencilFinalLayout);
545 }
546 
547 static inline void
vn_encode_VkAttachmentDescriptionStencilLayout(struct vn_cs_encoder * enc,const VkAttachmentDescriptionStencilLayout * val)548 vn_encode_VkAttachmentDescriptionStencilLayout(struct vn_cs_encoder *enc, const VkAttachmentDescriptionStencilLayout *val)
549 {
550     assert(val->sType == VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT);
551     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT });
552     vn_encode_VkAttachmentDescriptionStencilLayout_pnext(enc, val->pNext);
553     vn_encode_VkAttachmentDescriptionStencilLayout_self(enc, val);
554 }
555 
556 /* struct VkAttachmentDescription2 chain */
557 
558 static inline size_t
vn_sizeof_VkAttachmentDescription2_pnext(const void * val)559 vn_sizeof_VkAttachmentDescription2_pnext(const void *val)
560 {
561     const VkBaseInStructure *pnext = val;
562     size_t size = 0;
563 
564     while (pnext) {
565         switch ((int32_t)pnext->sType) {
566         case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT:
567             size += vn_sizeof_simple_pointer(pnext);
568             size += vn_sizeof_VkStructureType(&pnext->sType);
569             size += vn_sizeof_VkAttachmentDescription2_pnext(pnext->pNext);
570             size += vn_sizeof_VkAttachmentDescriptionStencilLayout_self((const VkAttachmentDescriptionStencilLayout *)pnext);
571             return size;
572         default:
573             /* ignore unknown/unsupported struct */
574             break;
575         }
576         pnext = pnext->pNext;
577     }
578 
579     return vn_sizeof_simple_pointer(NULL);
580 }
581 
582 static inline size_t
vn_sizeof_VkAttachmentDescription2_self(const VkAttachmentDescription2 * val)583 vn_sizeof_VkAttachmentDescription2_self(const VkAttachmentDescription2 *val)
584 {
585     size_t size = 0;
586     /* skip val->{sType,pNext} */
587     size += vn_sizeof_VkFlags(&val->flags);
588     size += vn_sizeof_VkFormat(&val->format);
589     size += vn_sizeof_VkSampleCountFlagBits(&val->samples);
590     size += vn_sizeof_VkAttachmentLoadOp(&val->loadOp);
591     size += vn_sizeof_VkAttachmentStoreOp(&val->storeOp);
592     size += vn_sizeof_VkAttachmentLoadOp(&val->stencilLoadOp);
593     size += vn_sizeof_VkAttachmentStoreOp(&val->stencilStoreOp);
594     size += vn_sizeof_VkImageLayout(&val->initialLayout);
595     size += vn_sizeof_VkImageLayout(&val->finalLayout);
596     return size;
597 }
598 
599 static inline size_t
vn_sizeof_VkAttachmentDescription2(const VkAttachmentDescription2 * val)600 vn_sizeof_VkAttachmentDescription2(const VkAttachmentDescription2 *val)
601 {
602     size_t size = 0;
603 
604     size += vn_sizeof_VkStructureType(&val->sType);
605     size += vn_sizeof_VkAttachmentDescription2_pnext(val->pNext);
606     size += vn_sizeof_VkAttachmentDescription2_self(val);
607 
608     return size;
609 }
610 
611 static inline void
vn_encode_VkAttachmentDescription2_pnext(struct vn_cs_encoder * enc,const void * val)612 vn_encode_VkAttachmentDescription2_pnext(struct vn_cs_encoder *enc, const void *val)
613 {
614     const VkBaseInStructure *pnext = val;
615 
616     while (pnext) {
617         switch ((int32_t)pnext->sType) {
618         case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT:
619             vn_encode_simple_pointer(enc, pnext);
620             vn_encode_VkStructureType(enc, &pnext->sType);
621             vn_encode_VkAttachmentDescription2_pnext(enc, pnext->pNext);
622             vn_encode_VkAttachmentDescriptionStencilLayout_self(enc, (const VkAttachmentDescriptionStencilLayout *)pnext);
623             return;
624         default:
625             /* ignore unknown/unsupported struct */
626             break;
627         }
628         pnext = pnext->pNext;
629     }
630 
631     vn_encode_simple_pointer(enc, NULL);
632 }
633 
634 static inline void
vn_encode_VkAttachmentDescription2_self(struct vn_cs_encoder * enc,const VkAttachmentDescription2 * val)635 vn_encode_VkAttachmentDescription2_self(struct vn_cs_encoder *enc, const VkAttachmentDescription2 *val)
636 {
637     /* skip val->{sType,pNext} */
638     vn_encode_VkFlags(enc, &val->flags);
639     vn_encode_VkFormat(enc, &val->format);
640     vn_encode_VkSampleCountFlagBits(enc, &val->samples);
641     vn_encode_VkAttachmentLoadOp(enc, &val->loadOp);
642     vn_encode_VkAttachmentStoreOp(enc, &val->storeOp);
643     vn_encode_VkAttachmentLoadOp(enc, &val->stencilLoadOp);
644     vn_encode_VkAttachmentStoreOp(enc, &val->stencilStoreOp);
645     vn_encode_VkImageLayout(enc, &val->initialLayout);
646     vn_encode_VkImageLayout(enc, &val->finalLayout);
647 }
648 
649 static inline void
vn_encode_VkAttachmentDescription2(struct vn_cs_encoder * enc,const VkAttachmentDescription2 * val)650 vn_encode_VkAttachmentDescription2(struct vn_cs_encoder *enc, const VkAttachmentDescription2 *val)
651 {
652     assert(val->sType == VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2);
653     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 });
654     vn_encode_VkAttachmentDescription2_pnext(enc, val->pNext);
655     vn_encode_VkAttachmentDescription2_self(enc, val);
656 }
657 
658 /* struct VkAttachmentReferenceStencilLayout chain */
659 
660 static inline size_t
vn_sizeof_VkAttachmentReferenceStencilLayout_pnext(const void * val)661 vn_sizeof_VkAttachmentReferenceStencilLayout_pnext(const void *val)
662 {
663     /* no known/supported struct */
664     return vn_sizeof_simple_pointer(NULL);
665 }
666 
667 static inline size_t
vn_sizeof_VkAttachmentReferenceStencilLayout_self(const VkAttachmentReferenceStencilLayout * val)668 vn_sizeof_VkAttachmentReferenceStencilLayout_self(const VkAttachmentReferenceStencilLayout *val)
669 {
670     size_t size = 0;
671     /* skip val->{sType,pNext} */
672     size += vn_sizeof_VkImageLayout(&val->stencilLayout);
673     return size;
674 }
675 
676 static inline size_t
vn_sizeof_VkAttachmentReferenceStencilLayout(const VkAttachmentReferenceStencilLayout * val)677 vn_sizeof_VkAttachmentReferenceStencilLayout(const VkAttachmentReferenceStencilLayout *val)
678 {
679     size_t size = 0;
680 
681     size += vn_sizeof_VkStructureType(&val->sType);
682     size += vn_sizeof_VkAttachmentReferenceStencilLayout_pnext(val->pNext);
683     size += vn_sizeof_VkAttachmentReferenceStencilLayout_self(val);
684 
685     return size;
686 }
687 
688 static inline void
vn_encode_VkAttachmentReferenceStencilLayout_pnext(struct vn_cs_encoder * enc,const void * val)689 vn_encode_VkAttachmentReferenceStencilLayout_pnext(struct vn_cs_encoder *enc, const void *val)
690 {
691     /* no known/supported struct */
692     vn_encode_simple_pointer(enc, NULL);
693 }
694 
695 static inline void
vn_encode_VkAttachmentReferenceStencilLayout_self(struct vn_cs_encoder * enc,const VkAttachmentReferenceStencilLayout * val)696 vn_encode_VkAttachmentReferenceStencilLayout_self(struct vn_cs_encoder *enc, const VkAttachmentReferenceStencilLayout *val)
697 {
698     /* skip val->{sType,pNext} */
699     vn_encode_VkImageLayout(enc, &val->stencilLayout);
700 }
701 
702 static inline void
vn_encode_VkAttachmentReferenceStencilLayout(struct vn_cs_encoder * enc,const VkAttachmentReferenceStencilLayout * val)703 vn_encode_VkAttachmentReferenceStencilLayout(struct vn_cs_encoder *enc, const VkAttachmentReferenceStencilLayout *val)
704 {
705     assert(val->sType == VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT);
706     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT });
707     vn_encode_VkAttachmentReferenceStencilLayout_pnext(enc, val->pNext);
708     vn_encode_VkAttachmentReferenceStencilLayout_self(enc, val);
709 }
710 
711 /* struct VkAttachmentReference2 chain */
712 
713 static inline size_t
vn_sizeof_VkAttachmentReference2_pnext(const void * val)714 vn_sizeof_VkAttachmentReference2_pnext(const void *val)
715 {
716     const VkBaseInStructure *pnext = val;
717     size_t size = 0;
718 
719     while (pnext) {
720         switch ((int32_t)pnext->sType) {
721         case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT:
722             size += vn_sizeof_simple_pointer(pnext);
723             size += vn_sizeof_VkStructureType(&pnext->sType);
724             size += vn_sizeof_VkAttachmentReference2_pnext(pnext->pNext);
725             size += vn_sizeof_VkAttachmentReferenceStencilLayout_self((const VkAttachmentReferenceStencilLayout *)pnext);
726             return size;
727         default:
728             /* ignore unknown/unsupported struct */
729             break;
730         }
731         pnext = pnext->pNext;
732     }
733 
734     return vn_sizeof_simple_pointer(NULL);
735 }
736 
737 static inline size_t
vn_sizeof_VkAttachmentReference2_self(const VkAttachmentReference2 * val)738 vn_sizeof_VkAttachmentReference2_self(const VkAttachmentReference2 *val)
739 {
740     size_t size = 0;
741     /* skip val->{sType,pNext} */
742     size += vn_sizeof_uint32_t(&val->attachment);
743     size += vn_sizeof_VkImageLayout(&val->layout);
744     size += vn_sizeof_VkFlags(&val->aspectMask);
745     return size;
746 }
747 
748 static inline size_t
vn_sizeof_VkAttachmentReference2(const VkAttachmentReference2 * val)749 vn_sizeof_VkAttachmentReference2(const VkAttachmentReference2 *val)
750 {
751     size_t size = 0;
752 
753     size += vn_sizeof_VkStructureType(&val->sType);
754     size += vn_sizeof_VkAttachmentReference2_pnext(val->pNext);
755     size += vn_sizeof_VkAttachmentReference2_self(val);
756 
757     return size;
758 }
759 
760 static inline void
vn_encode_VkAttachmentReference2_pnext(struct vn_cs_encoder * enc,const void * val)761 vn_encode_VkAttachmentReference2_pnext(struct vn_cs_encoder *enc, const void *val)
762 {
763     const VkBaseInStructure *pnext = val;
764 
765     while (pnext) {
766         switch ((int32_t)pnext->sType) {
767         case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT:
768             vn_encode_simple_pointer(enc, pnext);
769             vn_encode_VkStructureType(enc, &pnext->sType);
770             vn_encode_VkAttachmentReference2_pnext(enc, pnext->pNext);
771             vn_encode_VkAttachmentReferenceStencilLayout_self(enc, (const VkAttachmentReferenceStencilLayout *)pnext);
772             return;
773         default:
774             /* ignore unknown/unsupported struct */
775             break;
776         }
777         pnext = pnext->pNext;
778     }
779 
780     vn_encode_simple_pointer(enc, NULL);
781 }
782 
783 static inline void
vn_encode_VkAttachmentReference2_self(struct vn_cs_encoder * enc,const VkAttachmentReference2 * val)784 vn_encode_VkAttachmentReference2_self(struct vn_cs_encoder *enc, const VkAttachmentReference2 *val)
785 {
786     /* skip val->{sType,pNext} */
787     vn_encode_uint32_t(enc, &val->attachment);
788     vn_encode_VkImageLayout(enc, &val->layout);
789     vn_encode_VkFlags(enc, &val->aspectMask);
790 }
791 
792 static inline void
vn_encode_VkAttachmentReference2(struct vn_cs_encoder * enc,const VkAttachmentReference2 * val)793 vn_encode_VkAttachmentReference2(struct vn_cs_encoder *enc, const VkAttachmentReference2 *val)
794 {
795     assert(val->sType == VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2);
796     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 });
797     vn_encode_VkAttachmentReference2_pnext(enc, val->pNext);
798     vn_encode_VkAttachmentReference2_self(enc, val);
799 }
800 
801 /* struct VkSubpassDescriptionDepthStencilResolve chain */
802 
803 static inline size_t
vn_sizeof_VkSubpassDescriptionDepthStencilResolve_pnext(const void * val)804 vn_sizeof_VkSubpassDescriptionDepthStencilResolve_pnext(const void *val)
805 {
806     /* no known/supported struct */
807     return vn_sizeof_simple_pointer(NULL);
808 }
809 
810 static inline size_t
vn_sizeof_VkSubpassDescriptionDepthStencilResolve_self(const VkSubpassDescriptionDepthStencilResolve * val)811 vn_sizeof_VkSubpassDescriptionDepthStencilResolve_self(const VkSubpassDescriptionDepthStencilResolve *val)
812 {
813     size_t size = 0;
814     /* skip val->{sType,pNext} */
815     size += vn_sizeof_VkResolveModeFlagBits(&val->depthResolveMode);
816     size += vn_sizeof_VkResolveModeFlagBits(&val->stencilResolveMode);
817     size += vn_sizeof_simple_pointer(val->pDepthStencilResolveAttachment);
818     if (val->pDepthStencilResolveAttachment)
819         size += vn_sizeof_VkAttachmentReference2(val->pDepthStencilResolveAttachment);
820     return size;
821 }
822 
823 static inline size_t
vn_sizeof_VkSubpassDescriptionDepthStencilResolve(const VkSubpassDescriptionDepthStencilResolve * val)824 vn_sizeof_VkSubpassDescriptionDepthStencilResolve(const VkSubpassDescriptionDepthStencilResolve *val)
825 {
826     size_t size = 0;
827 
828     size += vn_sizeof_VkStructureType(&val->sType);
829     size += vn_sizeof_VkSubpassDescriptionDepthStencilResolve_pnext(val->pNext);
830     size += vn_sizeof_VkSubpassDescriptionDepthStencilResolve_self(val);
831 
832     return size;
833 }
834 
835 static inline void
vn_encode_VkSubpassDescriptionDepthStencilResolve_pnext(struct vn_cs_encoder * enc,const void * val)836 vn_encode_VkSubpassDescriptionDepthStencilResolve_pnext(struct vn_cs_encoder *enc, const void *val)
837 {
838     /* no known/supported struct */
839     vn_encode_simple_pointer(enc, NULL);
840 }
841 
842 static inline void
vn_encode_VkSubpassDescriptionDepthStencilResolve_self(struct vn_cs_encoder * enc,const VkSubpassDescriptionDepthStencilResolve * val)843 vn_encode_VkSubpassDescriptionDepthStencilResolve_self(struct vn_cs_encoder *enc, const VkSubpassDescriptionDepthStencilResolve *val)
844 {
845     /* skip val->{sType,pNext} */
846     vn_encode_VkResolveModeFlagBits(enc, &val->depthResolveMode);
847     vn_encode_VkResolveModeFlagBits(enc, &val->stencilResolveMode);
848     if (vn_encode_simple_pointer(enc, val->pDepthStencilResolveAttachment))
849         vn_encode_VkAttachmentReference2(enc, val->pDepthStencilResolveAttachment);
850 }
851 
852 static inline void
vn_encode_VkSubpassDescriptionDepthStencilResolve(struct vn_cs_encoder * enc,const VkSubpassDescriptionDepthStencilResolve * val)853 vn_encode_VkSubpassDescriptionDepthStencilResolve(struct vn_cs_encoder *enc, const VkSubpassDescriptionDepthStencilResolve *val)
854 {
855     assert(val->sType == VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);
856     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE });
857     vn_encode_VkSubpassDescriptionDepthStencilResolve_pnext(enc, val->pNext);
858     vn_encode_VkSubpassDescriptionDepthStencilResolve_self(enc, val);
859 }
860 
861 /* struct VkSubpassDescription2 chain */
862 
863 static inline size_t
vn_sizeof_VkSubpassDescription2_pnext(const void * val)864 vn_sizeof_VkSubpassDescription2_pnext(const void *val)
865 {
866     const VkBaseInStructure *pnext = val;
867     size_t size = 0;
868 
869     while (pnext) {
870         switch ((int32_t)pnext->sType) {
871         case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE:
872             size += vn_sizeof_simple_pointer(pnext);
873             size += vn_sizeof_VkStructureType(&pnext->sType);
874             size += vn_sizeof_VkSubpassDescription2_pnext(pnext->pNext);
875             size += vn_sizeof_VkSubpassDescriptionDepthStencilResolve_self((const VkSubpassDescriptionDepthStencilResolve *)pnext);
876             return size;
877         default:
878             /* ignore unknown/unsupported struct */
879             break;
880         }
881         pnext = pnext->pNext;
882     }
883 
884     return vn_sizeof_simple_pointer(NULL);
885 }
886 
887 static inline size_t
vn_sizeof_VkSubpassDescription2_self(const VkSubpassDescription2 * val)888 vn_sizeof_VkSubpassDescription2_self(const VkSubpassDescription2 *val)
889 {
890     size_t size = 0;
891     /* skip val->{sType,pNext} */
892     size += vn_sizeof_VkFlags(&val->flags);
893     size += vn_sizeof_VkPipelineBindPoint(&val->pipelineBindPoint);
894     size += vn_sizeof_uint32_t(&val->viewMask);
895     size += vn_sizeof_uint32_t(&val->inputAttachmentCount);
896     if (val->pInputAttachments) {
897         size += vn_sizeof_array_size(val->inputAttachmentCount);
898         for (uint32_t i = 0; i < val->inputAttachmentCount; i++)
899             size += vn_sizeof_VkAttachmentReference2(&val->pInputAttachments[i]);
900     } else {
901         size += vn_sizeof_array_size(0);
902     }
903     size += vn_sizeof_uint32_t(&val->colorAttachmentCount);
904     if (val->pColorAttachments) {
905         size += vn_sizeof_array_size(val->colorAttachmentCount);
906         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
907             size += vn_sizeof_VkAttachmentReference2(&val->pColorAttachments[i]);
908     } else {
909         size += vn_sizeof_array_size(0);
910     }
911     if (val->pResolveAttachments) {
912         size += vn_sizeof_array_size(val->colorAttachmentCount);
913         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
914             size += vn_sizeof_VkAttachmentReference2(&val->pResolveAttachments[i]);
915     } else {
916         size += vn_sizeof_array_size(0);
917     }
918     size += vn_sizeof_simple_pointer(val->pDepthStencilAttachment);
919     if (val->pDepthStencilAttachment)
920         size += vn_sizeof_VkAttachmentReference2(val->pDepthStencilAttachment);
921     size += vn_sizeof_uint32_t(&val->preserveAttachmentCount);
922     if (val->pPreserveAttachments) {
923         size += vn_sizeof_array_size(val->preserveAttachmentCount);
924         size += vn_sizeof_uint32_t_array(val->pPreserveAttachments, val->preserveAttachmentCount);
925     } else {
926         size += vn_sizeof_array_size(0);
927     }
928     return size;
929 }
930 
931 static inline size_t
vn_sizeof_VkSubpassDescription2(const VkSubpassDescription2 * val)932 vn_sizeof_VkSubpassDescription2(const VkSubpassDescription2 *val)
933 {
934     size_t size = 0;
935 
936     size += vn_sizeof_VkStructureType(&val->sType);
937     size += vn_sizeof_VkSubpassDescription2_pnext(val->pNext);
938     size += vn_sizeof_VkSubpassDescription2_self(val);
939 
940     return size;
941 }
942 
943 static inline void
vn_encode_VkSubpassDescription2_pnext(struct vn_cs_encoder * enc,const void * val)944 vn_encode_VkSubpassDescription2_pnext(struct vn_cs_encoder *enc, const void *val)
945 {
946     const VkBaseInStructure *pnext = val;
947 
948     while (pnext) {
949         switch ((int32_t)pnext->sType) {
950         case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE:
951             vn_encode_simple_pointer(enc, pnext);
952             vn_encode_VkStructureType(enc, &pnext->sType);
953             vn_encode_VkSubpassDescription2_pnext(enc, pnext->pNext);
954             vn_encode_VkSubpassDescriptionDepthStencilResolve_self(enc, (const VkSubpassDescriptionDepthStencilResolve *)pnext);
955             return;
956         default:
957             /* ignore unknown/unsupported struct */
958             break;
959         }
960         pnext = pnext->pNext;
961     }
962 
963     vn_encode_simple_pointer(enc, NULL);
964 }
965 
966 static inline void
vn_encode_VkSubpassDescription2_self(struct vn_cs_encoder * enc,const VkSubpassDescription2 * val)967 vn_encode_VkSubpassDescription2_self(struct vn_cs_encoder *enc, const VkSubpassDescription2 *val)
968 {
969     /* skip val->{sType,pNext} */
970     vn_encode_VkFlags(enc, &val->flags);
971     vn_encode_VkPipelineBindPoint(enc, &val->pipelineBindPoint);
972     vn_encode_uint32_t(enc, &val->viewMask);
973     vn_encode_uint32_t(enc, &val->inputAttachmentCount);
974     if (val->pInputAttachments) {
975         vn_encode_array_size(enc, val->inputAttachmentCount);
976         for (uint32_t i = 0; i < val->inputAttachmentCount; i++)
977             vn_encode_VkAttachmentReference2(enc, &val->pInputAttachments[i]);
978     } else {
979         vn_encode_array_size(enc, 0);
980     }
981     vn_encode_uint32_t(enc, &val->colorAttachmentCount);
982     if (val->pColorAttachments) {
983         vn_encode_array_size(enc, val->colorAttachmentCount);
984         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
985             vn_encode_VkAttachmentReference2(enc, &val->pColorAttachments[i]);
986     } else {
987         vn_encode_array_size(enc, 0);
988     }
989     if (val->pResolveAttachments) {
990         vn_encode_array_size(enc, val->colorAttachmentCount);
991         for (uint32_t i = 0; i < val->colorAttachmentCount; i++)
992             vn_encode_VkAttachmentReference2(enc, &val->pResolveAttachments[i]);
993     } else {
994         vn_encode_array_size(enc, 0);
995     }
996     if (vn_encode_simple_pointer(enc, val->pDepthStencilAttachment))
997         vn_encode_VkAttachmentReference2(enc, val->pDepthStencilAttachment);
998     vn_encode_uint32_t(enc, &val->preserveAttachmentCount);
999     if (val->pPreserveAttachments) {
1000         vn_encode_array_size(enc, val->preserveAttachmentCount);
1001         vn_encode_uint32_t_array(enc, val->pPreserveAttachments, val->preserveAttachmentCount);
1002     } else {
1003         vn_encode_array_size(enc, 0);
1004     }
1005 }
1006 
1007 static inline void
vn_encode_VkSubpassDescription2(struct vn_cs_encoder * enc,const VkSubpassDescription2 * val)1008 vn_encode_VkSubpassDescription2(struct vn_cs_encoder *enc, const VkSubpassDescription2 *val)
1009 {
1010     assert(val->sType == VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2);
1011     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 });
1012     vn_encode_VkSubpassDescription2_pnext(enc, val->pNext);
1013     vn_encode_VkSubpassDescription2_self(enc, val);
1014 }
1015 
1016 /* struct VkSubpassDependency2 chain */
1017 
1018 static inline size_t
vn_sizeof_VkSubpassDependency2_pnext(const void * val)1019 vn_sizeof_VkSubpassDependency2_pnext(const void *val)
1020 {
1021     const VkBaseInStructure *pnext = val;
1022     size_t size = 0;
1023 
1024     while (pnext) {
1025         switch ((int32_t)pnext->sType) {
1026         case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2:
1027             if (!vn_cs_renderer_protocol_has_extension(315 /* VK_KHR_synchronization2 */))
1028                 break;
1029             size += vn_sizeof_simple_pointer(pnext);
1030             size += vn_sizeof_VkStructureType(&pnext->sType);
1031             size += vn_sizeof_VkSubpassDependency2_pnext(pnext->pNext);
1032             size += vn_sizeof_VkMemoryBarrier2_self((const VkMemoryBarrier2 *)pnext);
1033             return size;
1034         default:
1035             /* ignore unknown/unsupported struct */
1036             break;
1037         }
1038         pnext = pnext->pNext;
1039     }
1040 
1041     return vn_sizeof_simple_pointer(NULL);
1042 }
1043 
1044 static inline size_t
vn_sizeof_VkSubpassDependency2_self(const VkSubpassDependency2 * val)1045 vn_sizeof_VkSubpassDependency2_self(const VkSubpassDependency2 *val)
1046 {
1047     size_t size = 0;
1048     /* skip val->{sType,pNext} */
1049     size += vn_sizeof_uint32_t(&val->srcSubpass);
1050     size += vn_sizeof_uint32_t(&val->dstSubpass);
1051     size += vn_sizeof_VkFlags(&val->srcStageMask);
1052     size += vn_sizeof_VkFlags(&val->dstStageMask);
1053     size += vn_sizeof_VkFlags(&val->srcAccessMask);
1054     size += vn_sizeof_VkFlags(&val->dstAccessMask);
1055     size += vn_sizeof_VkFlags(&val->dependencyFlags);
1056     size += vn_sizeof_int32_t(&val->viewOffset);
1057     return size;
1058 }
1059 
1060 static inline size_t
vn_sizeof_VkSubpassDependency2(const VkSubpassDependency2 * val)1061 vn_sizeof_VkSubpassDependency2(const VkSubpassDependency2 *val)
1062 {
1063     size_t size = 0;
1064 
1065     size += vn_sizeof_VkStructureType(&val->sType);
1066     size += vn_sizeof_VkSubpassDependency2_pnext(val->pNext);
1067     size += vn_sizeof_VkSubpassDependency2_self(val);
1068 
1069     return size;
1070 }
1071 
1072 static inline void
vn_encode_VkSubpassDependency2_pnext(struct vn_cs_encoder * enc,const void * val)1073 vn_encode_VkSubpassDependency2_pnext(struct vn_cs_encoder *enc, const void *val)
1074 {
1075     const VkBaseInStructure *pnext = val;
1076 
1077     while (pnext) {
1078         switch ((int32_t)pnext->sType) {
1079         case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2:
1080             if (!vn_cs_renderer_protocol_has_extension(315 /* VK_KHR_synchronization2 */))
1081                 break;
1082             vn_encode_simple_pointer(enc, pnext);
1083             vn_encode_VkStructureType(enc, &pnext->sType);
1084             vn_encode_VkSubpassDependency2_pnext(enc, pnext->pNext);
1085             vn_encode_VkMemoryBarrier2_self(enc, (const VkMemoryBarrier2 *)pnext);
1086             return;
1087         default:
1088             /* ignore unknown/unsupported struct */
1089             break;
1090         }
1091         pnext = pnext->pNext;
1092     }
1093 
1094     vn_encode_simple_pointer(enc, NULL);
1095 }
1096 
1097 static inline void
vn_encode_VkSubpassDependency2_self(struct vn_cs_encoder * enc,const VkSubpassDependency2 * val)1098 vn_encode_VkSubpassDependency2_self(struct vn_cs_encoder *enc, const VkSubpassDependency2 *val)
1099 {
1100     /* skip val->{sType,pNext} */
1101     vn_encode_uint32_t(enc, &val->srcSubpass);
1102     vn_encode_uint32_t(enc, &val->dstSubpass);
1103     vn_encode_VkFlags(enc, &val->srcStageMask);
1104     vn_encode_VkFlags(enc, &val->dstStageMask);
1105     vn_encode_VkFlags(enc, &val->srcAccessMask);
1106     vn_encode_VkFlags(enc, &val->dstAccessMask);
1107     vn_encode_VkFlags(enc, &val->dependencyFlags);
1108     vn_encode_int32_t(enc, &val->viewOffset);
1109 }
1110 
1111 static inline void
vn_encode_VkSubpassDependency2(struct vn_cs_encoder * enc,const VkSubpassDependency2 * val)1112 vn_encode_VkSubpassDependency2(struct vn_cs_encoder *enc, const VkSubpassDependency2 *val)
1113 {
1114     assert(val->sType == VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2);
1115     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 });
1116     vn_encode_VkSubpassDependency2_pnext(enc, val->pNext);
1117     vn_encode_VkSubpassDependency2_self(enc, val);
1118 }
1119 
1120 /* struct VkRenderPassCreateInfo2 chain */
1121 
1122 static inline size_t
vn_sizeof_VkRenderPassCreateInfo2_pnext(const void * val)1123 vn_sizeof_VkRenderPassCreateInfo2_pnext(const void *val)
1124 {
1125     /* no known/supported struct */
1126     return vn_sizeof_simple_pointer(NULL);
1127 }
1128 
1129 static inline size_t
vn_sizeof_VkRenderPassCreateInfo2_self(const VkRenderPassCreateInfo2 * val)1130 vn_sizeof_VkRenderPassCreateInfo2_self(const VkRenderPassCreateInfo2 *val)
1131 {
1132     size_t size = 0;
1133     /* skip val->{sType,pNext} */
1134     size += vn_sizeof_VkFlags(&val->flags);
1135     size += vn_sizeof_uint32_t(&val->attachmentCount);
1136     if (val->pAttachments) {
1137         size += vn_sizeof_array_size(val->attachmentCount);
1138         for (uint32_t i = 0; i < val->attachmentCount; i++)
1139             size += vn_sizeof_VkAttachmentDescription2(&val->pAttachments[i]);
1140     } else {
1141         size += vn_sizeof_array_size(0);
1142     }
1143     size += vn_sizeof_uint32_t(&val->subpassCount);
1144     if (val->pSubpasses) {
1145         size += vn_sizeof_array_size(val->subpassCount);
1146         for (uint32_t i = 0; i < val->subpassCount; i++)
1147             size += vn_sizeof_VkSubpassDescription2(&val->pSubpasses[i]);
1148     } else {
1149         size += vn_sizeof_array_size(0);
1150     }
1151     size += vn_sizeof_uint32_t(&val->dependencyCount);
1152     if (val->pDependencies) {
1153         size += vn_sizeof_array_size(val->dependencyCount);
1154         for (uint32_t i = 0; i < val->dependencyCount; i++)
1155             size += vn_sizeof_VkSubpassDependency2(&val->pDependencies[i]);
1156     } else {
1157         size += vn_sizeof_array_size(0);
1158     }
1159     size += vn_sizeof_uint32_t(&val->correlatedViewMaskCount);
1160     if (val->pCorrelatedViewMasks) {
1161         size += vn_sizeof_array_size(val->correlatedViewMaskCount);
1162         size += vn_sizeof_uint32_t_array(val->pCorrelatedViewMasks, val->correlatedViewMaskCount);
1163     } else {
1164         size += vn_sizeof_array_size(0);
1165     }
1166     return size;
1167 }
1168 
1169 static inline size_t
vn_sizeof_VkRenderPassCreateInfo2(const VkRenderPassCreateInfo2 * val)1170 vn_sizeof_VkRenderPassCreateInfo2(const VkRenderPassCreateInfo2 *val)
1171 {
1172     size_t size = 0;
1173 
1174     size += vn_sizeof_VkStructureType(&val->sType);
1175     size += vn_sizeof_VkRenderPassCreateInfo2_pnext(val->pNext);
1176     size += vn_sizeof_VkRenderPassCreateInfo2_self(val);
1177 
1178     return size;
1179 }
1180 
1181 static inline void
vn_encode_VkRenderPassCreateInfo2_pnext(struct vn_cs_encoder * enc,const void * val)1182 vn_encode_VkRenderPassCreateInfo2_pnext(struct vn_cs_encoder *enc, const void *val)
1183 {
1184     /* no known/supported struct */
1185     vn_encode_simple_pointer(enc, NULL);
1186 }
1187 
1188 static inline void
vn_encode_VkRenderPassCreateInfo2_self(struct vn_cs_encoder * enc,const VkRenderPassCreateInfo2 * val)1189 vn_encode_VkRenderPassCreateInfo2_self(struct vn_cs_encoder *enc, const VkRenderPassCreateInfo2 *val)
1190 {
1191     /* skip val->{sType,pNext} */
1192     vn_encode_VkFlags(enc, &val->flags);
1193     vn_encode_uint32_t(enc, &val->attachmentCount);
1194     if (val->pAttachments) {
1195         vn_encode_array_size(enc, val->attachmentCount);
1196         for (uint32_t i = 0; i < val->attachmentCount; i++)
1197             vn_encode_VkAttachmentDescription2(enc, &val->pAttachments[i]);
1198     } else {
1199         vn_encode_array_size(enc, 0);
1200     }
1201     vn_encode_uint32_t(enc, &val->subpassCount);
1202     if (val->pSubpasses) {
1203         vn_encode_array_size(enc, val->subpassCount);
1204         for (uint32_t i = 0; i < val->subpassCount; i++)
1205             vn_encode_VkSubpassDescription2(enc, &val->pSubpasses[i]);
1206     } else {
1207         vn_encode_array_size(enc, 0);
1208     }
1209     vn_encode_uint32_t(enc, &val->dependencyCount);
1210     if (val->pDependencies) {
1211         vn_encode_array_size(enc, val->dependencyCount);
1212         for (uint32_t i = 0; i < val->dependencyCount; i++)
1213             vn_encode_VkSubpassDependency2(enc, &val->pDependencies[i]);
1214     } else {
1215         vn_encode_array_size(enc, 0);
1216     }
1217     vn_encode_uint32_t(enc, &val->correlatedViewMaskCount);
1218     if (val->pCorrelatedViewMasks) {
1219         vn_encode_array_size(enc, val->correlatedViewMaskCount);
1220         vn_encode_uint32_t_array(enc, val->pCorrelatedViewMasks, val->correlatedViewMaskCount);
1221     } else {
1222         vn_encode_array_size(enc, 0);
1223     }
1224 }
1225 
1226 static inline void
vn_encode_VkRenderPassCreateInfo2(struct vn_cs_encoder * enc,const VkRenderPassCreateInfo2 * val)1227 vn_encode_VkRenderPassCreateInfo2(struct vn_cs_encoder *enc, const VkRenderPassCreateInfo2 *val)
1228 {
1229     assert(val->sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2);
1230     vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 });
1231     vn_encode_VkRenderPassCreateInfo2_pnext(enc, val->pNext);
1232     vn_encode_VkRenderPassCreateInfo2_self(enc, val);
1233 }
1234 
vn_sizeof_vkCreateRenderPass(VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1235 static inline size_t vn_sizeof_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1236 {
1237     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass_EXT;
1238     const VkFlags cmd_flags = 0;
1239     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
1240 
1241     cmd_size += vn_sizeof_VkDevice(&device);
1242     cmd_size += vn_sizeof_simple_pointer(pCreateInfo);
1243     if (pCreateInfo)
1244         cmd_size += vn_sizeof_VkRenderPassCreateInfo(pCreateInfo);
1245     cmd_size += vn_sizeof_simple_pointer(pAllocator);
1246     if (pAllocator)
1247         assert(false);
1248     cmd_size += vn_sizeof_simple_pointer(pRenderPass);
1249     if (pRenderPass)
1250         cmd_size += vn_sizeof_VkRenderPass(pRenderPass);
1251 
1252     return cmd_size;
1253 }
1254 
vn_encode_vkCreateRenderPass(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1255 static inline void vn_encode_vkCreateRenderPass(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1256 {
1257     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass_EXT;
1258 
1259     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
1260     vn_encode_VkFlags(enc, &cmd_flags);
1261 
1262     vn_encode_VkDevice(enc, &device);
1263     if (vn_encode_simple_pointer(enc, pCreateInfo))
1264         vn_encode_VkRenderPassCreateInfo(enc, pCreateInfo);
1265     if (vn_encode_simple_pointer(enc, pAllocator))
1266         assert(false);
1267     if (vn_encode_simple_pointer(enc, pRenderPass))
1268         vn_encode_VkRenderPass(enc, pRenderPass);
1269 }
1270 
vn_sizeof_vkCreateRenderPass_reply(VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1271 static inline size_t vn_sizeof_vkCreateRenderPass_reply(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1272 {
1273     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass_EXT;
1274     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1275 
1276     VkResult ret;
1277     cmd_size += vn_sizeof_VkResult(&ret);
1278     /* skip device */
1279     /* skip pCreateInfo */
1280     /* skip pAllocator */
1281     cmd_size += vn_sizeof_simple_pointer(pRenderPass);
1282     if (pRenderPass)
1283         cmd_size += vn_sizeof_VkRenderPass(pRenderPass);
1284 
1285     return cmd_size;
1286 }
1287 
vn_decode_vkCreateRenderPass_reply(struct vn_cs_decoder * dec,VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1288 static inline VkResult vn_decode_vkCreateRenderPass_reply(struct vn_cs_decoder *dec, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1289 {
1290     VkCommandTypeEXT command_type;
1291     vn_decode_VkCommandTypeEXT(dec, &command_type);
1292     assert(command_type == VK_COMMAND_TYPE_vkCreateRenderPass_EXT);
1293 
1294     VkResult ret;
1295     vn_decode_VkResult(dec, &ret);
1296     /* skip device */
1297     /* skip pCreateInfo */
1298     /* skip pAllocator */
1299     if (vn_decode_simple_pointer(dec)) {
1300         vn_decode_VkRenderPass(dec, pRenderPass);
1301     } else {
1302         pRenderPass = NULL;
1303     }
1304 
1305     return ret;
1306 }
1307 
vn_sizeof_vkDestroyRenderPass(VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1308 static inline size_t vn_sizeof_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1309 {
1310     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRenderPass_EXT;
1311     const VkFlags cmd_flags = 0;
1312     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
1313 
1314     cmd_size += vn_sizeof_VkDevice(&device);
1315     cmd_size += vn_sizeof_VkRenderPass(&renderPass);
1316     cmd_size += vn_sizeof_simple_pointer(pAllocator);
1317     if (pAllocator)
1318         assert(false);
1319 
1320     return cmd_size;
1321 }
1322 
vn_encode_vkDestroyRenderPass(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1323 static inline void vn_encode_vkDestroyRenderPass(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1324 {
1325     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRenderPass_EXT;
1326 
1327     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
1328     vn_encode_VkFlags(enc, &cmd_flags);
1329 
1330     vn_encode_VkDevice(enc, &device);
1331     vn_encode_VkRenderPass(enc, &renderPass);
1332     if (vn_encode_simple_pointer(enc, pAllocator))
1333         assert(false);
1334 }
1335 
vn_sizeof_vkDestroyRenderPass_reply(VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1336 static inline size_t vn_sizeof_vkDestroyRenderPass_reply(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1337 {
1338     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRenderPass_EXT;
1339     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1340 
1341     /* skip device */
1342     /* skip renderPass */
1343     /* skip pAllocator */
1344 
1345     return cmd_size;
1346 }
1347 
vn_decode_vkDestroyRenderPass_reply(struct vn_cs_decoder * dec,VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1348 static inline void vn_decode_vkDestroyRenderPass_reply(struct vn_cs_decoder *dec, VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1349 {
1350     VkCommandTypeEXT command_type;
1351     vn_decode_VkCommandTypeEXT(dec, &command_type);
1352     assert(command_type == VK_COMMAND_TYPE_vkDestroyRenderPass_EXT);
1353 
1354     /* skip device */
1355     /* skip renderPass */
1356     /* skip pAllocator */
1357 }
1358 
vn_sizeof_vkGetRenderAreaGranularity(VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1359 static inline size_t vn_sizeof_vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1360 {
1361     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetRenderAreaGranularity_EXT;
1362     const VkFlags cmd_flags = 0;
1363     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
1364 
1365     cmd_size += vn_sizeof_VkDevice(&device);
1366     cmd_size += vn_sizeof_VkRenderPass(&renderPass);
1367     cmd_size += vn_sizeof_simple_pointer(pGranularity);
1368     if (pGranularity)
1369         cmd_size += vn_sizeof_VkExtent2D_partial(pGranularity);
1370 
1371     return cmd_size;
1372 }
1373 
vn_encode_vkGetRenderAreaGranularity(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1374 static inline void vn_encode_vkGetRenderAreaGranularity(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1375 {
1376     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetRenderAreaGranularity_EXT;
1377 
1378     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
1379     vn_encode_VkFlags(enc, &cmd_flags);
1380 
1381     vn_encode_VkDevice(enc, &device);
1382     vn_encode_VkRenderPass(enc, &renderPass);
1383     if (vn_encode_simple_pointer(enc, pGranularity))
1384         vn_encode_VkExtent2D_partial(enc, pGranularity);
1385 }
1386 
vn_sizeof_vkGetRenderAreaGranularity_reply(VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1387 static inline size_t vn_sizeof_vkGetRenderAreaGranularity_reply(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1388 {
1389     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetRenderAreaGranularity_EXT;
1390     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1391 
1392     /* skip device */
1393     /* skip renderPass */
1394     cmd_size += vn_sizeof_simple_pointer(pGranularity);
1395     if (pGranularity)
1396         cmd_size += vn_sizeof_VkExtent2D(pGranularity);
1397 
1398     return cmd_size;
1399 }
1400 
vn_decode_vkGetRenderAreaGranularity_reply(struct vn_cs_decoder * dec,VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1401 static inline void vn_decode_vkGetRenderAreaGranularity_reply(struct vn_cs_decoder *dec, VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1402 {
1403     VkCommandTypeEXT command_type;
1404     vn_decode_VkCommandTypeEXT(dec, &command_type);
1405     assert(command_type == VK_COMMAND_TYPE_vkGetRenderAreaGranularity_EXT);
1406 
1407     /* skip device */
1408     /* skip renderPass */
1409     if (vn_decode_simple_pointer(dec)) {
1410         vn_decode_VkExtent2D(dec, pGranularity);
1411     } else {
1412         pGranularity = NULL;
1413     }
1414 }
1415 
vn_sizeof_vkCreateRenderPass2(VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1416 static inline size_t vn_sizeof_vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1417 {
1418     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass2_EXT;
1419     const VkFlags cmd_flags = 0;
1420     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
1421 
1422     cmd_size += vn_sizeof_VkDevice(&device);
1423     cmd_size += vn_sizeof_simple_pointer(pCreateInfo);
1424     if (pCreateInfo)
1425         cmd_size += vn_sizeof_VkRenderPassCreateInfo2(pCreateInfo);
1426     cmd_size += vn_sizeof_simple_pointer(pAllocator);
1427     if (pAllocator)
1428         assert(false);
1429     cmd_size += vn_sizeof_simple_pointer(pRenderPass);
1430     if (pRenderPass)
1431         cmd_size += vn_sizeof_VkRenderPass(pRenderPass);
1432 
1433     return cmd_size;
1434 }
1435 
vn_encode_vkCreateRenderPass2(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1436 static inline void vn_encode_vkCreateRenderPass2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1437 {
1438     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass2_EXT;
1439 
1440     vn_encode_VkCommandTypeEXT(enc, &cmd_type);
1441     vn_encode_VkFlags(enc, &cmd_flags);
1442 
1443     vn_encode_VkDevice(enc, &device);
1444     if (vn_encode_simple_pointer(enc, pCreateInfo))
1445         vn_encode_VkRenderPassCreateInfo2(enc, pCreateInfo);
1446     if (vn_encode_simple_pointer(enc, pAllocator))
1447         assert(false);
1448     if (vn_encode_simple_pointer(enc, pRenderPass))
1449         vn_encode_VkRenderPass(enc, pRenderPass);
1450 }
1451 
vn_sizeof_vkCreateRenderPass2_reply(VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1452 static inline size_t vn_sizeof_vkCreateRenderPass2_reply(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1453 {
1454     const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRenderPass2_EXT;
1455     size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1456 
1457     VkResult ret;
1458     cmd_size += vn_sizeof_VkResult(&ret);
1459     /* skip device */
1460     /* skip pCreateInfo */
1461     /* skip pAllocator */
1462     cmd_size += vn_sizeof_simple_pointer(pRenderPass);
1463     if (pRenderPass)
1464         cmd_size += vn_sizeof_VkRenderPass(pRenderPass);
1465 
1466     return cmd_size;
1467 }
1468 
vn_decode_vkCreateRenderPass2_reply(struct vn_cs_decoder * dec,VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1469 static inline VkResult vn_decode_vkCreateRenderPass2_reply(struct vn_cs_decoder *dec, VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1470 {
1471     VkCommandTypeEXT command_type;
1472     vn_decode_VkCommandTypeEXT(dec, &command_type);
1473     assert(command_type == VK_COMMAND_TYPE_vkCreateRenderPass2_EXT);
1474 
1475     VkResult ret;
1476     vn_decode_VkResult(dec, &ret);
1477     /* skip device */
1478     /* skip pCreateInfo */
1479     /* skip pAllocator */
1480     if (vn_decode_simple_pointer(dec)) {
1481         vn_decode_VkRenderPass(dec, pRenderPass);
1482     } else {
1483         pRenderPass = NULL;
1484     }
1485 
1486     return ret;
1487 }
1488 
vn_submit_vkCreateRenderPass(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass,struct vn_instance_submit_command * submit)1489 static inline void vn_submit_vkCreateRenderPass(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, struct vn_instance_submit_command *submit)
1490 {
1491     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1492     void *cmd_data = local_cmd_data;
1493     size_t cmd_size = vn_sizeof_vkCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
1494     if (cmd_size > sizeof(local_cmd_data)) {
1495         cmd_data = malloc(cmd_size);
1496         if (!cmd_data)
1497             cmd_size = 0;
1498     }
1499     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateRenderPass_reply(device, pCreateInfo, pAllocator, pRenderPass) : 0;
1500 
1501     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1502     if (cmd_size) {
1503         vn_encode_vkCreateRenderPass(enc, cmd_flags, device, pCreateInfo, pAllocator, pRenderPass);
1504         vn_instance_submit_command(vn_instance, submit);
1505         if (cmd_data != local_cmd_data)
1506             free(cmd_data);
1507     }
1508 }
1509 
vn_submit_vkDestroyRenderPass(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator,struct vn_instance_submit_command * submit)1510 static inline void vn_submit_vkDestroyRenderPass(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator, struct vn_instance_submit_command *submit)
1511 {
1512     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1513     void *cmd_data = local_cmd_data;
1514     size_t cmd_size = vn_sizeof_vkDestroyRenderPass(device, renderPass, pAllocator);
1515     if (cmd_size > sizeof(local_cmd_data)) {
1516         cmd_data = malloc(cmd_size);
1517         if (!cmd_data)
1518             cmd_size = 0;
1519     }
1520     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkDestroyRenderPass_reply(device, renderPass, pAllocator) : 0;
1521 
1522     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1523     if (cmd_size) {
1524         vn_encode_vkDestroyRenderPass(enc, cmd_flags, device, renderPass, pAllocator);
1525         vn_instance_submit_command(vn_instance, submit);
1526         if (cmd_data != local_cmd_data)
1527             free(cmd_data);
1528     }
1529 }
1530 
vn_submit_vkGetRenderAreaGranularity(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity,struct vn_instance_submit_command * submit)1531 static inline void vn_submit_vkGetRenderAreaGranularity(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity, struct vn_instance_submit_command *submit)
1532 {
1533     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1534     void *cmd_data = local_cmd_data;
1535     size_t cmd_size = vn_sizeof_vkGetRenderAreaGranularity(device, renderPass, pGranularity);
1536     if (cmd_size > sizeof(local_cmd_data)) {
1537         cmd_data = malloc(cmd_size);
1538         if (!cmd_data)
1539             cmd_size = 0;
1540     }
1541     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetRenderAreaGranularity_reply(device, renderPass, pGranularity) : 0;
1542 
1543     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1544     if (cmd_size) {
1545         vn_encode_vkGetRenderAreaGranularity(enc, cmd_flags, device, renderPass, pGranularity);
1546         vn_instance_submit_command(vn_instance, submit);
1547         if (cmd_data != local_cmd_data)
1548             free(cmd_data);
1549     }
1550 }
1551 
vn_submit_vkCreateRenderPass2(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass,struct vn_instance_submit_command * submit)1552 static inline void vn_submit_vkCreateRenderPass2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, struct vn_instance_submit_command *submit)
1553 {
1554     uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1555     void *cmd_data = local_cmd_data;
1556     size_t cmd_size = vn_sizeof_vkCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass);
1557     if (cmd_size > sizeof(local_cmd_data)) {
1558         cmd_data = malloc(cmd_size);
1559         if (!cmd_data)
1560             cmd_size = 0;
1561     }
1562     const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateRenderPass2_reply(device, pCreateInfo, pAllocator, pRenderPass) : 0;
1563 
1564     struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1565     if (cmd_size) {
1566         vn_encode_vkCreateRenderPass2(enc, cmd_flags, device, pCreateInfo, pAllocator, pRenderPass);
1567         vn_instance_submit_command(vn_instance, submit);
1568         if (cmd_data != local_cmd_data)
1569             free(cmd_data);
1570     }
1571 }
1572 
vn_call_vkCreateRenderPass(struct vn_instance * vn_instance,VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1573 static inline VkResult vn_call_vkCreateRenderPass(struct vn_instance *vn_instance, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1574 {
1575     VN_TRACE_FUNC();
1576 
1577     struct vn_instance_submit_command submit;
1578     vn_submit_vkCreateRenderPass(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pCreateInfo, pAllocator, pRenderPass, &submit);
1579     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1580     if (dec) {
1581         const VkResult ret = vn_decode_vkCreateRenderPass_reply(dec, device, pCreateInfo, pAllocator, pRenderPass);
1582         vn_instance_free_command_reply(vn_instance, &submit);
1583         return ret;
1584     } else {
1585         return VK_ERROR_OUT_OF_HOST_MEMORY;
1586     }
1587 }
1588 
vn_async_vkCreateRenderPass(struct vn_instance * vn_instance,VkDevice device,const VkRenderPassCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1589 static inline void vn_async_vkCreateRenderPass(struct vn_instance *vn_instance, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1590 {
1591     struct vn_instance_submit_command submit;
1592     vn_submit_vkCreateRenderPass(vn_instance, 0, device, pCreateInfo, pAllocator, pRenderPass, &submit);
1593 }
1594 
vn_call_vkDestroyRenderPass(struct vn_instance * vn_instance,VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1595 static inline void vn_call_vkDestroyRenderPass(struct vn_instance *vn_instance, VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1596 {
1597     VN_TRACE_FUNC();
1598 
1599     struct vn_instance_submit_command submit;
1600     vn_submit_vkDestroyRenderPass(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, renderPass, pAllocator, &submit);
1601     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1602     if (dec) {
1603         vn_decode_vkDestroyRenderPass_reply(dec, device, renderPass, pAllocator);
1604         vn_instance_free_command_reply(vn_instance, &submit);
1605     }
1606 }
1607 
vn_async_vkDestroyRenderPass(struct vn_instance * vn_instance,VkDevice device,VkRenderPass renderPass,const VkAllocationCallbacks * pAllocator)1608 static inline void vn_async_vkDestroyRenderPass(struct vn_instance *vn_instance, VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
1609 {
1610     struct vn_instance_submit_command submit;
1611     vn_submit_vkDestroyRenderPass(vn_instance, 0, device, renderPass, pAllocator, &submit);
1612 }
1613 
vn_call_vkGetRenderAreaGranularity(struct vn_instance * vn_instance,VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1614 static inline void vn_call_vkGetRenderAreaGranularity(struct vn_instance *vn_instance, VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1615 {
1616     VN_TRACE_FUNC();
1617 
1618     struct vn_instance_submit_command submit;
1619     vn_submit_vkGetRenderAreaGranularity(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, renderPass, pGranularity, &submit);
1620     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1621     if (dec) {
1622         vn_decode_vkGetRenderAreaGranularity_reply(dec, device, renderPass, pGranularity);
1623         vn_instance_free_command_reply(vn_instance, &submit);
1624     }
1625 }
1626 
vn_async_vkGetRenderAreaGranularity(struct vn_instance * vn_instance,VkDevice device,VkRenderPass renderPass,VkExtent2D * pGranularity)1627 static inline void vn_async_vkGetRenderAreaGranularity(struct vn_instance *vn_instance, VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity)
1628 {
1629     struct vn_instance_submit_command submit;
1630     vn_submit_vkGetRenderAreaGranularity(vn_instance, 0, device, renderPass, pGranularity, &submit);
1631 }
1632 
vn_call_vkCreateRenderPass2(struct vn_instance * vn_instance,VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1633 static inline VkResult vn_call_vkCreateRenderPass2(struct vn_instance *vn_instance, VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1634 {
1635     VN_TRACE_FUNC();
1636 
1637     struct vn_instance_submit_command submit;
1638     vn_submit_vkCreateRenderPass2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pCreateInfo, pAllocator, pRenderPass, &submit);
1639     struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1640     if (dec) {
1641         const VkResult ret = vn_decode_vkCreateRenderPass2_reply(dec, device, pCreateInfo, pAllocator, pRenderPass);
1642         vn_instance_free_command_reply(vn_instance, &submit);
1643         return ret;
1644     } else {
1645         return VK_ERROR_OUT_OF_HOST_MEMORY;
1646     }
1647 }
1648 
vn_async_vkCreateRenderPass2(struct vn_instance * vn_instance,VkDevice device,const VkRenderPassCreateInfo2 * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkRenderPass * pRenderPass)1649 static inline void vn_async_vkCreateRenderPass2(struct vn_instance *vn_instance, VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
1650 {
1651     struct vn_instance_submit_command submit;
1652     vn_submit_vkCreateRenderPass2(vn_instance, 0, device, pCreateInfo, pAllocator, pRenderPass, &submit);
1653 }
1654 
1655 #endif /* VN_PROTOCOL_DRIVER_RENDER_PASS_H */
1656