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_TRANSPORT_H
9#define VN_PROTOCOL_DRIVER_TRANSPORT_H
10
11#include "vn_instance.h"
12#include "vn_protocol_driver_structs.h"
13
14/*
15 * These structs/unions/commands are not included
16 *
17 *   vkGetMemoryFdKHR
18 *   vkGetMemoryFdPropertiesKHR
19 */
20
21/* struct VkCommandStreamDescriptionMESA */
22
23static inline size_t
24vn_sizeof_VkCommandStreamDescriptionMESA(const VkCommandStreamDescriptionMESA *val)
25{
26    size_t size = 0;
27    size += vn_sizeof_uint32_t(&val->resourceId);
28    size += vn_sizeof_size_t(&val->offset);
29    size += vn_sizeof_size_t(&val->size);
30    return size;
31}
32
33static inline void
34vn_encode_VkCommandStreamDescriptionMESA(struct vn_cs_encoder *enc, const VkCommandStreamDescriptionMESA *val)
35{
36    vn_encode_uint32_t(enc, &val->resourceId);
37    vn_encode_size_t(enc, &val->offset);
38    vn_encode_size_t(enc, &val->size);
39}
40
41/* struct VkCommandStreamDependencyMESA */
42
43static inline size_t
44vn_sizeof_VkCommandStreamDependencyMESA(const VkCommandStreamDependencyMESA *val)
45{
46    size_t size = 0;
47    size += vn_sizeof_uint32_t(&val->srcCommandStream);
48    size += vn_sizeof_uint32_t(&val->dstCommandStream);
49    return size;
50}
51
52static inline void
53vn_encode_VkCommandStreamDependencyMESA(struct vn_cs_encoder *enc, const VkCommandStreamDependencyMESA *val)
54{
55    vn_encode_uint32_t(enc, &val->srcCommandStream);
56    vn_encode_uint32_t(enc, &val->dstCommandStream);
57}
58
59/* struct VkRingCreateInfoMESA chain */
60
61static inline size_t
62vn_sizeof_VkRingCreateInfoMESA_pnext(const void *val)
63{
64    /* no known/supported struct */
65    return vn_sizeof_simple_pointer(NULL);
66}
67
68static inline size_t
69vn_sizeof_VkRingCreateInfoMESA_self(const VkRingCreateInfoMESA *val)
70{
71    size_t size = 0;
72    /* skip val->{sType,pNext} */
73    size += vn_sizeof_VkFlags(&val->flags);
74    size += vn_sizeof_uint32_t(&val->resourceId);
75    size += vn_sizeof_size_t(&val->offset);
76    size += vn_sizeof_size_t(&val->size);
77    size += vn_sizeof_uint64_t(&val->idleTimeout);
78    size += vn_sizeof_size_t(&val->headOffset);
79    size += vn_sizeof_size_t(&val->tailOffset);
80    size += vn_sizeof_size_t(&val->statusOffset);
81    size += vn_sizeof_size_t(&val->bufferOffset);
82    size += vn_sizeof_size_t(&val->bufferSize);
83    size += vn_sizeof_size_t(&val->extraOffset);
84    size += vn_sizeof_size_t(&val->extraSize);
85    return size;
86}
87
88static inline size_t
89vn_sizeof_VkRingCreateInfoMESA(const VkRingCreateInfoMESA *val)
90{
91    size_t size = 0;
92
93    size += vn_sizeof_VkStructureType(&val->sType);
94    size += vn_sizeof_VkRingCreateInfoMESA_pnext(val->pNext);
95    size += vn_sizeof_VkRingCreateInfoMESA_self(val);
96
97    return size;
98}
99
100static inline void
101vn_encode_VkRingCreateInfoMESA_pnext(struct vn_cs_encoder *enc, const void *val)
102{
103    /* no known/supported struct */
104    vn_encode_simple_pointer(enc, NULL);
105}
106
107static inline void
108vn_encode_VkRingCreateInfoMESA_self(struct vn_cs_encoder *enc, const VkRingCreateInfoMESA *val)
109{
110    /* skip val->{sType,pNext} */
111    vn_encode_VkFlags(enc, &val->flags);
112    vn_encode_uint32_t(enc, &val->resourceId);
113    vn_encode_size_t(enc, &val->offset);
114    vn_encode_size_t(enc, &val->size);
115    vn_encode_uint64_t(enc, &val->idleTimeout);
116    vn_encode_size_t(enc, &val->headOffset);
117    vn_encode_size_t(enc, &val->tailOffset);
118    vn_encode_size_t(enc, &val->statusOffset);
119    vn_encode_size_t(enc, &val->bufferOffset);
120    vn_encode_size_t(enc, &val->bufferSize);
121    vn_encode_size_t(enc, &val->extraOffset);
122    vn_encode_size_t(enc, &val->extraSize);
123}
124
125static inline void
126vn_encode_VkRingCreateInfoMESA(struct vn_cs_encoder *enc, const VkRingCreateInfoMESA *val)
127{
128    assert(val->sType == VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA);
129    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA });
130    vn_encode_VkRingCreateInfoMESA_pnext(enc, val->pNext);
131    vn_encode_VkRingCreateInfoMESA_self(enc, val);
132}
133
134/* struct VkMemoryResourceAllocationSizeProperties100000MESA chain */
135
136static inline size_t
137vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(const void *val)
138{
139    /* no known/supported struct */
140    return vn_sizeof_simple_pointer(NULL);
141}
142
143static inline size_t
144vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self(const VkMemoryResourceAllocationSizeProperties100000MESA *val)
145{
146    size_t size = 0;
147    /* skip val->{sType,pNext} */
148    size += vn_sizeof_uint64_t(&val->allocationSize);
149    return size;
150}
151
152static inline size_t
153vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA(const VkMemoryResourceAllocationSizeProperties100000MESA *val)
154{
155    size_t size = 0;
156
157    size += vn_sizeof_VkStructureType(&val->sType);
158    size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(val->pNext);
159    size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self(val);
160
161    return size;
162}
163
164static inline void
165vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(struct vn_cs_decoder *dec, const void *val)
166{
167    /* no known/supported struct */
168    if (vn_decode_simple_pointer(dec))
169        assert(false);
170}
171
172static inline void
173vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val)
174{
175    /* skip val->{sType,pNext} */
176    vn_decode_uint64_t(dec, &val->allocationSize);
177}
178
179static inline void
180vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val)
181{
182    VkStructureType stype;
183    vn_decode_VkStructureType(dec, &stype);
184    assert(stype == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA);
185
186    assert(val->sType == stype);
187    vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(dec, val->pNext);
188    vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self(dec, val);
189}
190
191static inline size_t
192vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial(const void *val)
193{
194    /* no known/supported struct */
195    return vn_sizeof_simple_pointer(NULL);
196}
197
198static inline size_t
199vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial(const VkMemoryResourceAllocationSizeProperties100000MESA *val)
200{
201    size_t size = 0;
202    /* skip val->{sType,pNext} */
203    /* skip val->allocationSize */
204    return size;
205}
206
207static inline size_t
208vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_partial(const VkMemoryResourceAllocationSizeProperties100000MESA *val)
209{
210    size_t size = 0;
211
212    size += vn_sizeof_VkStructureType(&val->sType);
213    size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial(val->pNext);
214    size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial(val);
215
216    return size;
217}
218
219static inline void
220vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial(struct vn_cs_encoder *enc, const void *val)
221{
222    /* no known/supported struct */
223    vn_encode_simple_pointer(enc, NULL);
224}
225
226static inline void
227vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val)
228{
229    /* skip val->{sType,pNext} */
230    /* skip val->allocationSize */
231}
232
233static inline void
234vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_partial(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val)
235{
236    assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA);
237    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA });
238    vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial(enc, val->pNext);
239    vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial(enc, val);
240}
241
242/* struct VkMemoryResourcePropertiesMESA chain */
243
244static inline size_t
245vn_sizeof_VkMemoryResourcePropertiesMESA_pnext(const void *val)
246{
247    const VkBaseInStructure *pnext = val;
248    size_t size = 0;
249
250    while (pnext) {
251        switch ((int32_t)pnext->sType) {
252        case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
253            size += vn_sizeof_simple_pointer(pnext);
254            size += vn_sizeof_VkStructureType(&pnext->sType);
255            size += vn_sizeof_VkMemoryResourcePropertiesMESA_pnext(pnext->pNext);
256            size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self((const VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
257            return size;
258        default:
259            /* ignore unknown/unsupported struct */
260            break;
261        }
262        pnext = pnext->pNext;
263    }
264
265    return vn_sizeof_simple_pointer(NULL);
266}
267
268static inline size_t
269vn_sizeof_VkMemoryResourcePropertiesMESA_self(const VkMemoryResourcePropertiesMESA *val)
270{
271    size_t size = 0;
272    /* skip val->{sType,pNext} */
273    size += vn_sizeof_uint32_t(&val->memoryTypeBits);
274    return size;
275}
276
277static inline size_t
278vn_sizeof_VkMemoryResourcePropertiesMESA(const VkMemoryResourcePropertiesMESA *val)
279{
280    size_t size = 0;
281
282    size += vn_sizeof_VkStructureType(&val->sType);
283    size += vn_sizeof_VkMemoryResourcePropertiesMESA_pnext(val->pNext);
284    size += vn_sizeof_VkMemoryResourcePropertiesMESA_self(val);
285
286    return size;
287}
288
289static inline void
290vn_decode_VkMemoryResourcePropertiesMESA_pnext(struct vn_cs_decoder *dec, const void *val)
291{
292    VkBaseOutStructure *pnext = (VkBaseOutStructure *)val;
293    VkStructureType stype;
294
295    if (!vn_decode_simple_pointer(dec))
296        return;
297
298    vn_decode_VkStructureType(dec, &stype);
299    while (true) {
300        assert(pnext);
301        if (pnext->sType == stype)
302            break;
303    }
304
305    switch ((int32_t)pnext->sType) {
306    case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
307        vn_decode_VkMemoryResourcePropertiesMESA_pnext(dec, pnext->pNext);
308        vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self(dec, (VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
309        break;
310    default:
311        assert(false);
312        break;
313    }
314}
315
316static inline void
317vn_decode_VkMemoryResourcePropertiesMESA_self(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
318{
319    /* skip val->{sType,pNext} */
320    vn_decode_uint32_t(dec, &val->memoryTypeBits);
321}
322
323static inline void
324vn_decode_VkMemoryResourcePropertiesMESA(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
325{
326    VkStructureType stype;
327    vn_decode_VkStructureType(dec, &stype);
328    assert(stype == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA);
329
330    assert(val->sType == stype);
331    vn_decode_VkMemoryResourcePropertiesMESA_pnext(dec, val->pNext);
332    vn_decode_VkMemoryResourcePropertiesMESA_self(dec, val);
333}
334
335static inline size_t
336vn_sizeof_VkMemoryResourcePropertiesMESA_pnext_partial(const void *val)
337{
338    const VkBaseInStructure *pnext = val;
339    size_t size = 0;
340
341    while (pnext) {
342        switch ((int32_t)pnext->sType) {
343        case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
344            size += vn_sizeof_simple_pointer(pnext);
345            size += vn_sizeof_VkStructureType(&pnext->sType);
346            size += vn_sizeof_VkMemoryResourcePropertiesMESA_pnext_partial(pnext->pNext);
347            size += vn_sizeof_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial((const VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
348            return size;
349        default:
350            /* ignore unknown/unsupported struct */
351            break;
352        }
353        pnext = pnext->pNext;
354    }
355
356    return vn_sizeof_simple_pointer(NULL);
357}
358
359static inline size_t
360vn_sizeof_VkMemoryResourcePropertiesMESA_self_partial(const VkMemoryResourcePropertiesMESA *val)
361{
362    size_t size = 0;
363    /* skip val->{sType,pNext} */
364    /* skip val->memoryTypeBits */
365    return size;
366}
367
368static inline size_t
369vn_sizeof_VkMemoryResourcePropertiesMESA_partial(const VkMemoryResourcePropertiesMESA *val)
370{
371    size_t size = 0;
372
373    size += vn_sizeof_VkStructureType(&val->sType);
374    size += vn_sizeof_VkMemoryResourcePropertiesMESA_pnext_partial(val->pNext);
375    size += vn_sizeof_VkMemoryResourcePropertiesMESA_self_partial(val);
376
377    return size;
378}
379
380static inline void
381vn_encode_VkMemoryResourcePropertiesMESA_pnext_partial(struct vn_cs_encoder *enc, const void *val)
382{
383    const VkBaseInStructure *pnext = val;
384
385    while (pnext) {
386        switch ((int32_t)pnext->sType) {
387        case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
388            vn_encode_simple_pointer(enc, pnext);
389            vn_encode_VkStructureType(enc, &pnext->sType);
390            vn_encode_VkMemoryResourcePropertiesMESA_pnext_partial(enc, pnext->pNext);
391            vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial(enc, (const VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
392            return;
393        default:
394            /* ignore unknown/unsupported struct */
395            break;
396        }
397        pnext = pnext->pNext;
398    }
399
400    vn_encode_simple_pointer(enc, NULL);
401}
402
403static inline void
404vn_encode_VkMemoryResourcePropertiesMESA_self_partial(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
405{
406    /* skip val->{sType,pNext} */
407    /* skip val->memoryTypeBits */
408}
409
410static inline void
411vn_encode_VkMemoryResourcePropertiesMESA_partial(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
412{
413    assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA);
414    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA });
415    vn_encode_VkMemoryResourcePropertiesMESA_pnext_partial(enc, val->pNext);
416    vn_encode_VkMemoryResourcePropertiesMESA_self_partial(enc, val);
417}
418
419static inline size_t vn_sizeof_vkSetReplyCommandStreamMESA(const VkCommandStreamDescriptionMESA* pStream)
420{
421    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT;
422    const VkFlags cmd_flags = 0;
423    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
424
425    cmd_size += vn_sizeof_simple_pointer(pStream);
426    if (pStream)
427        cmd_size += vn_sizeof_VkCommandStreamDescriptionMESA(pStream);
428
429    return cmd_size;
430}
431
432static inline void vn_encode_vkSetReplyCommandStreamMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, const VkCommandStreamDescriptionMESA* pStream)
433{
434    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT;
435
436    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
437    vn_encode_VkFlags(enc, &cmd_flags);
438
439    if (vn_encode_simple_pointer(enc, pStream))
440        vn_encode_VkCommandStreamDescriptionMESA(enc, pStream);
441}
442
443static inline size_t vn_sizeof_vkSetReplyCommandStreamMESA_reply(const VkCommandStreamDescriptionMESA* pStream)
444{
445    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT;
446    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
447
448    /* skip pStream */
449
450    return cmd_size;
451}
452
453static inline void vn_decode_vkSetReplyCommandStreamMESA_reply(struct vn_cs_decoder *dec, const VkCommandStreamDescriptionMESA* pStream)
454{
455    VkCommandTypeEXT command_type;
456    vn_decode_VkCommandTypeEXT(dec, &command_type);
457    assert(command_type == VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT);
458
459    /* skip pStream */
460}
461
462static inline size_t vn_sizeof_vkSeekReplyCommandStreamMESA(size_t position)
463{
464    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT;
465    const VkFlags cmd_flags = 0;
466    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
467
468    cmd_size += vn_sizeof_size_t(&position);
469
470    return cmd_size;
471}
472
473static inline void vn_encode_vkSeekReplyCommandStreamMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, size_t position)
474{
475    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT;
476
477    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
478    vn_encode_VkFlags(enc, &cmd_flags);
479
480    vn_encode_size_t(enc, &position);
481}
482
483static inline size_t vn_sizeof_vkSeekReplyCommandStreamMESA_reply(size_t position)
484{
485    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT;
486    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
487
488    /* skip position */
489
490    return cmd_size;
491}
492
493static inline void vn_decode_vkSeekReplyCommandStreamMESA_reply(struct vn_cs_decoder *dec, size_t position)
494{
495    VkCommandTypeEXT command_type;
496    vn_decode_VkCommandTypeEXT(dec, &command_type);
497    assert(command_type == VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT);
498
499    /* skip position */
500}
501
502static inline size_t vn_sizeof_vkExecuteCommandStreamsMESA(uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
503{
504    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT;
505    const VkFlags cmd_flags = 0;
506    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
507
508    cmd_size += vn_sizeof_uint32_t(&streamCount);
509    if (pStreams) {
510        cmd_size += vn_sizeof_array_size(streamCount);
511        for (uint32_t i = 0; i < streamCount; i++)
512            cmd_size += vn_sizeof_VkCommandStreamDescriptionMESA(&pStreams[i]);
513    } else {
514        cmd_size += vn_sizeof_array_size(0);
515    }
516    if (pReplyPositions) {
517        cmd_size += vn_sizeof_array_size(streamCount);
518        cmd_size += vn_sizeof_size_t_array(pReplyPositions, streamCount);
519    } else {
520        cmd_size += vn_sizeof_array_size(0);
521    }
522    cmd_size += vn_sizeof_uint32_t(&dependencyCount);
523    if (pDependencies) {
524        cmd_size += vn_sizeof_array_size(dependencyCount);
525        for (uint32_t i = 0; i < dependencyCount; i++)
526            cmd_size += vn_sizeof_VkCommandStreamDependencyMESA(&pDependencies[i]);
527    } else {
528        cmd_size += vn_sizeof_array_size(0);
529    }
530    cmd_size += vn_sizeof_VkFlags(&flags);
531
532    return cmd_size;
533}
534
535static inline void vn_encode_vkExecuteCommandStreamsMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
536{
537    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT;
538
539    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
540    vn_encode_VkFlags(enc, &cmd_flags);
541
542    vn_encode_uint32_t(enc, &streamCount);
543    if (pStreams) {
544        vn_encode_array_size(enc, streamCount);
545        for (uint32_t i = 0; i < streamCount; i++)
546            vn_encode_VkCommandStreamDescriptionMESA(enc, &pStreams[i]);
547    } else {
548        vn_encode_array_size(enc, 0);
549    }
550    if (pReplyPositions) {
551        vn_encode_array_size(enc, streamCount);
552        vn_encode_size_t_array(enc, pReplyPositions, streamCount);
553    } else {
554        vn_encode_array_size(enc, 0);
555    }
556    vn_encode_uint32_t(enc, &dependencyCount);
557    if (pDependencies) {
558        vn_encode_array_size(enc, dependencyCount);
559        for (uint32_t i = 0; i < dependencyCount; i++)
560            vn_encode_VkCommandStreamDependencyMESA(enc, &pDependencies[i]);
561    } else {
562        vn_encode_array_size(enc, 0);
563    }
564    vn_encode_VkFlags(enc, &flags);
565}
566
567static inline size_t vn_sizeof_vkExecuteCommandStreamsMESA_reply(uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
568{
569    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT;
570    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
571
572    /* skip streamCount */
573    /* skip pStreams */
574    /* skip pReplyPositions */
575    /* skip dependencyCount */
576    /* skip pDependencies */
577    /* skip flags */
578
579    return cmd_size;
580}
581
582static inline void vn_decode_vkExecuteCommandStreamsMESA_reply(struct vn_cs_decoder *dec, uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
583{
584    VkCommandTypeEXT command_type;
585    vn_decode_VkCommandTypeEXT(dec, &command_type);
586    assert(command_type == VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT);
587
588    /* skip streamCount */
589    /* skip pStreams */
590    /* skip pReplyPositions */
591    /* skip dependencyCount */
592    /* skip pDependencies */
593    /* skip flags */
594}
595
596static inline size_t vn_sizeof_vkCreateRingMESA(uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
597{
598    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRingMESA_EXT;
599    const VkFlags cmd_flags = 0;
600    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
601
602    cmd_size += vn_sizeof_uint64_t(&ring);
603    cmd_size += vn_sizeof_simple_pointer(pCreateInfo);
604    if (pCreateInfo)
605        cmd_size += vn_sizeof_VkRingCreateInfoMESA(pCreateInfo);
606
607    return cmd_size;
608}
609
610static inline void vn_encode_vkCreateRingMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
611{
612    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRingMESA_EXT;
613
614    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
615    vn_encode_VkFlags(enc, &cmd_flags);
616
617    vn_encode_uint64_t(enc, &ring);
618    if (vn_encode_simple_pointer(enc, pCreateInfo))
619        vn_encode_VkRingCreateInfoMESA(enc, pCreateInfo);
620}
621
622static inline size_t vn_sizeof_vkCreateRingMESA_reply(uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
623{
624    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateRingMESA_EXT;
625    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
626
627    /* skip ring */
628    /* skip pCreateInfo */
629
630    return cmd_size;
631}
632
633static inline void vn_decode_vkCreateRingMESA_reply(struct vn_cs_decoder *dec, uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
634{
635    VkCommandTypeEXT command_type;
636    vn_decode_VkCommandTypeEXT(dec, &command_type);
637    assert(command_type == VK_COMMAND_TYPE_vkCreateRingMESA_EXT);
638
639    /* skip ring */
640    /* skip pCreateInfo */
641}
642
643static inline size_t vn_sizeof_vkDestroyRingMESA(uint64_t ring)
644{
645    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRingMESA_EXT;
646    const VkFlags cmd_flags = 0;
647    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
648
649    cmd_size += vn_sizeof_uint64_t(&ring);
650
651    return cmd_size;
652}
653
654static inline void vn_encode_vkDestroyRingMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, uint64_t ring)
655{
656    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRingMESA_EXT;
657
658    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
659    vn_encode_VkFlags(enc, &cmd_flags);
660
661    vn_encode_uint64_t(enc, &ring);
662}
663
664static inline size_t vn_sizeof_vkDestroyRingMESA_reply(uint64_t ring)
665{
666    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyRingMESA_EXT;
667    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
668
669    /* skip ring */
670
671    return cmd_size;
672}
673
674static inline void vn_decode_vkDestroyRingMESA_reply(struct vn_cs_decoder *dec, uint64_t ring)
675{
676    VkCommandTypeEXT command_type;
677    vn_decode_VkCommandTypeEXT(dec, &command_type);
678    assert(command_type == VK_COMMAND_TYPE_vkDestroyRingMESA_EXT);
679
680    /* skip ring */
681}
682
683static inline size_t vn_sizeof_vkNotifyRingMESA(uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
684{
685    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkNotifyRingMESA_EXT;
686    const VkFlags cmd_flags = 0;
687    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
688
689    cmd_size += vn_sizeof_uint64_t(&ring);
690    cmd_size += vn_sizeof_uint32_t(&seqno);
691    cmd_size += vn_sizeof_VkFlags(&flags);
692
693    return cmd_size;
694}
695
696static inline void vn_encode_vkNotifyRingMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
697{
698    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkNotifyRingMESA_EXT;
699
700    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
701    vn_encode_VkFlags(enc, &cmd_flags);
702
703    vn_encode_uint64_t(enc, &ring);
704    vn_encode_uint32_t(enc, &seqno);
705    vn_encode_VkFlags(enc, &flags);
706}
707
708static inline size_t vn_sizeof_vkNotifyRingMESA_reply(uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
709{
710    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkNotifyRingMESA_EXT;
711    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
712
713    /* skip ring */
714    /* skip seqno */
715    /* skip flags */
716
717    return cmd_size;
718}
719
720static inline void vn_decode_vkNotifyRingMESA_reply(struct vn_cs_decoder *dec, uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
721{
722    VkCommandTypeEXT command_type;
723    vn_decode_VkCommandTypeEXT(dec, &command_type);
724    assert(command_type == VK_COMMAND_TYPE_vkNotifyRingMESA_EXT);
725
726    /* skip ring */
727    /* skip seqno */
728    /* skip flags */
729}
730
731static inline size_t vn_sizeof_vkWriteRingExtraMESA(uint64_t ring, size_t offset, uint32_t value)
732{
733    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT;
734    const VkFlags cmd_flags = 0;
735    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
736
737    cmd_size += vn_sizeof_uint64_t(&ring);
738    cmd_size += vn_sizeof_size_t(&offset);
739    cmd_size += vn_sizeof_uint32_t(&value);
740
741    return cmd_size;
742}
743
744static inline void vn_encode_vkWriteRingExtraMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, uint64_t ring, size_t offset, uint32_t value)
745{
746    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT;
747
748    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
749    vn_encode_VkFlags(enc, &cmd_flags);
750
751    vn_encode_uint64_t(enc, &ring);
752    vn_encode_size_t(enc, &offset);
753    vn_encode_uint32_t(enc, &value);
754}
755
756static inline size_t vn_sizeof_vkWriteRingExtraMESA_reply(uint64_t ring, size_t offset, uint32_t value)
757{
758    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT;
759    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
760
761    /* skip ring */
762    /* skip offset */
763    /* skip value */
764
765    return cmd_size;
766}
767
768static inline void vn_decode_vkWriteRingExtraMESA_reply(struct vn_cs_decoder *dec, uint64_t ring, size_t offset, uint32_t value)
769{
770    VkCommandTypeEXT command_type;
771    vn_decode_VkCommandTypeEXT(dec, &command_type);
772    assert(command_type == VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT);
773
774    /* skip ring */
775    /* skip offset */
776    /* skip value */
777}
778
779static inline size_t vn_sizeof_vkGetMemoryResourcePropertiesMESA(VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
780{
781    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT;
782    const VkFlags cmd_flags = 0;
783    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
784
785    cmd_size += vn_sizeof_VkDevice(&device);
786    cmd_size += vn_sizeof_uint32_t(&resourceId);
787    cmd_size += vn_sizeof_simple_pointer(pMemoryResourceProperties);
788    if (pMemoryResourceProperties)
789        cmd_size += vn_sizeof_VkMemoryResourcePropertiesMESA_partial(pMemoryResourceProperties);
790
791    return cmd_size;
792}
793
794static inline void vn_encode_vkGetMemoryResourcePropertiesMESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
795{
796    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT;
797
798    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
799    vn_encode_VkFlags(enc, &cmd_flags);
800
801    vn_encode_VkDevice(enc, &device);
802    vn_encode_uint32_t(enc, &resourceId);
803    if (vn_encode_simple_pointer(enc, pMemoryResourceProperties))
804        vn_encode_VkMemoryResourcePropertiesMESA_partial(enc, pMemoryResourceProperties);
805}
806
807static inline size_t vn_sizeof_vkGetMemoryResourcePropertiesMESA_reply(VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
808{
809    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT;
810    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
811
812    VkResult ret;
813    cmd_size += vn_sizeof_VkResult(&ret);
814    /* skip device */
815    /* skip resourceId */
816    cmd_size += vn_sizeof_simple_pointer(pMemoryResourceProperties);
817    if (pMemoryResourceProperties)
818        cmd_size += vn_sizeof_VkMemoryResourcePropertiesMESA(pMemoryResourceProperties);
819
820    return cmd_size;
821}
822
823static inline VkResult vn_decode_vkGetMemoryResourcePropertiesMESA_reply(struct vn_cs_decoder *dec, VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
824{
825    VkCommandTypeEXT command_type;
826    vn_decode_VkCommandTypeEXT(dec, &command_type);
827    assert(command_type == VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT);
828
829    VkResult ret;
830    vn_decode_VkResult(dec, &ret);
831    /* skip device */
832    /* skip resourceId */
833    if (vn_decode_simple_pointer(dec)) {
834        vn_decode_VkMemoryResourcePropertiesMESA(dec, pMemoryResourceProperties);
835    } else {
836        pMemoryResourceProperties = NULL;
837    }
838
839    return ret;
840}
841
842static inline size_t vn_sizeof_vkGetVenusExperimentalFeatureData100000MESA(size_t* pDataSize, void* pData)
843{
844    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT;
845    const VkFlags cmd_flags = 0;
846    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
847
848    cmd_size += vn_sizeof_simple_pointer(pDataSize);
849    if (pDataSize)
850        cmd_size += vn_sizeof_size_t(pDataSize);
851    cmd_size += vn_sizeof_simple_pointer(pData); /* out */
852
853    return cmd_size;
854}
855
856static inline void vn_encode_vkGetVenusExperimentalFeatureData100000MESA(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, size_t* pDataSize, void* pData)
857{
858    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT;
859
860    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
861    vn_encode_VkFlags(enc, &cmd_flags);
862
863    if (vn_encode_simple_pointer(enc, pDataSize))
864        vn_encode_size_t(enc, pDataSize);
865    vn_encode_array_size(enc, pData ? (pDataSize ? *pDataSize : 0) : 0); /* out */
866}
867
868static inline size_t vn_sizeof_vkGetVenusExperimentalFeatureData100000MESA_reply(size_t* pDataSize, void* pData)
869{
870    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT;
871    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
872
873    cmd_size += vn_sizeof_simple_pointer(pDataSize);
874    if (pDataSize)
875        cmd_size += vn_sizeof_size_t(pDataSize);
876    if (pData) {
877        cmd_size += vn_sizeof_array_size((pDataSize ? *pDataSize : 0));
878        cmd_size += vn_sizeof_blob_array(pData, (pDataSize ? *pDataSize : 0));
879    } else {
880        cmd_size += vn_sizeof_array_size(0);
881    }
882
883    return cmd_size;
884}
885
886static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_reply(struct vn_cs_decoder *dec, size_t* pDataSize, void* pData)
887{
888    VkCommandTypeEXT command_type;
889    vn_decode_VkCommandTypeEXT(dec, &command_type);
890    assert(command_type == VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT);
891
892    if (vn_decode_simple_pointer(dec)) {
893        vn_decode_size_t(dec, pDataSize);
894    } else {
895        pDataSize = NULL;
896    }
897    if (vn_peek_array_size(dec)) {
898        const size_t array_size = vn_decode_array_size(dec, (pDataSize ? *pDataSize : 0));
899        vn_decode_blob_array(dec, pData, array_size);
900    } else {
901        vn_decode_array_size_unchecked(dec);
902        pData = NULL;
903    }
904}
905
906static inline void vn_submit_vkSetReplyCommandStreamMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, const VkCommandStreamDescriptionMESA* pStream, struct vn_instance_submit_command *submit)
907{
908    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
909    void *cmd_data = local_cmd_data;
910    size_t cmd_size = vn_sizeof_vkSetReplyCommandStreamMESA(pStream);
911    if (cmd_size > sizeof(local_cmd_data)) {
912        cmd_data = malloc(cmd_size);
913        if (!cmd_data)
914            cmd_size = 0;
915    }
916    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkSetReplyCommandStreamMESA_reply(pStream) : 0;
917
918    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
919    if (cmd_size) {
920        vn_encode_vkSetReplyCommandStreamMESA(enc, cmd_flags, pStream);
921        vn_instance_submit_command(vn_instance, submit);
922        if (cmd_data != local_cmd_data)
923            free(cmd_data);
924    }
925}
926
927static inline void vn_submit_vkSeekReplyCommandStreamMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, size_t position, struct vn_instance_submit_command *submit)
928{
929    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
930    void *cmd_data = local_cmd_data;
931    size_t cmd_size = vn_sizeof_vkSeekReplyCommandStreamMESA(position);
932    if (cmd_size > sizeof(local_cmd_data)) {
933        cmd_data = malloc(cmd_size);
934        if (!cmd_data)
935            cmd_size = 0;
936    }
937    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkSeekReplyCommandStreamMESA_reply(position) : 0;
938
939    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
940    if (cmd_size) {
941        vn_encode_vkSeekReplyCommandStreamMESA(enc, cmd_flags, position);
942        vn_instance_submit_command(vn_instance, submit);
943        if (cmd_data != local_cmd_data)
944            free(cmd_data);
945    }
946}
947
948static inline void vn_submit_vkExecuteCommandStreamsMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags, struct vn_instance_submit_command *submit)
949{
950    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
951    void *cmd_data = local_cmd_data;
952    size_t cmd_size = vn_sizeof_vkExecuteCommandStreamsMESA(streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags);
953    if (cmd_size > sizeof(local_cmd_data)) {
954        cmd_data = malloc(cmd_size);
955        if (!cmd_data)
956            cmd_size = 0;
957    }
958    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkExecuteCommandStreamsMESA_reply(streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags) : 0;
959
960    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
961    if (cmd_size) {
962        vn_encode_vkExecuteCommandStreamsMESA(enc, cmd_flags, streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags);
963        vn_instance_submit_command(vn_instance, submit);
964        if (cmd_data != local_cmd_data)
965            free(cmd_data);
966    }
967}
968
969static inline void vn_submit_vkCreateRingMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo, struct vn_instance_submit_command *submit)
970{
971    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
972    void *cmd_data = local_cmd_data;
973    size_t cmd_size = vn_sizeof_vkCreateRingMESA(ring, pCreateInfo);
974    if (cmd_size > sizeof(local_cmd_data)) {
975        cmd_data = malloc(cmd_size);
976        if (!cmd_data)
977            cmd_size = 0;
978    }
979    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateRingMESA_reply(ring, pCreateInfo) : 0;
980
981    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
982    if (cmd_size) {
983        vn_encode_vkCreateRingMESA(enc, cmd_flags, ring, pCreateInfo);
984        vn_instance_submit_command(vn_instance, submit);
985        if (cmd_data != local_cmd_data)
986            free(cmd_data);
987    }
988}
989
990static inline void vn_submit_vkDestroyRingMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, uint64_t ring, struct vn_instance_submit_command *submit)
991{
992    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
993    void *cmd_data = local_cmd_data;
994    size_t cmd_size = vn_sizeof_vkDestroyRingMESA(ring);
995    if (cmd_size > sizeof(local_cmd_data)) {
996        cmd_data = malloc(cmd_size);
997        if (!cmd_data)
998            cmd_size = 0;
999    }
1000    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkDestroyRingMESA_reply(ring) : 0;
1001
1002    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1003    if (cmd_size) {
1004        vn_encode_vkDestroyRingMESA(enc, cmd_flags, ring);
1005        vn_instance_submit_command(vn_instance, submit);
1006        if (cmd_data != local_cmd_data)
1007            free(cmd_data);
1008    }
1009}
1010
1011static inline void vn_submit_vkNotifyRingMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags, struct vn_instance_submit_command *submit)
1012{
1013    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1014    void *cmd_data = local_cmd_data;
1015    size_t cmd_size = vn_sizeof_vkNotifyRingMESA(ring, seqno, flags);
1016    if (cmd_size > sizeof(local_cmd_data)) {
1017        cmd_data = malloc(cmd_size);
1018        if (!cmd_data)
1019            cmd_size = 0;
1020    }
1021    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkNotifyRingMESA_reply(ring, seqno, flags) : 0;
1022
1023    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1024    if (cmd_size) {
1025        vn_encode_vkNotifyRingMESA(enc, cmd_flags, ring, seqno, flags);
1026        vn_instance_submit_command(vn_instance, submit);
1027        if (cmd_data != local_cmd_data)
1028            free(cmd_data);
1029    }
1030}
1031
1032static inline void vn_submit_vkWriteRingExtraMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, uint64_t ring, size_t offset, uint32_t value, struct vn_instance_submit_command *submit)
1033{
1034    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1035    void *cmd_data = local_cmd_data;
1036    size_t cmd_size = vn_sizeof_vkWriteRingExtraMESA(ring, offset, value);
1037    if (cmd_size > sizeof(local_cmd_data)) {
1038        cmd_data = malloc(cmd_size);
1039        if (!cmd_data)
1040            cmd_size = 0;
1041    }
1042    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkWriteRingExtraMESA_reply(ring, offset, value) : 0;
1043
1044    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1045    if (cmd_size) {
1046        vn_encode_vkWriteRingExtraMESA(enc, cmd_flags, ring, offset, value);
1047        vn_instance_submit_command(vn_instance, submit);
1048        if (cmd_data != local_cmd_data)
1049            free(cmd_data);
1050    }
1051}
1052
1053static inline void vn_submit_vkGetMemoryResourcePropertiesMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties, struct vn_instance_submit_command *submit)
1054{
1055    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1056    void *cmd_data = local_cmd_data;
1057    size_t cmd_size = vn_sizeof_vkGetMemoryResourcePropertiesMESA(device, resourceId, pMemoryResourceProperties);
1058    if (cmd_size > sizeof(local_cmd_data)) {
1059        cmd_data = malloc(cmd_size);
1060        if (!cmd_data)
1061            cmd_size = 0;
1062    }
1063    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetMemoryResourcePropertiesMESA_reply(device, resourceId, pMemoryResourceProperties) : 0;
1064
1065    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1066    if (cmd_size) {
1067        vn_encode_vkGetMemoryResourcePropertiesMESA(enc, cmd_flags, device, resourceId, pMemoryResourceProperties);
1068        vn_instance_submit_command(vn_instance, submit);
1069        if (cmd_data != local_cmd_data)
1070            free(cmd_data);
1071    }
1072}
1073
1074static inline void vn_submit_vkGetVenusExperimentalFeatureData100000MESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, size_t* pDataSize, void* pData, struct vn_instance_submit_command *submit)
1075{
1076    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1077    void *cmd_data = local_cmd_data;
1078    size_t cmd_size = vn_sizeof_vkGetVenusExperimentalFeatureData100000MESA(pDataSize, pData);
1079    if (cmd_size > sizeof(local_cmd_data)) {
1080        cmd_data = malloc(cmd_size);
1081        if (!cmd_data)
1082            cmd_size = 0;
1083    }
1084    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetVenusExperimentalFeatureData100000MESA_reply(pDataSize, pData) : 0;
1085
1086    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1087    if (cmd_size) {
1088        vn_encode_vkGetVenusExperimentalFeatureData100000MESA(enc, cmd_flags, pDataSize, pData);
1089        vn_instance_submit_command(vn_instance, submit);
1090        if (cmd_data != local_cmd_data)
1091            free(cmd_data);
1092    }
1093}
1094
1095static inline void vn_call_vkSetReplyCommandStreamMESA(struct vn_instance *vn_instance, const VkCommandStreamDescriptionMESA* pStream)
1096{
1097    VN_TRACE_FUNC();
1098
1099    struct vn_instance_submit_command submit;
1100    vn_submit_vkSetReplyCommandStreamMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, pStream, &submit);
1101    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1102    if (dec) {
1103        vn_decode_vkSetReplyCommandStreamMESA_reply(dec, pStream);
1104        vn_instance_free_command_reply(vn_instance, &submit);
1105    }
1106}
1107
1108static inline void vn_async_vkSetReplyCommandStreamMESA(struct vn_instance *vn_instance, const VkCommandStreamDescriptionMESA* pStream)
1109{
1110    struct vn_instance_submit_command submit;
1111    vn_submit_vkSetReplyCommandStreamMESA(vn_instance, 0, pStream, &submit);
1112}
1113
1114static inline void vn_call_vkSeekReplyCommandStreamMESA(struct vn_instance *vn_instance, size_t position)
1115{
1116    VN_TRACE_FUNC();
1117
1118    struct vn_instance_submit_command submit;
1119    vn_submit_vkSeekReplyCommandStreamMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, position, &submit);
1120    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1121    if (dec) {
1122        vn_decode_vkSeekReplyCommandStreamMESA_reply(dec, position);
1123        vn_instance_free_command_reply(vn_instance, &submit);
1124    }
1125}
1126
1127static inline void vn_async_vkSeekReplyCommandStreamMESA(struct vn_instance *vn_instance, size_t position)
1128{
1129    struct vn_instance_submit_command submit;
1130    vn_submit_vkSeekReplyCommandStreamMESA(vn_instance, 0, position, &submit);
1131}
1132
1133static inline void vn_call_vkExecuteCommandStreamsMESA(struct vn_instance *vn_instance, uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
1134{
1135    VN_TRACE_FUNC();
1136
1137    struct vn_instance_submit_command submit;
1138    vn_submit_vkExecuteCommandStreamsMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags, &submit);
1139    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1140    if (dec) {
1141        vn_decode_vkExecuteCommandStreamsMESA_reply(dec, streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags);
1142        vn_instance_free_command_reply(vn_instance, &submit);
1143    }
1144}
1145
1146static inline void vn_async_vkExecuteCommandStreamsMESA(struct vn_instance *vn_instance, uint32_t streamCount, const VkCommandStreamDescriptionMESA* pStreams, const size_t* pReplyPositions, uint32_t dependencyCount, const VkCommandStreamDependencyMESA* pDependencies, VkCommandStreamExecutionFlagsMESA flags)
1147{
1148    struct vn_instance_submit_command submit;
1149    vn_submit_vkExecuteCommandStreamsMESA(vn_instance, 0, streamCount, pStreams, pReplyPositions, dependencyCount, pDependencies, flags, &submit);
1150}
1151
1152static inline void vn_call_vkCreateRingMESA(struct vn_instance *vn_instance, uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
1153{
1154    VN_TRACE_FUNC();
1155
1156    struct vn_instance_submit_command submit;
1157    vn_submit_vkCreateRingMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, ring, pCreateInfo, &submit);
1158    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1159    if (dec) {
1160        vn_decode_vkCreateRingMESA_reply(dec, ring, pCreateInfo);
1161        vn_instance_free_command_reply(vn_instance, &submit);
1162    }
1163}
1164
1165static inline void vn_async_vkCreateRingMESA(struct vn_instance *vn_instance, uint64_t ring, const VkRingCreateInfoMESA* pCreateInfo)
1166{
1167    struct vn_instance_submit_command submit;
1168    vn_submit_vkCreateRingMESA(vn_instance, 0, ring, pCreateInfo, &submit);
1169}
1170
1171static inline void vn_call_vkDestroyRingMESA(struct vn_instance *vn_instance, uint64_t ring)
1172{
1173    VN_TRACE_FUNC();
1174
1175    struct vn_instance_submit_command submit;
1176    vn_submit_vkDestroyRingMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, ring, &submit);
1177    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1178    if (dec) {
1179        vn_decode_vkDestroyRingMESA_reply(dec, ring);
1180        vn_instance_free_command_reply(vn_instance, &submit);
1181    }
1182}
1183
1184static inline void vn_async_vkDestroyRingMESA(struct vn_instance *vn_instance, uint64_t ring)
1185{
1186    struct vn_instance_submit_command submit;
1187    vn_submit_vkDestroyRingMESA(vn_instance, 0, ring, &submit);
1188}
1189
1190static inline void vn_call_vkNotifyRingMESA(struct vn_instance *vn_instance, uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
1191{
1192    VN_TRACE_FUNC();
1193
1194    struct vn_instance_submit_command submit;
1195    vn_submit_vkNotifyRingMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, ring, seqno, flags, &submit);
1196    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1197    if (dec) {
1198        vn_decode_vkNotifyRingMESA_reply(dec, ring, seqno, flags);
1199        vn_instance_free_command_reply(vn_instance, &submit);
1200    }
1201}
1202
1203static inline void vn_async_vkNotifyRingMESA(struct vn_instance *vn_instance, uint64_t ring, uint32_t seqno, VkRingNotifyFlagsMESA flags)
1204{
1205    struct vn_instance_submit_command submit;
1206    vn_submit_vkNotifyRingMESA(vn_instance, 0, ring, seqno, flags, &submit);
1207}
1208
1209static inline void vn_call_vkWriteRingExtraMESA(struct vn_instance *vn_instance, uint64_t ring, size_t offset, uint32_t value)
1210{
1211    VN_TRACE_FUNC();
1212
1213    struct vn_instance_submit_command submit;
1214    vn_submit_vkWriteRingExtraMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, ring, offset, value, &submit);
1215    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1216    if (dec) {
1217        vn_decode_vkWriteRingExtraMESA_reply(dec, ring, offset, value);
1218        vn_instance_free_command_reply(vn_instance, &submit);
1219    }
1220}
1221
1222static inline void vn_async_vkWriteRingExtraMESA(struct vn_instance *vn_instance, uint64_t ring, size_t offset, uint32_t value)
1223{
1224    struct vn_instance_submit_command submit;
1225    vn_submit_vkWriteRingExtraMESA(vn_instance, 0, ring, offset, value, &submit);
1226}
1227
1228static inline VkResult vn_call_vkGetMemoryResourcePropertiesMESA(struct vn_instance *vn_instance, VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
1229{
1230    VN_TRACE_FUNC();
1231
1232    struct vn_instance_submit_command submit;
1233    vn_submit_vkGetMemoryResourcePropertiesMESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, resourceId, pMemoryResourceProperties, &submit);
1234    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1235    if (dec) {
1236        const VkResult ret = vn_decode_vkGetMemoryResourcePropertiesMESA_reply(dec, device, resourceId, pMemoryResourceProperties);
1237        vn_instance_free_command_reply(vn_instance, &submit);
1238        return ret;
1239    } else {
1240        return VK_ERROR_OUT_OF_HOST_MEMORY;
1241    }
1242}
1243
1244static inline void vn_async_vkGetMemoryResourcePropertiesMESA(struct vn_instance *vn_instance, VkDevice device, uint32_t resourceId, VkMemoryResourcePropertiesMESA* pMemoryResourceProperties)
1245{
1246    struct vn_instance_submit_command submit;
1247    vn_submit_vkGetMemoryResourcePropertiesMESA(vn_instance, 0, device, resourceId, pMemoryResourceProperties, &submit);
1248}
1249
1250static inline void vn_call_vkGetVenusExperimentalFeatureData100000MESA(struct vn_instance *vn_instance, size_t* pDataSize, void* pData)
1251{
1252    VN_TRACE_FUNC();
1253
1254    struct vn_instance_submit_command submit;
1255    vn_submit_vkGetVenusExperimentalFeatureData100000MESA(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, pDataSize, pData, &submit);
1256    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1257    if (dec) {
1258        vn_decode_vkGetVenusExperimentalFeatureData100000MESA_reply(dec, pDataSize, pData);
1259        vn_instance_free_command_reply(vn_instance, &submit);
1260    }
1261}
1262
1263static inline void vn_async_vkGetVenusExperimentalFeatureData100000MESA(struct vn_instance *vn_instance, size_t* pDataSize, void* pData)
1264{
1265    struct vn_instance_submit_command submit;
1266    vn_submit_vkGetVenusExperimentalFeatureData100000MESA(vn_instance, 0, pDataSize, pData, &submit);
1267}
1268
1269#endif /* VN_PROTOCOL_DRIVER_TRANSPORT_H */
1270