1bf215546Sopenharmony_ci/* This file is generated by venus-protocol.  See vn_protocol_driver.h. */
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ci/*
4bf215546Sopenharmony_ci * Copyright 2020 Google LLC
5bf215546Sopenharmony_ci * SPDX-License-Identifier: MIT
6bf215546Sopenharmony_ci */
7bf215546Sopenharmony_ci
8bf215546Sopenharmony_ci#ifndef VN_PROTOCOL_DRIVER_STRUCTS_H
9bf215546Sopenharmony_ci#define VN_PROTOCOL_DRIVER_STRUCTS_H
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_ci#include "vn_protocol_driver_handles.h"
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_ci/*
14bf215546Sopenharmony_ci * These structs/unions/commands are not included
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci *   VkAllocationCallbacks
17bf215546Sopenharmony_ci */
18bf215546Sopenharmony_ci
19bf215546Sopenharmony_ci/* struct VkExtent3D */
20bf215546Sopenharmony_ci
21bf215546Sopenharmony_cistatic inline size_t
22bf215546Sopenharmony_civn_sizeof_VkExtent3D(const VkExtent3D *val)
23bf215546Sopenharmony_ci{
24bf215546Sopenharmony_ci    size_t size = 0;
25bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->width);
26bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->height);
27bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->depth);
28bf215546Sopenharmony_ci    return size;
29bf215546Sopenharmony_ci}
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_cistatic inline void
32bf215546Sopenharmony_civn_encode_VkExtent3D(struct vn_cs_encoder *enc, const VkExtent3D *val)
33bf215546Sopenharmony_ci{
34bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->width);
35bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->height);
36bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->depth);
37bf215546Sopenharmony_ci}
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_cistatic inline void
40bf215546Sopenharmony_civn_decode_VkExtent3D(struct vn_cs_decoder *dec, VkExtent3D *val)
41bf215546Sopenharmony_ci{
42bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->width);
43bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->height);
44bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->depth);
45bf215546Sopenharmony_ci}
46bf215546Sopenharmony_ci
47bf215546Sopenharmony_cistatic inline size_t
48bf215546Sopenharmony_civn_sizeof_VkExtent3D_partial(const VkExtent3D *val)
49bf215546Sopenharmony_ci{
50bf215546Sopenharmony_ci    size_t size = 0;
51bf215546Sopenharmony_ci    /* skip val->width */
52bf215546Sopenharmony_ci    /* skip val->height */
53bf215546Sopenharmony_ci    /* skip val->depth */
54bf215546Sopenharmony_ci    return size;
55bf215546Sopenharmony_ci}
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_cistatic inline void
58bf215546Sopenharmony_civn_encode_VkExtent3D_partial(struct vn_cs_encoder *enc, const VkExtent3D *val)
59bf215546Sopenharmony_ci{
60bf215546Sopenharmony_ci    /* skip val->width */
61bf215546Sopenharmony_ci    /* skip val->height */
62bf215546Sopenharmony_ci    /* skip val->depth */
63bf215546Sopenharmony_ci}
64bf215546Sopenharmony_ci
65bf215546Sopenharmony_ci/* struct VkLayerProperties */
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_cistatic inline size_t
68bf215546Sopenharmony_civn_sizeof_VkLayerProperties(const VkLayerProperties *val)
69bf215546Sopenharmony_ci{
70bf215546Sopenharmony_ci    size_t size = 0;
71bf215546Sopenharmony_ci    size += vn_sizeof_array_size(VK_MAX_EXTENSION_NAME_SIZE);
72bf215546Sopenharmony_ci    size += vn_sizeof_char_array(val->layerName, VK_MAX_EXTENSION_NAME_SIZE);
73bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->specVersion);
74bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->implementationVersion);
75bf215546Sopenharmony_ci    size += vn_sizeof_array_size(VK_MAX_DESCRIPTION_SIZE);
76bf215546Sopenharmony_ci    size += vn_sizeof_char_array(val->description, VK_MAX_DESCRIPTION_SIZE);
77bf215546Sopenharmony_ci    return size;
78bf215546Sopenharmony_ci}
79bf215546Sopenharmony_ci
80bf215546Sopenharmony_cistatic inline void
81bf215546Sopenharmony_civn_decode_VkLayerProperties(struct vn_cs_decoder *dec, VkLayerProperties *val)
82bf215546Sopenharmony_ci{
83bf215546Sopenharmony_ci    {
84bf215546Sopenharmony_ci        const size_t array_size = vn_decode_array_size(dec, VK_MAX_EXTENSION_NAME_SIZE);
85bf215546Sopenharmony_ci        vn_decode_char_array(dec, val->layerName, array_size);
86bf215546Sopenharmony_ci    }
87bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->specVersion);
88bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->implementationVersion);
89bf215546Sopenharmony_ci    {
90bf215546Sopenharmony_ci        const size_t array_size = vn_decode_array_size(dec, VK_MAX_DESCRIPTION_SIZE);
91bf215546Sopenharmony_ci        vn_decode_char_array(dec, val->description, array_size);
92bf215546Sopenharmony_ci    }
93bf215546Sopenharmony_ci}
94bf215546Sopenharmony_ci
95bf215546Sopenharmony_cistatic inline size_t
96bf215546Sopenharmony_civn_sizeof_VkLayerProperties_partial(const VkLayerProperties *val)
97bf215546Sopenharmony_ci{
98bf215546Sopenharmony_ci    size_t size = 0;
99bf215546Sopenharmony_ci    /* skip val->layerName */
100bf215546Sopenharmony_ci    /* skip val->specVersion */
101bf215546Sopenharmony_ci    /* skip val->implementationVersion */
102bf215546Sopenharmony_ci    /* skip val->description */
103bf215546Sopenharmony_ci    return size;
104bf215546Sopenharmony_ci}
105bf215546Sopenharmony_ci
106bf215546Sopenharmony_cistatic inline void
107bf215546Sopenharmony_civn_encode_VkLayerProperties_partial(struct vn_cs_encoder *enc, const VkLayerProperties *val)
108bf215546Sopenharmony_ci{
109bf215546Sopenharmony_ci    /* skip val->layerName */
110bf215546Sopenharmony_ci    /* skip val->specVersion */
111bf215546Sopenharmony_ci    /* skip val->implementationVersion */
112bf215546Sopenharmony_ci    /* skip val->description */
113bf215546Sopenharmony_ci}
114bf215546Sopenharmony_ci
115bf215546Sopenharmony_ci/* struct VkExtensionProperties */
116bf215546Sopenharmony_ci
117bf215546Sopenharmony_cistatic inline size_t
118bf215546Sopenharmony_civn_sizeof_VkExtensionProperties(const VkExtensionProperties *val)
119bf215546Sopenharmony_ci{
120bf215546Sopenharmony_ci    size_t size = 0;
121bf215546Sopenharmony_ci    size += vn_sizeof_array_size(VK_MAX_EXTENSION_NAME_SIZE);
122bf215546Sopenharmony_ci    size += vn_sizeof_char_array(val->extensionName, VK_MAX_EXTENSION_NAME_SIZE);
123bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->specVersion);
124bf215546Sopenharmony_ci    return size;
125bf215546Sopenharmony_ci}
126bf215546Sopenharmony_ci
127bf215546Sopenharmony_cistatic inline void
128bf215546Sopenharmony_civn_encode_VkExtensionProperties(struct vn_cs_encoder *enc, const VkExtensionProperties *val)
129bf215546Sopenharmony_ci{
130bf215546Sopenharmony_ci    vn_encode_array_size(enc, VK_MAX_EXTENSION_NAME_SIZE);
131bf215546Sopenharmony_ci    vn_encode_char_array(enc, val->extensionName, VK_MAX_EXTENSION_NAME_SIZE);
132bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->specVersion);
133bf215546Sopenharmony_ci}
134bf215546Sopenharmony_ci
135bf215546Sopenharmony_cistatic inline void
136bf215546Sopenharmony_civn_decode_VkExtensionProperties(struct vn_cs_decoder *dec, VkExtensionProperties *val)
137bf215546Sopenharmony_ci{
138bf215546Sopenharmony_ci    {
139bf215546Sopenharmony_ci        const size_t array_size = vn_decode_array_size(dec, VK_MAX_EXTENSION_NAME_SIZE);
140bf215546Sopenharmony_ci        vn_decode_char_array(dec, val->extensionName, array_size);
141bf215546Sopenharmony_ci    }
142bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->specVersion);
143bf215546Sopenharmony_ci}
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_cistatic inline size_t
146bf215546Sopenharmony_civn_sizeof_VkExtensionProperties_partial(const VkExtensionProperties *val)
147bf215546Sopenharmony_ci{
148bf215546Sopenharmony_ci    size_t size = 0;
149bf215546Sopenharmony_ci    /* skip val->extensionName */
150bf215546Sopenharmony_ci    /* skip val->specVersion */
151bf215546Sopenharmony_ci    return size;
152bf215546Sopenharmony_ci}
153bf215546Sopenharmony_ci
154bf215546Sopenharmony_cistatic inline void
155bf215546Sopenharmony_civn_encode_VkExtensionProperties_partial(struct vn_cs_encoder *enc, const VkExtensionProperties *val)
156bf215546Sopenharmony_ci{
157bf215546Sopenharmony_ci    /* skip val->extensionName */
158bf215546Sopenharmony_ci    /* skip val->specVersion */
159bf215546Sopenharmony_ci}
160bf215546Sopenharmony_ci
161bf215546Sopenharmony_ci/* struct VkMemoryRequirements */
162bf215546Sopenharmony_ci
163bf215546Sopenharmony_cistatic inline size_t
164bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements(const VkMemoryRequirements *val)
165bf215546Sopenharmony_ci{
166bf215546Sopenharmony_ci    size_t size = 0;
167bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceSize(&val->size);
168bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceSize(&val->alignment);
169bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->memoryTypeBits);
170bf215546Sopenharmony_ci    return size;
171bf215546Sopenharmony_ci}
172bf215546Sopenharmony_ci
173bf215546Sopenharmony_cistatic inline void
174bf215546Sopenharmony_civn_decode_VkMemoryRequirements(struct vn_cs_decoder *dec, VkMemoryRequirements *val)
175bf215546Sopenharmony_ci{
176bf215546Sopenharmony_ci    vn_decode_VkDeviceSize(dec, &val->size);
177bf215546Sopenharmony_ci    vn_decode_VkDeviceSize(dec, &val->alignment);
178bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->memoryTypeBits);
179bf215546Sopenharmony_ci}
180bf215546Sopenharmony_ci
181bf215546Sopenharmony_cistatic inline size_t
182bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements_partial(const VkMemoryRequirements *val)
183bf215546Sopenharmony_ci{
184bf215546Sopenharmony_ci    size_t size = 0;
185bf215546Sopenharmony_ci    /* skip val->size */
186bf215546Sopenharmony_ci    /* skip val->alignment */
187bf215546Sopenharmony_ci    /* skip val->memoryTypeBits */
188bf215546Sopenharmony_ci    return size;
189bf215546Sopenharmony_ci}
190bf215546Sopenharmony_ci
191bf215546Sopenharmony_cistatic inline void
192bf215546Sopenharmony_civn_encode_VkMemoryRequirements_partial(struct vn_cs_encoder *enc, const VkMemoryRequirements *val)
193bf215546Sopenharmony_ci{
194bf215546Sopenharmony_ci    /* skip val->size */
195bf215546Sopenharmony_ci    /* skip val->alignment */
196bf215546Sopenharmony_ci    /* skip val->memoryTypeBits */
197bf215546Sopenharmony_ci}
198bf215546Sopenharmony_ci
199bf215546Sopenharmony_ci/* struct VkSparseImageFormatProperties */
200bf215546Sopenharmony_ci
201bf215546Sopenharmony_cistatic inline size_t
202bf215546Sopenharmony_civn_sizeof_VkSparseImageFormatProperties(const VkSparseImageFormatProperties *val)
203bf215546Sopenharmony_ci{
204bf215546Sopenharmony_ci    size_t size = 0;
205bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->aspectMask);
206bf215546Sopenharmony_ci    size += vn_sizeof_VkExtent3D(&val->imageGranularity);
207bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->flags);
208bf215546Sopenharmony_ci    return size;
209bf215546Sopenharmony_ci}
210bf215546Sopenharmony_ci
211bf215546Sopenharmony_cistatic inline void
212bf215546Sopenharmony_civn_decode_VkSparseImageFormatProperties(struct vn_cs_decoder *dec, VkSparseImageFormatProperties *val)
213bf215546Sopenharmony_ci{
214bf215546Sopenharmony_ci    vn_decode_VkFlags(dec, &val->aspectMask);
215bf215546Sopenharmony_ci    vn_decode_VkExtent3D(dec, &val->imageGranularity);
216bf215546Sopenharmony_ci    vn_decode_VkFlags(dec, &val->flags);
217bf215546Sopenharmony_ci}
218bf215546Sopenharmony_ci
219bf215546Sopenharmony_cistatic inline size_t
220bf215546Sopenharmony_civn_sizeof_VkSparseImageFormatProperties_partial(const VkSparseImageFormatProperties *val)
221bf215546Sopenharmony_ci{
222bf215546Sopenharmony_ci    size_t size = 0;
223bf215546Sopenharmony_ci    /* skip val->aspectMask */
224bf215546Sopenharmony_ci    size += vn_sizeof_VkExtent3D_partial(&val->imageGranularity);
225bf215546Sopenharmony_ci    /* skip val->flags */
226bf215546Sopenharmony_ci    return size;
227bf215546Sopenharmony_ci}
228bf215546Sopenharmony_ci
229bf215546Sopenharmony_cistatic inline void
230bf215546Sopenharmony_civn_encode_VkSparseImageFormatProperties_partial(struct vn_cs_encoder *enc, const VkSparseImageFormatProperties *val)
231bf215546Sopenharmony_ci{
232bf215546Sopenharmony_ci    /* skip val->aspectMask */
233bf215546Sopenharmony_ci    vn_encode_VkExtent3D_partial(enc, &val->imageGranularity);
234bf215546Sopenharmony_ci    /* skip val->flags */
235bf215546Sopenharmony_ci}
236bf215546Sopenharmony_ci
237bf215546Sopenharmony_ci/* struct VkImageSubresource */
238bf215546Sopenharmony_ci
239bf215546Sopenharmony_cistatic inline size_t
240bf215546Sopenharmony_civn_sizeof_VkImageSubresource(const VkImageSubresource *val)
241bf215546Sopenharmony_ci{
242bf215546Sopenharmony_ci    size_t size = 0;
243bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->aspectMask);
244bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->mipLevel);
245bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->arrayLayer);
246bf215546Sopenharmony_ci    return size;
247bf215546Sopenharmony_ci}
248bf215546Sopenharmony_ci
249bf215546Sopenharmony_cistatic inline void
250bf215546Sopenharmony_civn_encode_VkImageSubresource(struct vn_cs_encoder *enc, const VkImageSubresource *val)
251bf215546Sopenharmony_ci{
252bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->aspectMask);
253bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->mipLevel);
254bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->arrayLayer);
255bf215546Sopenharmony_ci}
256bf215546Sopenharmony_ci
257bf215546Sopenharmony_ci/* struct VkOffset3D */
258bf215546Sopenharmony_ci
259bf215546Sopenharmony_cistatic inline size_t
260bf215546Sopenharmony_civn_sizeof_VkOffset3D(const VkOffset3D *val)
261bf215546Sopenharmony_ci{
262bf215546Sopenharmony_ci    size_t size = 0;
263bf215546Sopenharmony_ci    size += vn_sizeof_int32_t(&val->x);
264bf215546Sopenharmony_ci    size += vn_sizeof_int32_t(&val->y);
265bf215546Sopenharmony_ci    size += vn_sizeof_int32_t(&val->z);
266bf215546Sopenharmony_ci    return size;
267bf215546Sopenharmony_ci}
268bf215546Sopenharmony_ci
269bf215546Sopenharmony_cistatic inline void
270bf215546Sopenharmony_civn_encode_VkOffset3D(struct vn_cs_encoder *enc, const VkOffset3D *val)
271bf215546Sopenharmony_ci{
272bf215546Sopenharmony_ci    vn_encode_int32_t(enc, &val->x);
273bf215546Sopenharmony_ci    vn_encode_int32_t(enc, &val->y);
274bf215546Sopenharmony_ci    vn_encode_int32_t(enc, &val->z);
275bf215546Sopenharmony_ci}
276bf215546Sopenharmony_ci
277bf215546Sopenharmony_ci/* struct VkSemaphoreTypeCreateInfo chain */
278bf215546Sopenharmony_ci
279bf215546Sopenharmony_cistatic inline size_t
280bf215546Sopenharmony_civn_sizeof_VkSemaphoreTypeCreateInfo_pnext(const void *val)
281bf215546Sopenharmony_ci{
282bf215546Sopenharmony_ci    /* no known/supported struct */
283bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
284bf215546Sopenharmony_ci}
285bf215546Sopenharmony_ci
286bf215546Sopenharmony_cistatic inline size_t
287bf215546Sopenharmony_civn_sizeof_VkSemaphoreTypeCreateInfo_self(const VkSemaphoreTypeCreateInfo *val)
288bf215546Sopenharmony_ci{
289bf215546Sopenharmony_ci    size_t size = 0;
290bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
291bf215546Sopenharmony_ci    size += vn_sizeof_VkSemaphoreType(&val->semaphoreType);
292bf215546Sopenharmony_ci    size += vn_sizeof_uint64_t(&val->initialValue);
293bf215546Sopenharmony_ci    return size;
294bf215546Sopenharmony_ci}
295bf215546Sopenharmony_ci
296bf215546Sopenharmony_cistatic inline size_t
297bf215546Sopenharmony_civn_sizeof_VkSemaphoreTypeCreateInfo(const VkSemaphoreTypeCreateInfo *val)
298bf215546Sopenharmony_ci{
299bf215546Sopenharmony_ci    size_t size = 0;
300bf215546Sopenharmony_ci
301bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
302bf215546Sopenharmony_ci    size += vn_sizeof_VkSemaphoreTypeCreateInfo_pnext(val->pNext);
303bf215546Sopenharmony_ci    size += vn_sizeof_VkSemaphoreTypeCreateInfo_self(val);
304bf215546Sopenharmony_ci
305bf215546Sopenharmony_ci    return size;
306bf215546Sopenharmony_ci}
307bf215546Sopenharmony_ci
308bf215546Sopenharmony_cistatic inline void
309bf215546Sopenharmony_civn_encode_VkSemaphoreTypeCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
310bf215546Sopenharmony_ci{
311bf215546Sopenharmony_ci    /* no known/supported struct */
312bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
313bf215546Sopenharmony_ci}
314bf215546Sopenharmony_ci
315bf215546Sopenharmony_cistatic inline void
316bf215546Sopenharmony_civn_encode_VkSemaphoreTypeCreateInfo_self(struct vn_cs_encoder *enc, const VkSemaphoreTypeCreateInfo *val)
317bf215546Sopenharmony_ci{
318bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
319bf215546Sopenharmony_ci    vn_encode_VkSemaphoreType(enc, &val->semaphoreType);
320bf215546Sopenharmony_ci    vn_encode_uint64_t(enc, &val->initialValue);
321bf215546Sopenharmony_ci}
322bf215546Sopenharmony_ci
323bf215546Sopenharmony_cistatic inline void
324bf215546Sopenharmony_civn_encode_VkSemaphoreTypeCreateInfo(struct vn_cs_encoder *enc, const VkSemaphoreTypeCreateInfo *val)
325bf215546Sopenharmony_ci{
326bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO);
327bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO });
328bf215546Sopenharmony_ci    vn_encode_VkSemaphoreTypeCreateInfo_pnext(enc, val->pNext);
329bf215546Sopenharmony_ci    vn_encode_VkSemaphoreTypeCreateInfo_self(enc, val);
330bf215546Sopenharmony_ci}
331bf215546Sopenharmony_ci
332bf215546Sopenharmony_ci/* struct VkImageFormatListCreateInfo chain */
333bf215546Sopenharmony_ci
334bf215546Sopenharmony_cistatic inline size_t
335bf215546Sopenharmony_civn_sizeof_VkImageFormatListCreateInfo_pnext(const void *val)
336bf215546Sopenharmony_ci{
337bf215546Sopenharmony_ci    /* no known/supported struct */
338bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
339bf215546Sopenharmony_ci}
340bf215546Sopenharmony_ci
341bf215546Sopenharmony_cistatic inline size_t
342bf215546Sopenharmony_civn_sizeof_VkImageFormatListCreateInfo_self(const VkImageFormatListCreateInfo *val)
343bf215546Sopenharmony_ci{
344bf215546Sopenharmony_ci    size_t size = 0;
345bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
346bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->viewFormatCount);
347bf215546Sopenharmony_ci    if (val->pViewFormats) {
348bf215546Sopenharmony_ci        size += vn_sizeof_array_size(val->viewFormatCount);
349bf215546Sopenharmony_ci        size += vn_sizeof_VkFormat_array(val->pViewFormats, val->viewFormatCount);
350bf215546Sopenharmony_ci    } else {
351bf215546Sopenharmony_ci        size += vn_sizeof_array_size(0);
352bf215546Sopenharmony_ci    }
353bf215546Sopenharmony_ci    return size;
354bf215546Sopenharmony_ci}
355bf215546Sopenharmony_ci
356bf215546Sopenharmony_cistatic inline size_t
357bf215546Sopenharmony_civn_sizeof_VkImageFormatListCreateInfo(const VkImageFormatListCreateInfo *val)
358bf215546Sopenharmony_ci{
359bf215546Sopenharmony_ci    size_t size = 0;
360bf215546Sopenharmony_ci
361bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
362bf215546Sopenharmony_ci    size += vn_sizeof_VkImageFormatListCreateInfo_pnext(val->pNext);
363bf215546Sopenharmony_ci    size += vn_sizeof_VkImageFormatListCreateInfo_self(val);
364bf215546Sopenharmony_ci
365bf215546Sopenharmony_ci    return size;
366bf215546Sopenharmony_ci}
367bf215546Sopenharmony_ci
368bf215546Sopenharmony_cistatic inline void
369bf215546Sopenharmony_civn_encode_VkImageFormatListCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
370bf215546Sopenharmony_ci{
371bf215546Sopenharmony_ci    /* no known/supported struct */
372bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
373bf215546Sopenharmony_ci}
374bf215546Sopenharmony_ci
375bf215546Sopenharmony_cistatic inline void
376bf215546Sopenharmony_civn_encode_VkImageFormatListCreateInfo_self(struct vn_cs_encoder *enc, const VkImageFormatListCreateInfo *val)
377bf215546Sopenharmony_ci{
378bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
379bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->viewFormatCount);
380bf215546Sopenharmony_ci    if (val->pViewFormats) {
381bf215546Sopenharmony_ci        vn_encode_array_size(enc, val->viewFormatCount);
382bf215546Sopenharmony_ci        vn_encode_VkFormat_array(enc, val->pViewFormats, val->viewFormatCount);
383bf215546Sopenharmony_ci    } else {
384bf215546Sopenharmony_ci        vn_encode_array_size(enc, 0);
385bf215546Sopenharmony_ci    }
386bf215546Sopenharmony_ci}
387bf215546Sopenharmony_ci
388bf215546Sopenharmony_cistatic inline void
389bf215546Sopenharmony_civn_encode_VkImageFormatListCreateInfo(struct vn_cs_encoder *enc, const VkImageFormatListCreateInfo *val)
390bf215546Sopenharmony_ci{
391bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO);
392bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO });
393bf215546Sopenharmony_ci    vn_encode_VkImageFormatListCreateInfo_pnext(enc, val->pNext);
394bf215546Sopenharmony_ci    vn_encode_VkImageFormatListCreateInfo_self(enc, val);
395bf215546Sopenharmony_ci}
396bf215546Sopenharmony_ci
397bf215546Sopenharmony_ci/* struct VkImageStencilUsageCreateInfo chain */
398bf215546Sopenharmony_ci
399bf215546Sopenharmony_cistatic inline size_t
400bf215546Sopenharmony_civn_sizeof_VkImageStencilUsageCreateInfo_pnext(const void *val)
401bf215546Sopenharmony_ci{
402bf215546Sopenharmony_ci    /* no known/supported struct */
403bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
404bf215546Sopenharmony_ci}
405bf215546Sopenharmony_ci
406bf215546Sopenharmony_cistatic inline size_t
407bf215546Sopenharmony_civn_sizeof_VkImageStencilUsageCreateInfo_self(const VkImageStencilUsageCreateInfo *val)
408bf215546Sopenharmony_ci{
409bf215546Sopenharmony_ci    size_t size = 0;
410bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
411bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->stencilUsage);
412bf215546Sopenharmony_ci    return size;
413bf215546Sopenharmony_ci}
414bf215546Sopenharmony_ci
415bf215546Sopenharmony_cistatic inline size_t
416bf215546Sopenharmony_civn_sizeof_VkImageStencilUsageCreateInfo(const VkImageStencilUsageCreateInfo *val)
417bf215546Sopenharmony_ci{
418bf215546Sopenharmony_ci    size_t size = 0;
419bf215546Sopenharmony_ci
420bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
421bf215546Sopenharmony_ci    size += vn_sizeof_VkImageStencilUsageCreateInfo_pnext(val->pNext);
422bf215546Sopenharmony_ci    size += vn_sizeof_VkImageStencilUsageCreateInfo_self(val);
423bf215546Sopenharmony_ci
424bf215546Sopenharmony_ci    return size;
425bf215546Sopenharmony_ci}
426bf215546Sopenharmony_ci
427bf215546Sopenharmony_cistatic inline void
428bf215546Sopenharmony_civn_encode_VkImageStencilUsageCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
429bf215546Sopenharmony_ci{
430bf215546Sopenharmony_ci    /* no known/supported struct */
431bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
432bf215546Sopenharmony_ci}
433bf215546Sopenharmony_ci
434bf215546Sopenharmony_cistatic inline void
435bf215546Sopenharmony_civn_encode_VkImageStencilUsageCreateInfo_self(struct vn_cs_encoder *enc, const VkImageStencilUsageCreateInfo *val)
436bf215546Sopenharmony_ci{
437bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
438bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->stencilUsage);
439bf215546Sopenharmony_ci}
440bf215546Sopenharmony_ci
441bf215546Sopenharmony_cistatic inline void
442bf215546Sopenharmony_civn_encode_VkImageStencilUsageCreateInfo(struct vn_cs_encoder *enc, const VkImageStencilUsageCreateInfo *val)
443bf215546Sopenharmony_ci{
444bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO);
445bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO });
446bf215546Sopenharmony_ci    vn_encode_VkImageStencilUsageCreateInfo_pnext(enc, val->pNext);
447bf215546Sopenharmony_ci    vn_encode_VkImageStencilUsageCreateInfo_self(enc, val);
448bf215546Sopenharmony_ci}
449bf215546Sopenharmony_ci
450bf215546Sopenharmony_ci/* struct VkComponentMapping */
451bf215546Sopenharmony_ci
452bf215546Sopenharmony_cistatic inline size_t
453bf215546Sopenharmony_civn_sizeof_VkComponentMapping(const VkComponentMapping *val)
454bf215546Sopenharmony_ci{
455bf215546Sopenharmony_ci    size_t size = 0;
456bf215546Sopenharmony_ci    size += vn_sizeof_VkComponentSwizzle(&val->r);
457bf215546Sopenharmony_ci    size += vn_sizeof_VkComponentSwizzle(&val->g);
458bf215546Sopenharmony_ci    size += vn_sizeof_VkComponentSwizzle(&val->b);
459bf215546Sopenharmony_ci    size += vn_sizeof_VkComponentSwizzle(&val->a);
460bf215546Sopenharmony_ci    return size;
461bf215546Sopenharmony_ci}
462bf215546Sopenharmony_ci
463bf215546Sopenharmony_cistatic inline void
464bf215546Sopenharmony_civn_encode_VkComponentMapping(struct vn_cs_encoder *enc, const VkComponentMapping *val)
465bf215546Sopenharmony_ci{
466bf215546Sopenharmony_ci    vn_encode_VkComponentSwizzle(enc, &val->r);
467bf215546Sopenharmony_ci    vn_encode_VkComponentSwizzle(enc, &val->g);
468bf215546Sopenharmony_ci    vn_encode_VkComponentSwizzle(enc, &val->b);
469bf215546Sopenharmony_ci    vn_encode_VkComponentSwizzle(enc, &val->a);
470bf215546Sopenharmony_ci}
471bf215546Sopenharmony_ci
472bf215546Sopenharmony_cistatic inline void
473bf215546Sopenharmony_civn_decode_VkComponentMapping(struct vn_cs_decoder *dec, VkComponentMapping *val)
474bf215546Sopenharmony_ci{
475bf215546Sopenharmony_ci    vn_decode_VkComponentSwizzle(dec, &val->r);
476bf215546Sopenharmony_ci    vn_decode_VkComponentSwizzle(dec, &val->g);
477bf215546Sopenharmony_ci    vn_decode_VkComponentSwizzle(dec, &val->b);
478bf215546Sopenharmony_ci    vn_decode_VkComponentSwizzle(dec, &val->a);
479bf215546Sopenharmony_ci}
480bf215546Sopenharmony_ci
481bf215546Sopenharmony_cistatic inline size_t
482bf215546Sopenharmony_civn_sizeof_VkComponentMapping_partial(const VkComponentMapping *val)
483bf215546Sopenharmony_ci{
484bf215546Sopenharmony_ci    size_t size = 0;
485bf215546Sopenharmony_ci    /* skip val->r */
486bf215546Sopenharmony_ci    /* skip val->g */
487bf215546Sopenharmony_ci    /* skip val->b */
488bf215546Sopenharmony_ci    /* skip val->a */
489bf215546Sopenharmony_ci    return size;
490bf215546Sopenharmony_ci}
491bf215546Sopenharmony_ci
492bf215546Sopenharmony_cistatic inline void
493bf215546Sopenharmony_civn_encode_VkComponentMapping_partial(struct vn_cs_encoder *enc, const VkComponentMapping *val)
494bf215546Sopenharmony_ci{
495bf215546Sopenharmony_ci    /* skip val->r */
496bf215546Sopenharmony_ci    /* skip val->g */
497bf215546Sopenharmony_ci    /* skip val->b */
498bf215546Sopenharmony_ci    /* skip val->a */
499bf215546Sopenharmony_ci}
500bf215546Sopenharmony_ci
501bf215546Sopenharmony_ci/* struct VkImageSubresourceRange */
502bf215546Sopenharmony_ci
503bf215546Sopenharmony_cistatic inline size_t
504bf215546Sopenharmony_civn_sizeof_VkImageSubresourceRange(const VkImageSubresourceRange *val)
505bf215546Sopenharmony_ci{
506bf215546Sopenharmony_ci    size_t size = 0;
507bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->aspectMask);
508bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->baseMipLevel);
509bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->levelCount);
510bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->baseArrayLayer);
511bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->layerCount);
512bf215546Sopenharmony_ci    return size;
513bf215546Sopenharmony_ci}
514bf215546Sopenharmony_ci
515bf215546Sopenharmony_cistatic inline void
516bf215546Sopenharmony_civn_encode_VkImageSubresourceRange(struct vn_cs_encoder *enc, const VkImageSubresourceRange *val)
517bf215546Sopenharmony_ci{
518bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->aspectMask);
519bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->baseMipLevel);
520bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->levelCount);
521bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->baseArrayLayer);
522bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->layerCount);
523bf215546Sopenharmony_ci}
524bf215546Sopenharmony_ci
525bf215546Sopenharmony_ci/* struct VkSamplerYcbcrConversionInfo chain */
526bf215546Sopenharmony_ci
527bf215546Sopenharmony_cistatic inline size_t
528bf215546Sopenharmony_civn_sizeof_VkSamplerYcbcrConversionInfo_pnext(const void *val)
529bf215546Sopenharmony_ci{
530bf215546Sopenharmony_ci    /* no known/supported struct */
531bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
532bf215546Sopenharmony_ci}
533bf215546Sopenharmony_ci
534bf215546Sopenharmony_cistatic inline size_t
535bf215546Sopenharmony_civn_sizeof_VkSamplerYcbcrConversionInfo_self(const VkSamplerYcbcrConversionInfo *val)
536bf215546Sopenharmony_ci{
537bf215546Sopenharmony_ci    size_t size = 0;
538bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
539bf215546Sopenharmony_ci    size += vn_sizeof_VkSamplerYcbcrConversion(&val->conversion);
540bf215546Sopenharmony_ci    return size;
541bf215546Sopenharmony_ci}
542bf215546Sopenharmony_ci
543bf215546Sopenharmony_cistatic inline size_t
544bf215546Sopenharmony_civn_sizeof_VkSamplerYcbcrConversionInfo(const VkSamplerYcbcrConversionInfo *val)
545bf215546Sopenharmony_ci{
546bf215546Sopenharmony_ci    size_t size = 0;
547bf215546Sopenharmony_ci
548bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
549bf215546Sopenharmony_ci    size += vn_sizeof_VkSamplerYcbcrConversionInfo_pnext(val->pNext);
550bf215546Sopenharmony_ci    size += vn_sizeof_VkSamplerYcbcrConversionInfo_self(val);
551bf215546Sopenharmony_ci
552bf215546Sopenharmony_ci    return size;
553bf215546Sopenharmony_ci}
554bf215546Sopenharmony_ci
555bf215546Sopenharmony_cistatic inline void
556bf215546Sopenharmony_civn_encode_VkSamplerYcbcrConversionInfo_pnext(struct vn_cs_encoder *enc, const void *val)
557bf215546Sopenharmony_ci{
558bf215546Sopenharmony_ci    /* no known/supported struct */
559bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
560bf215546Sopenharmony_ci}
561bf215546Sopenharmony_ci
562bf215546Sopenharmony_cistatic inline void
563bf215546Sopenharmony_civn_encode_VkSamplerYcbcrConversionInfo_self(struct vn_cs_encoder *enc, const VkSamplerYcbcrConversionInfo *val)
564bf215546Sopenharmony_ci{
565bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
566bf215546Sopenharmony_ci    vn_encode_VkSamplerYcbcrConversion(enc, &val->conversion);
567bf215546Sopenharmony_ci}
568bf215546Sopenharmony_ci
569bf215546Sopenharmony_cistatic inline void
570bf215546Sopenharmony_civn_encode_VkSamplerYcbcrConversionInfo(struct vn_cs_encoder *enc, const VkSamplerYcbcrConversionInfo *val)
571bf215546Sopenharmony_ci{
572bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO);
573bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO });
574bf215546Sopenharmony_ci    vn_encode_VkSamplerYcbcrConversionInfo_pnext(enc, val->pNext);
575bf215546Sopenharmony_ci    vn_encode_VkSamplerYcbcrConversionInfo_self(enc, val);
576bf215546Sopenharmony_ci}
577bf215546Sopenharmony_ci
578bf215546Sopenharmony_ci/* struct VkViewport */
579bf215546Sopenharmony_ci
580bf215546Sopenharmony_cistatic inline size_t
581bf215546Sopenharmony_civn_sizeof_VkViewport(const VkViewport *val)
582bf215546Sopenharmony_ci{
583bf215546Sopenharmony_ci    size_t size = 0;
584bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->x);
585bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->y);
586bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->width);
587bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->height);
588bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->minDepth);
589bf215546Sopenharmony_ci    size += vn_sizeof_float(&val->maxDepth);
590bf215546Sopenharmony_ci    return size;
591bf215546Sopenharmony_ci}
592bf215546Sopenharmony_ci
593bf215546Sopenharmony_cistatic inline void
594bf215546Sopenharmony_civn_encode_VkViewport(struct vn_cs_encoder *enc, const VkViewport *val)
595bf215546Sopenharmony_ci{
596bf215546Sopenharmony_ci    vn_encode_float(enc, &val->x);
597bf215546Sopenharmony_ci    vn_encode_float(enc, &val->y);
598bf215546Sopenharmony_ci    vn_encode_float(enc, &val->width);
599bf215546Sopenharmony_ci    vn_encode_float(enc, &val->height);
600bf215546Sopenharmony_ci    vn_encode_float(enc, &val->minDepth);
601bf215546Sopenharmony_ci    vn_encode_float(enc, &val->maxDepth);
602bf215546Sopenharmony_ci}
603bf215546Sopenharmony_ci
604bf215546Sopenharmony_ci/* struct VkOffset2D */
605bf215546Sopenharmony_ci
606bf215546Sopenharmony_cistatic inline size_t
607bf215546Sopenharmony_civn_sizeof_VkOffset2D(const VkOffset2D *val)
608bf215546Sopenharmony_ci{
609bf215546Sopenharmony_ci    size_t size = 0;
610bf215546Sopenharmony_ci    size += vn_sizeof_int32_t(&val->x);
611bf215546Sopenharmony_ci    size += vn_sizeof_int32_t(&val->y);
612bf215546Sopenharmony_ci    return size;
613bf215546Sopenharmony_ci}
614bf215546Sopenharmony_ci
615bf215546Sopenharmony_cistatic inline void
616bf215546Sopenharmony_civn_encode_VkOffset2D(struct vn_cs_encoder *enc, const VkOffset2D *val)
617bf215546Sopenharmony_ci{
618bf215546Sopenharmony_ci    vn_encode_int32_t(enc, &val->x);
619bf215546Sopenharmony_ci    vn_encode_int32_t(enc, &val->y);
620bf215546Sopenharmony_ci}
621bf215546Sopenharmony_ci
622bf215546Sopenharmony_cistatic inline void
623bf215546Sopenharmony_civn_decode_VkOffset2D(struct vn_cs_decoder *dec, VkOffset2D *val)
624bf215546Sopenharmony_ci{
625bf215546Sopenharmony_ci    vn_decode_int32_t(dec, &val->x);
626bf215546Sopenharmony_ci    vn_decode_int32_t(dec, &val->y);
627bf215546Sopenharmony_ci}
628bf215546Sopenharmony_ci
629bf215546Sopenharmony_cistatic inline size_t
630bf215546Sopenharmony_civn_sizeof_VkOffset2D_partial(const VkOffset2D *val)
631bf215546Sopenharmony_ci{
632bf215546Sopenharmony_ci    size_t size = 0;
633bf215546Sopenharmony_ci    /* skip val->x */
634bf215546Sopenharmony_ci    /* skip val->y */
635bf215546Sopenharmony_ci    return size;
636bf215546Sopenharmony_ci}
637bf215546Sopenharmony_ci
638bf215546Sopenharmony_cistatic inline void
639bf215546Sopenharmony_civn_encode_VkOffset2D_partial(struct vn_cs_encoder *enc, const VkOffset2D *val)
640bf215546Sopenharmony_ci{
641bf215546Sopenharmony_ci    /* skip val->x */
642bf215546Sopenharmony_ci    /* skip val->y */
643bf215546Sopenharmony_ci}
644bf215546Sopenharmony_ci
645bf215546Sopenharmony_ci/* struct VkExtent2D */
646bf215546Sopenharmony_ci
647bf215546Sopenharmony_cistatic inline size_t
648bf215546Sopenharmony_civn_sizeof_VkExtent2D(const VkExtent2D *val)
649bf215546Sopenharmony_ci{
650bf215546Sopenharmony_ci    size_t size = 0;
651bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->width);
652bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->height);
653bf215546Sopenharmony_ci    return size;
654bf215546Sopenharmony_ci}
655bf215546Sopenharmony_ci
656bf215546Sopenharmony_cistatic inline void
657bf215546Sopenharmony_civn_encode_VkExtent2D(struct vn_cs_encoder *enc, const VkExtent2D *val)
658bf215546Sopenharmony_ci{
659bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->width);
660bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->height);
661bf215546Sopenharmony_ci}
662bf215546Sopenharmony_ci
663bf215546Sopenharmony_cistatic inline void
664bf215546Sopenharmony_civn_decode_VkExtent2D(struct vn_cs_decoder *dec, VkExtent2D *val)
665bf215546Sopenharmony_ci{
666bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->width);
667bf215546Sopenharmony_ci    vn_decode_uint32_t(dec, &val->height);
668bf215546Sopenharmony_ci}
669bf215546Sopenharmony_ci
670bf215546Sopenharmony_cistatic inline size_t
671bf215546Sopenharmony_civn_sizeof_VkExtent2D_partial(const VkExtent2D *val)
672bf215546Sopenharmony_ci{
673bf215546Sopenharmony_ci    size_t size = 0;
674bf215546Sopenharmony_ci    /* skip val->width */
675bf215546Sopenharmony_ci    /* skip val->height */
676bf215546Sopenharmony_ci    return size;
677bf215546Sopenharmony_ci}
678bf215546Sopenharmony_ci
679bf215546Sopenharmony_cistatic inline void
680bf215546Sopenharmony_civn_encode_VkExtent2D_partial(struct vn_cs_encoder *enc, const VkExtent2D *val)
681bf215546Sopenharmony_ci{
682bf215546Sopenharmony_ci    /* skip val->width */
683bf215546Sopenharmony_ci    /* skip val->height */
684bf215546Sopenharmony_ci}
685bf215546Sopenharmony_ci
686bf215546Sopenharmony_ci/* struct VkRect2D */
687bf215546Sopenharmony_ci
688bf215546Sopenharmony_cistatic inline size_t
689bf215546Sopenharmony_civn_sizeof_VkRect2D(const VkRect2D *val)
690bf215546Sopenharmony_ci{
691bf215546Sopenharmony_ci    size_t size = 0;
692bf215546Sopenharmony_ci    size += vn_sizeof_VkOffset2D(&val->offset);
693bf215546Sopenharmony_ci    size += vn_sizeof_VkExtent2D(&val->extent);
694bf215546Sopenharmony_ci    return size;
695bf215546Sopenharmony_ci}
696bf215546Sopenharmony_ci
697bf215546Sopenharmony_cistatic inline void
698bf215546Sopenharmony_civn_encode_VkRect2D(struct vn_cs_encoder *enc, const VkRect2D *val)
699bf215546Sopenharmony_ci{
700bf215546Sopenharmony_ci    vn_encode_VkOffset2D(enc, &val->offset);
701bf215546Sopenharmony_ci    vn_encode_VkExtent2D(enc, &val->extent);
702bf215546Sopenharmony_ci}
703bf215546Sopenharmony_ci
704bf215546Sopenharmony_cistatic inline void
705bf215546Sopenharmony_civn_decode_VkRect2D(struct vn_cs_decoder *dec, VkRect2D *val)
706bf215546Sopenharmony_ci{
707bf215546Sopenharmony_ci    vn_decode_VkOffset2D(dec, &val->offset);
708bf215546Sopenharmony_ci    vn_decode_VkExtent2D(dec, &val->extent);
709bf215546Sopenharmony_ci}
710bf215546Sopenharmony_ci
711bf215546Sopenharmony_cistatic inline size_t
712bf215546Sopenharmony_civn_sizeof_VkRect2D_partial(const VkRect2D *val)
713bf215546Sopenharmony_ci{
714bf215546Sopenharmony_ci    size_t size = 0;
715bf215546Sopenharmony_ci    size += vn_sizeof_VkOffset2D_partial(&val->offset);
716bf215546Sopenharmony_ci    size += vn_sizeof_VkExtent2D_partial(&val->extent);
717bf215546Sopenharmony_ci    return size;
718bf215546Sopenharmony_ci}
719bf215546Sopenharmony_ci
720bf215546Sopenharmony_cistatic inline void
721bf215546Sopenharmony_civn_encode_VkRect2D_partial(struct vn_cs_encoder *enc, const VkRect2D *val)
722bf215546Sopenharmony_ci{
723bf215546Sopenharmony_ci    vn_encode_VkOffset2D_partial(enc, &val->offset);
724bf215546Sopenharmony_ci    vn_encode_VkExtent2D_partial(enc, &val->extent);
725bf215546Sopenharmony_ci}
726bf215546Sopenharmony_ci
727bf215546Sopenharmony_ci/* union VkClearColorValue */
728bf215546Sopenharmony_ci
729bf215546Sopenharmony_cistatic inline size_t
730bf215546Sopenharmony_civn_sizeof_VkClearColorValue_tag(const VkClearColorValue *val, uint32_t tag)
731bf215546Sopenharmony_ci{
732bf215546Sopenharmony_ci    size_t size = vn_sizeof_uint32_t(&tag);
733bf215546Sopenharmony_ci    switch (tag) {
734bf215546Sopenharmony_ci    case 0:
735bf215546Sopenharmony_ci        size += vn_sizeof_array_size(4);
736bf215546Sopenharmony_ci    size += vn_sizeof_float_array(val->float32, 4);
737bf215546Sopenharmony_ci        break;
738bf215546Sopenharmony_ci    case 1:
739bf215546Sopenharmony_ci        size += vn_sizeof_array_size(4);
740bf215546Sopenharmony_ci    size += vn_sizeof_int32_t_array(val->int32, 4);
741bf215546Sopenharmony_ci        break;
742bf215546Sopenharmony_ci    case 2:
743bf215546Sopenharmony_ci        size += vn_sizeof_array_size(4);
744bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t_array(val->uint32, 4);
745bf215546Sopenharmony_ci        break;
746bf215546Sopenharmony_ci    default:
747bf215546Sopenharmony_ci        assert(false);
748bf215546Sopenharmony_ci        break;
749bf215546Sopenharmony_ci    }
750bf215546Sopenharmony_ci    return size;
751bf215546Sopenharmony_ci}
752bf215546Sopenharmony_ci
753bf215546Sopenharmony_cistatic inline size_t
754bf215546Sopenharmony_civn_sizeof_VkClearColorValue(const VkClearColorValue *val)
755bf215546Sopenharmony_ci{
756bf215546Sopenharmony_ci    return vn_sizeof_VkClearColorValue_tag(val, 2);
757bf215546Sopenharmony_ci}
758bf215546Sopenharmony_ci
759bf215546Sopenharmony_cistatic inline void
760bf215546Sopenharmony_civn_encode_VkClearColorValue_tag(struct vn_cs_encoder *enc, const VkClearColorValue *val, uint32_t tag)
761bf215546Sopenharmony_ci{
762bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &tag);
763bf215546Sopenharmony_ci    switch (tag) {
764bf215546Sopenharmony_ci    case 0:
765bf215546Sopenharmony_ci        vn_encode_array_size(enc, 4);
766bf215546Sopenharmony_ci    vn_encode_float_array(enc, val->float32, 4);
767bf215546Sopenharmony_ci        break;
768bf215546Sopenharmony_ci    case 1:
769bf215546Sopenharmony_ci        vn_encode_array_size(enc, 4);
770bf215546Sopenharmony_ci    vn_encode_int32_t_array(enc, val->int32, 4);
771bf215546Sopenharmony_ci        break;
772bf215546Sopenharmony_ci    case 2:
773bf215546Sopenharmony_ci        vn_encode_array_size(enc, 4);
774bf215546Sopenharmony_ci    vn_encode_uint32_t_array(enc, val->uint32, 4);
775bf215546Sopenharmony_ci        break;
776bf215546Sopenharmony_ci    default:
777bf215546Sopenharmony_ci        assert(false);
778bf215546Sopenharmony_ci        break;
779bf215546Sopenharmony_ci    }
780bf215546Sopenharmony_ci}
781bf215546Sopenharmony_ci
782bf215546Sopenharmony_cistatic inline void
783bf215546Sopenharmony_civn_encode_VkClearColorValue(struct vn_cs_encoder *enc, const VkClearColorValue *val)
784bf215546Sopenharmony_ci{
785bf215546Sopenharmony_ci    vn_encode_VkClearColorValue_tag(enc, val, 2); /* union with default tag */
786bf215546Sopenharmony_ci}
787bf215546Sopenharmony_ci
788bf215546Sopenharmony_ci/* struct VkMemoryDedicatedRequirements chain */
789bf215546Sopenharmony_ci
790bf215546Sopenharmony_cistatic inline size_t
791bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements_pnext(const void *val)
792bf215546Sopenharmony_ci{
793bf215546Sopenharmony_ci    /* no known/supported struct */
794bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
795bf215546Sopenharmony_ci}
796bf215546Sopenharmony_ci
797bf215546Sopenharmony_cistatic inline size_t
798bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements_self(const VkMemoryDedicatedRequirements *val)
799bf215546Sopenharmony_ci{
800bf215546Sopenharmony_ci    size_t size = 0;
801bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
802bf215546Sopenharmony_ci    size += vn_sizeof_VkBool32(&val->prefersDedicatedAllocation);
803bf215546Sopenharmony_ci    size += vn_sizeof_VkBool32(&val->requiresDedicatedAllocation);
804bf215546Sopenharmony_ci    return size;
805bf215546Sopenharmony_ci}
806bf215546Sopenharmony_ci
807bf215546Sopenharmony_cistatic inline size_t
808bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements(const VkMemoryDedicatedRequirements *val)
809bf215546Sopenharmony_ci{
810bf215546Sopenharmony_ci    size_t size = 0;
811bf215546Sopenharmony_ci
812bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
813bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryDedicatedRequirements_pnext(val->pNext);
814bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryDedicatedRequirements_self(val);
815bf215546Sopenharmony_ci
816bf215546Sopenharmony_ci    return size;
817bf215546Sopenharmony_ci}
818bf215546Sopenharmony_ci
819bf215546Sopenharmony_cistatic inline void
820bf215546Sopenharmony_civn_decode_VkMemoryDedicatedRequirements_pnext(struct vn_cs_decoder *dec, const void *val)
821bf215546Sopenharmony_ci{
822bf215546Sopenharmony_ci    /* no known/supported struct */
823bf215546Sopenharmony_ci    if (vn_decode_simple_pointer(dec))
824bf215546Sopenharmony_ci        assert(false);
825bf215546Sopenharmony_ci}
826bf215546Sopenharmony_ci
827bf215546Sopenharmony_cistatic inline void
828bf215546Sopenharmony_civn_decode_VkMemoryDedicatedRequirements_self(struct vn_cs_decoder *dec, VkMemoryDedicatedRequirements *val)
829bf215546Sopenharmony_ci{
830bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
831bf215546Sopenharmony_ci    vn_decode_VkBool32(dec, &val->prefersDedicatedAllocation);
832bf215546Sopenharmony_ci    vn_decode_VkBool32(dec, &val->requiresDedicatedAllocation);
833bf215546Sopenharmony_ci}
834bf215546Sopenharmony_ci
835bf215546Sopenharmony_cistatic inline void
836bf215546Sopenharmony_civn_decode_VkMemoryDedicatedRequirements(struct vn_cs_decoder *dec, VkMemoryDedicatedRequirements *val)
837bf215546Sopenharmony_ci{
838bf215546Sopenharmony_ci    VkStructureType stype;
839bf215546Sopenharmony_ci    vn_decode_VkStructureType(dec, &stype);
840bf215546Sopenharmony_ci    assert(stype == VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS);
841bf215546Sopenharmony_ci
842bf215546Sopenharmony_ci    assert(val->sType == stype);
843bf215546Sopenharmony_ci    vn_decode_VkMemoryDedicatedRequirements_pnext(dec, val->pNext);
844bf215546Sopenharmony_ci    vn_decode_VkMemoryDedicatedRequirements_self(dec, val);
845bf215546Sopenharmony_ci}
846bf215546Sopenharmony_ci
847bf215546Sopenharmony_cistatic inline size_t
848bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements_pnext_partial(const void *val)
849bf215546Sopenharmony_ci{
850bf215546Sopenharmony_ci    /* no known/supported struct */
851bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
852bf215546Sopenharmony_ci}
853bf215546Sopenharmony_ci
854bf215546Sopenharmony_cistatic inline size_t
855bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements_self_partial(const VkMemoryDedicatedRequirements *val)
856bf215546Sopenharmony_ci{
857bf215546Sopenharmony_ci    size_t size = 0;
858bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
859bf215546Sopenharmony_ci    /* skip val->prefersDedicatedAllocation */
860bf215546Sopenharmony_ci    /* skip val->requiresDedicatedAllocation */
861bf215546Sopenharmony_ci    return size;
862bf215546Sopenharmony_ci}
863bf215546Sopenharmony_ci
864bf215546Sopenharmony_cistatic inline size_t
865bf215546Sopenharmony_civn_sizeof_VkMemoryDedicatedRequirements_partial(const VkMemoryDedicatedRequirements *val)
866bf215546Sopenharmony_ci{
867bf215546Sopenharmony_ci    size_t size = 0;
868bf215546Sopenharmony_ci
869bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
870bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryDedicatedRequirements_pnext_partial(val->pNext);
871bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryDedicatedRequirements_self_partial(val);
872bf215546Sopenharmony_ci
873bf215546Sopenharmony_ci    return size;
874bf215546Sopenharmony_ci}
875bf215546Sopenharmony_ci
876bf215546Sopenharmony_cistatic inline void
877bf215546Sopenharmony_civn_encode_VkMemoryDedicatedRequirements_pnext_partial(struct vn_cs_encoder *enc, const void *val)
878bf215546Sopenharmony_ci{
879bf215546Sopenharmony_ci    /* no known/supported struct */
880bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
881bf215546Sopenharmony_ci}
882bf215546Sopenharmony_ci
883bf215546Sopenharmony_cistatic inline void
884bf215546Sopenharmony_civn_encode_VkMemoryDedicatedRequirements_self_partial(struct vn_cs_encoder *enc, const VkMemoryDedicatedRequirements *val)
885bf215546Sopenharmony_ci{
886bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
887bf215546Sopenharmony_ci    /* skip val->prefersDedicatedAllocation */
888bf215546Sopenharmony_ci    /* skip val->requiresDedicatedAllocation */
889bf215546Sopenharmony_ci}
890bf215546Sopenharmony_ci
891bf215546Sopenharmony_cistatic inline void
892bf215546Sopenharmony_civn_encode_VkMemoryDedicatedRequirements_partial(struct vn_cs_encoder *enc, const VkMemoryDedicatedRequirements *val)
893bf215546Sopenharmony_ci{
894bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS);
895bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS });
896bf215546Sopenharmony_ci    vn_encode_VkMemoryDedicatedRequirements_pnext_partial(enc, val->pNext);
897bf215546Sopenharmony_ci    vn_encode_VkMemoryDedicatedRequirements_self_partial(enc, val);
898bf215546Sopenharmony_ci}
899bf215546Sopenharmony_ci
900bf215546Sopenharmony_ci/* struct VkMemoryRequirements2 chain */
901bf215546Sopenharmony_ci
902bf215546Sopenharmony_cistatic inline size_t
903bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2_pnext(const void *val)
904bf215546Sopenharmony_ci{
905bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
906bf215546Sopenharmony_ci    size_t size = 0;
907bf215546Sopenharmony_ci
908bf215546Sopenharmony_ci    while (pnext) {
909bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
910bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
911bf215546Sopenharmony_ci            size += vn_sizeof_simple_pointer(pnext);
912bf215546Sopenharmony_ci            size += vn_sizeof_VkStructureType(&pnext->sType);
913bf215546Sopenharmony_ci            size += vn_sizeof_VkMemoryRequirements2_pnext(pnext->pNext);
914bf215546Sopenharmony_ci            size += vn_sizeof_VkMemoryDedicatedRequirements_self((const VkMemoryDedicatedRequirements *)pnext);
915bf215546Sopenharmony_ci            return size;
916bf215546Sopenharmony_ci        default:
917bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
918bf215546Sopenharmony_ci            break;
919bf215546Sopenharmony_ci        }
920bf215546Sopenharmony_ci        pnext = pnext->pNext;
921bf215546Sopenharmony_ci    }
922bf215546Sopenharmony_ci
923bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
924bf215546Sopenharmony_ci}
925bf215546Sopenharmony_ci
926bf215546Sopenharmony_cistatic inline size_t
927bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2_self(const VkMemoryRequirements2 *val)
928bf215546Sopenharmony_ci{
929bf215546Sopenharmony_ci    size_t size = 0;
930bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
931bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements(&val->memoryRequirements);
932bf215546Sopenharmony_ci    return size;
933bf215546Sopenharmony_ci}
934bf215546Sopenharmony_ci
935bf215546Sopenharmony_cistatic inline size_t
936bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2(const VkMemoryRequirements2 *val)
937bf215546Sopenharmony_ci{
938bf215546Sopenharmony_ci    size_t size = 0;
939bf215546Sopenharmony_ci
940bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
941bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements2_pnext(val->pNext);
942bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements2_self(val);
943bf215546Sopenharmony_ci
944bf215546Sopenharmony_ci    return size;
945bf215546Sopenharmony_ci}
946bf215546Sopenharmony_ci
947bf215546Sopenharmony_cistatic inline void
948bf215546Sopenharmony_civn_decode_VkMemoryRequirements2_pnext(struct vn_cs_decoder *dec, const void *val)
949bf215546Sopenharmony_ci{
950bf215546Sopenharmony_ci    VkBaseOutStructure *pnext = (VkBaseOutStructure *)val;
951bf215546Sopenharmony_ci    VkStructureType stype;
952bf215546Sopenharmony_ci
953bf215546Sopenharmony_ci    if (!vn_decode_simple_pointer(dec))
954bf215546Sopenharmony_ci        return;
955bf215546Sopenharmony_ci
956bf215546Sopenharmony_ci    vn_decode_VkStructureType(dec, &stype);
957bf215546Sopenharmony_ci    while (true) {
958bf215546Sopenharmony_ci        assert(pnext);
959bf215546Sopenharmony_ci        if (pnext->sType == stype)
960bf215546Sopenharmony_ci            break;
961bf215546Sopenharmony_ci
962bf215546Sopenharmony_ci        pnext = pnext->pNext;
963bf215546Sopenharmony_ci    }
964bf215546Sopenharmony_ci
965bf215546Sopenharmony_ci    switch ((int32_t)pnext->sType) {
966bf215546Sopenharmony_ci    case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
967bf215546Sopenharmony_ci        vn_decode_VkMemoryRequirements2_pnext(dec, pnext->pNext);
968bf215546Sopenharmony_ci        vn_decode_VkMemoryDedicatedRequirements_self(dec, (VkMemoryDedicatedRequirements *)pnext);
969bf215546Sopenharmony_ci        break;
970bf215546Sopenharmony_ci    default:
971bf215546Sopenharmony_ci        assert(false);
972bf215546Sopenharmony_ci        break;
973bf215546Sopenharmony_ci    }
974bf215546Sopenharmony_ci}
975bf215546Sopenharmony_ci
976bf215546Sopenharmony_cistatic inline void
977bf215546Sopenharmony_civn_decode_VkMemoryRequirements2_self(struct vn_cs_decoder *dec, VkMemoryRequirements2 *val)
978bf215546Sopenharmony_ci{
979bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
980bf215546Sopenharmony_ci    vn_decode_VkMemoryRequirements(dec, &val->memoryRequirements);
981bf215546Sopenharmony_ci}
982bf215546Sopenharmony_ci
983bf215546Sopenharmony_cistatic inline void
984bf215546Sopenharmony_civn_decode_VkMemoryRequirements2(struct vn_cs_decoder *dec, VkMemoryRequirements2 *val)
985bf215546Sopenharmony_ci{
986bf215546Sopenharmony_ci    VkStructureType stype;
987bf215546Sopenharmony_ci    vn_decode_VkStructureType(dec, &stype);
988bf215546Sopenharmony_ci    assert(stype == VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2);
989bf215546Sopenharmony_ci
990bf215546Sopenharmony_ci    assert(val->sType == stype);
991bf215546Sopenharmony_ci    vn_decode_VkMemoryRequirements2_pnext(dec, val->pNext);
992bf215546Sopenharmony_ci    vn_decode_VkMemoryRequirements2_self(dec, val);
993bf215546Sopenharmony_ci}
994bf215546Sopenharmony_ci
995bf215546Sopenharmony_cistatic inline size_t
996bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2_pnext_partial(const void *val)
997bf215546Sopenharmony_ci{
998bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
999bf215546Sopenharmony_ci    size_t size = 0;
1000bf215546Sopenharmony_ci
1001bf215546Sopenharmony_ci    while (pnext) {
1002bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
1003bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
1004bf215546Sopenharmony_ci            size += vn_sizeof_simple_pointer(pnext);
1005bf215546Sopenharmony_ci            size += vn_sizeof_VkStructureType(&pnext->sType);
1006bf215546Sopenharmony_ci            size += vn_sizeof_VkMemoryRequirements2_pnext_partial(pnext->pNext);
1007bf215546Sopenharmony_ci            size += vn_sizeof_VkMemoryDedicatedRequirements_self_partial((const VkMemoryDedicatedRequirements *)pnext);
1008bf215546Sopenharmony_ci            return size;
1009bf215546Sopenharmony_ci        default:
1010bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
1011bf215546Sopenharmony_ci            break;
1012bf215546Sopenharmony_ci        }
1013bf215546Sopenharmony_ci        pnext = pnext->pNext;
1014bf215546Sopenharmony_ci    }
1015bf215546Sopenharmony_ci
1016bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
1017bf215546Sopenharmony_ci}
1018bf215546Sopenharmony_ci
1019bf215546Sopenharmony_cistatic inline size_t
1020bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2_self_partial(const VkMemoryRequirements2 *val)
1021bf215546Sopenharmony_ci{
1022bf215546Sopenharmony_ci    size_t size = 0;
1023bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
1024bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements_partial(&val->memoryRequirements);
1025bf215546Sopenharmony_ci    return size;
1026bf215546Sopenharmony_ci}
1027bf215546Sopenharmony_ci
1028bf215546Sopenharmony_cistatic inline size_t
1029bf215546Sopenharmony_civn_sizeof_VkMemoryRequirements2_partial(const VkMemoryRequirements2 *val)
1030bf215546Sopenharmony_ci{
1031bf215546Sopenharmony_ci    size_t size = 0;
1032bf215546Sopenharmony_ci
1033bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
1034bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements2_pnext_partial(val->pNext);
1035bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryRequirements2_self_partial(val);
1036bf215546Sopenharmony_ci
1037bf215546Sopenharmony_ci    return size;
1038bf215546Sopenharmony_ci}
1039bf215546Sopenharmony_ci
1040bf215546Sopenharmony_cistatic inline void
1041bf215546Sopenharmony_civn_encode_VkMemoryRequirements2_pnext_partial(struct vn_cs_encoder *enc, const void *val)
1042bf215546Sopenharmony_ci{
1043bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
1044bf215546Sopenharmony_ci
1045bf215546Sopenharmony_ci    while (pnext) {
1046bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
1047bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
1048bf215546Sopenharmony_ci            vn_encode_simple_pointer(enc, pnext);
1049bf215546Sopenharmony_ci            vn_encode_VkStructureType(enc, &pnext->sType);
1050bf215546Sopenharmony_ci            vn_encode_VkMemoryRequirements2_pnext_partial(enc, pnext->pNext);
1051bf215546Sopenharmony_ci            vn_encode_VkMemoryDedicatedRequirements_self_partial(enc, (const VkMemoryDedicatedRequirements *)pnext);
1052bf215546Sopenharmony_ci            return;
1053bf215546Sopenharmony_ci        default:
1054bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
1055bf215546Sopenharmony_ci            break;
1056bf215546Sopenharmony_ci        }
1057bf215546Sopenharmony_ci        pnext = pnext->pNext;
1058bf215546Sopenharmony_ci    }
1059bf215546Sopenharmony_ci
1060bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
1061bf215546Sopenharmony_ci}
1062bf215546Sopenharmony_ci
1063bf215546Sopenharmony_cistatic inline void
1064bf215546Sopenharmony_civn_encode_VkMemoryRequirements2_self_partial(struct vn_cs_encoder *enc, const VkMemoryRequirements2 *val)
1065bf215546Sopenharmony_ci{
1066bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
1067bf215546Sopenharmony_ci    vn_encode_VkMemoryRequirements_partial(enc, &val->memoryRequirements);
1068bf215546Sopenharmony_ci}
1069bf215546Sopenharmony_ci
1070bf215546Sopenharmony_cistatic inline void
1071bf215546Sopenharmony_civn_encode_VkMemoryRequirements2_partial(struct vn_cs_encoder *enc, const VkMemoryRequirements2 *val)
1072bf215546Sopenharmony_ci{
1073bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2);
1074bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 });
1075bf215546Sopenharmony_ci    vn_encode_VkMemoryRequirements2_pnext_partial(enc, val->pNext);
1076bf215546Sopenharmony_ci    vn_encode_VkMemoryRequirements2_self_partial(enc, val);
1077bf215546Sopenharmony_ci}
1078bf215546Sopenharmony_ci
1079bf215546Sopenharmony_ci/* struct VkMemoryBarrier2 chain */
1080bf215546Sopenharmony_ci
1081bf215546Sopenharmony_cistatic inline size_t
1082bf215546Sopenharmony_civn_sizeof_VkMemoryBarrier2_pnext(const void *val)
1083bf215546Sopenharmony_ci{
1084bf215546Sopenharmony_ci    /* no known/supported struct */
1085bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
1086bf215546Sopenharmony_ci}
1087bf215546Sopenharmony_ci
1088bf215546Sopenharmony_cistatic inline size_t
1089bf215546Sopenharmony_civn_sizeof_VkMemoryBarrier2_self(const VkMemoryBarrier2 *val)
1090bf215546Sopenharmony_ci{
1091bf215546Sopenharmony_ci    size_t size = 0;
1092bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
1093bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags64(&val->srcStageMask);
1094bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags64(&val->srcAccessMask);
1095bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags64(&val->dstStageMask);
1096bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags64(&val->dstAccessMask);
1097bf215546Sopenharmony_ci    return size;
1098bf215546Sopenharmony_ci}
1099bf215546Sopenharmony_ci
1100bf215546Sopenharmony_cistatic inline size_t
1101bf215546Sopenharmony_civn_sizeof_VkMemoryBarrier2(const VkMemoryBarrier2 *val)
1102bf215546Sopenharmony_ci{
1103bf215546Sopenharmony_ci    size_t size = 0;
1104bf215546Sopenharmony_ci
1105bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
1106bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryBarrier2_pnext(val->pNext);
1107bf215546Sopenharmony_ci    size += vn_sizeof_VkMemoryBarrier2_self(val);
1108bf215546Sopenharmony_ci
1109bf215546Sopenharmony_ci    return size;
1110bf215546Sopenharmony_ci}
1111bf215546Sopenharmony_ci
1112bf215546Sopenharmony_cistatic inline void
1113bf215546Sopenharmony_civn_encode_VkMemoryBarrier2_pnext(struct vn_cs_encoder *enc, const void *val)
1114bf215546Sopenharmony_ci{
1115bf215546Sopenharmony_ci    /* no known/supported struct */
1116bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
1117bf215546Sopenharmony_ci}
1118bf215546Sopenharmony_ci
1119bf215546Sopenharmony_cistatic inline void
1120bf215546Sopenharmony_civn_encode_VkMemoryBarrier2_self(struct vn_cs_encoder *enc, const VkMemoryBarrier2 *val)
1121bf215546Sopenharmony_ci{
1122bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
1123bf215546Sopenharmony_ci    vn_encode_VkFlags64(enc, &val->srcStageMask);
1124bf215546Sopenharmony_ci    vn_encode_VkFlags64(enc, &val->srcAccessMask);
1125bf215546Sopenharmony_ci    vn_encode_VkFlags64(enc, &val->dstStageMask);
1126bf215546Sopenharmony_ci    vn_encode_VkFlags64(enc, &val->dstAccessMask);
1127bf215546Sopenharmony_ci}
1128bf215546Sopenharmony_ci
1129bf215546Sopenharmony_cistatic inline void
1130bf215546Sopenharmony_civn_encode_VkMemoryBarrier2(struct vn_cs_encoder *enc, const VkMemoryBarrier2 *val)
1131bf215546Sopenharmony_ci{
1132bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_BARRIER_2);
1133bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_BARRIER_2 });
1134bf215546Sopenharmony_ci    vn_encode_VkMemoryBarrier2_pnext(enc, val->pNext);
1135bf215546Sopenharmony_ci    vn_encode_VkMemoryBarrier2_self(enc, val);
1136bf215546Sopenharmony_ci}
1137bf215546Sopenharmony_ci
1138bf215546Sopenharmony_ci#endif /* VN_PROTOCOL_DRIVER_STRUCTS_H */
1139