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_BUFFER_H
9bf215546Sopenharmony_ci#define VN_PROTOCOL_DRIVER_BUFFER_H
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_ci#include "vn_instance.h"
12bf215546Sopenharmony_ci#include "vn_protocol_driver_structs.h"
13bf215546Sopenharmony_ci
14bf215546Sopenharmony_ci/* struct VkExternalMemoryBufferCreateInfo chain */
15bf215546Sopenharmony_ci
16bf215546Sopenharmony_cistatic inline size_t
17bf215546Sopenharmony_civn_sizeof_VkExternalMemoryBufferCreateInfo_pnext(const void *val)
18bf215546Sopenharmony_ci{
19bf215546Sopenharmony_ci    /* no known/supported struct */
20bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
21bf215546Sopenharmony_ci}
22bf215546Sopenharmony_ci
23bf215546Sopenharmony_cistatic inline size_t
24bf215546Sopenharmony_civn_sizeof_VkExternalMemoryBufferCreateInfo_self(const VkExternalMemoryBufferCreateInfo *val)
25bf215546Sopenharmony_ci{
26bf215546Sopenharmony_ci    size_t size = 0;
27bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
28bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->handleTypes);
29bf215546Sopenharmony_ci    return size;
30bf215546Sopenharmony_ci}
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_cistatic inline size_t
33bf215546Sopenharmony_civn_sizeof_VkExternalMemoryBufferCreateInfo(const VkExternalMemoryBufferCreateInfo *val)
34bf215546Sopenharmony_ci{
35bf215546Sopenharmony_ci    size_t size = 0;
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
38bf215546Sopenharmony_ci    size += vn_sizeof_VkExternalMemoryBufferCreateInfo_pnext(val->pNext);
39bf215546Sopenharmony_ci    size += vn_sizeof_VkExternalMemoryBufferCreateInfo_self(val);
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci    return size;
42bf215546Sopenharmony_ci}
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_cistatic inline void
45bf215546Sopenharmony_civn_encode_VkExternalMemoryBufferCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
46bf215546Sopenharmony_ci{
47bf215546Sopenharmony_ci    /* no known/supported struct */
48bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
49bf215546Sopenharmony_ci}
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_cistatic inline void
52bf215546Sopenharmony_civn_encode_VkExternalMemoryBufferCreateInfo_self(struct vn_cs_encoder *enc, const VkExternalMemoryBufferCreateInfo *val)
53bf215546Sopenharmony_ci{
54bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
55bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->handleTypes);
56bf215546Sopenharmony_ci}
57bf215546Sopenharmony_ci
58bf215546Sopenharmony_cistatic inline void
59bf215546Sopenharmony_civn_encode_VkExternalMemoryBufferCreateInfo(struct vn_cs_encoder *enc, const VkExternalMemoryBufferCreateInfo *val)
60bf215546Sopenharmony_ci{
61bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO);
62bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO });
63bf215546Sopenharmony_ci    vn_encode_VkExternalMemoryBufferCreateInfo_pnext(enc, val->pNext);
64bf215546Sopenharmony_ci    vn_encode_VkExternalMemoryBufferCreateInfo_self(enc, val);
65bf215546Sopenharmony_ci}
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci/* struct VkBufferOpaqueCaptureAddressCreateInfo chain */
68bf215546Sopenharmony_ci
69bf215546Sopenharmony_cistatic inline size_t
70bf215546Sopenharmony_civn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo_pnext(const void *val)
71bf215546Sopenharmony_ci{
72bf215546Sopenharmony_ci    /* no known/supported struct */
73bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
74bf215546Sopenharmony_ci}
75bf215546Sopenharmony_ci
76bf215546Sopenharmony_cistatic inline size_t
77bf215546Sopenharmony_civn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo_self(const VkBufferOpaqueCaptureAddressCreateInfo *val)
78bf215546Sopenharmony_ci{
79bf215546Sopenharmony_ci    size_t size = 0;
80bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
81bf215546Sopenharmony_ci    size += vn_sizeof_uint64_t(&val->opaqueCaptureAddress);
82bf215546Sopenharmony_ci    return size;
83bf215546Sopenharmony_ci}
84bf215546Sopenharmony_ci
85bf215546Sopenharmony_cistatic inline size_t
86bf215546Sopenharmony_civn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo(const VkBufferOpaqueCaptureAddressCreateInfo *val)
87bf215546Sopenharmony_ci{
88bf215546Sopenharmony_ci    size_t size = 0;
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
91bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo_pnext(val->pNext);
92bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo_self(val);
93bf215546Sopenharmony_ci
94bf215546Sopenharmony_ci    return size;
95bf215546Sopenharmony_ci}
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_cistatic inline void
98bf215546Sopenharmony_civn_encode_VkBufferOpaqueCaptureAddressCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
99bf215546Sopenharmony_ci{
100bf215546Sopenharmony_ci    /* no known/supported struct */
101bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
102bf215546Sopenharmony_ci}
103bf215546Sopenharmony_ci
104bf215546Sopenharmony_cistatic inline void
105bf215546Sopenharmony_civn_encode_VkBufferOpaqueCaptureAddressCreateInfo_self(struct vn_cs_encoder *enc, const VkBufferOpaqueCaptureAddressCreateInfo *val)
106bf215546Sopenharmony_ci{
107bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
108bf215546Sopenharmony_ci    vn_encode_uint64_t(enc, &val->opaqueCaptureAddress);
109bf215546Sopenharmony_ci}
110bf215546Sopenharmony_ci
111bf215546Sopenharmony_cistatic inline void
112bf215546Sopenharmony_civn_encode_VkBufferOpaqueCaptureAddressCreateInfo(struct vn_cs_encoder *enc, const VkBufferOpaqueCaptureAddressCreateInfo *val)
113bf215546Sopenharmony_ci{
114bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO);
115bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO });
116bf215546Sopenharmony_ci    vn_encode_VkBufferOpaqueCaptureAddressCreateInfo_pnext(enc, val->pNext);
117bf215546Sopenharmony_ci    vn_encode_VkBufferOpaqueCaptureAddressCreateInfo_self(enc, val);
118bf215546Sopenharmony_ci}
119bf215546Sopenharmony_ci
120bf215546Sopenharmony_ci/* struct VkBufferCreateInfo chain */
121bf215546Sopenharmony_ci
122bf215546Sopenharmony_cistatic inline size_t
123bf215546Sopenharmony_civn_sizeof_VkBufferCreateInfo_pnext(const void *val)
124bf215546Sopenharmony_ci{
125bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
126bf215546Sopenharmony_ci    size_t size = 0;
127bf215546Sopenharmony_ci
128bf215546Sopenharmony_ci    while (pnext) {
129bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
130bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO:
131bf215546Sopenharmony_ci            size += vn_sizeof_simple_pointer(pnext);
132bf215546Sopenharmony_ci            size += vn_sizeof_VkStructureType(&pnext->sType);
133bf215546Sopenharmony_ci            size += vn_sizeof_VkBufferCreateInfo_pnext(pnext->pNext);
134bf215546Sopenharmony_ci            size += vn_sizeof_VkExternalMemoryBufferCreateInfo_self((const VkExternalMemoryBufferCreateInfo *)pnext);
135bf215546Sopenharmony_ci            return size;
136bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO:
137bf215546Sopenharmony_ci            size += vn_sizeof_simple_pointer(pnext);
138bf215546Sopenharmony_ci            size += vn_sizeof_VkStructureType(&pnext->sType);
139bf215546Sopenharmony_ci            size += vn_sizeof_VkBufferCreateInfo_pnext(pnext->pNext);
140bf215546Sopenharmony_ci            size += vn_sizeof_VkBufferOpaqueCaptureAddressCreateInfo_self((const VkBufferOpaqueCaptureAddressCreateInfo *)pnext);
141bf215546Sopenharmony_ci            return size;
142bf215546Sopenharmony_ci        default:
143bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
144bf215546Sopenharmony_ci            break;
145bf215546Sopenharmony_ci        }
146bf215546Sopenharmony_ci        pnext = pnext->pNext;
147bf215546Sopenharmony_ci    }
148bf215546Sopenharmony_ci
149bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
150bf215546Sopenharmony_ci}
151bf215546Sopenharmony_ci
152bf215546Sopenharmony_cistatic inline size_t
153bf215546Sopenharmony_civn_sizeof_VkBufferCreateInfo_self(const VkBufferCreateInfo *val)
154bf215546Sopenharmony_ci{
155bf215546Sopenharmony_ci    size_t size = 0;
156bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
157bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->flags);
158bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceSize(&val->size);
159bf215546Sopenharmony_ci    size += vn_sizeof_VkFlags(&val->usage);
160bf215546Sopenharmony_ci    size += vn_sizeof_VkSharingMode(&val->sharingMode);
161bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->queueFamilyIndexCount);
162bf215546Sopenharmony_ci    if (val->pQueueFamilyIndices) {
163bf215546Sopenharmony_ci        size += vn_sizeof_array_size(val->queueFamilyIndexCount);
164bf215546Sopenharmony_ci        size += vn_sizeof_uint32_t_array(val->pQueueFamilyIndices, val->queueFamilyIndexCount);
165bf215546Sopenharmony_ci    } else {
166bf215546Sopenharmony_ci        size += vn_sizeof_array_size(0);
167bf215546Sopenharmony_ci    }
168bf215546Sopenharmony_ci    return size;
169bf215546Sopenharmony_ci}
170bf215546Sopenharmony_ci
171bf215546Sopenharmony_cistatic inline size_t
172bf215546Sopenharmony_civn_sizeof_VkBufferCreateInfo(const VkBufferCreateInfo *val)
173bf215546Sopenharmony_ci{
174bf215546Sopenharmony_ci    size_t size = 0;
175bf215546Sopenharmony_ci
176bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
177bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferCreateInfo_pnext(val->pNext);
178bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferCreateInfo_self(val);
179bf215546Sopenharmony_ci
180bf215546Sopenharmony_ci    return size;
181bf215546Sopenharmony_ci}
182bf215546Sopenharmony_ci
183bf215546Sopenharmony_cistatic inline void
184bf215546Sopenharmony_civn_encode_VkBufferCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
185bf215546Sopenharmony_ci{
186bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
187bf215546Sopenharmony_ci
188bf215546Sopenharmony_ci    while (pnext) {
189bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
190bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO:
191bf215546Sopenharmony_ci            vn_encode_simple_pointer(enc, pnext);
192bf215546Sopenharmony_ci            vn_encode_VkStructureType(enc, &pnext->sType);
193bf215546Sopenharmony_ci            vn_encode_VkBufferCreateInfo_pnext(enc, pnext->pNext);
194bf215546Sopenharmony_ci            vn_encode_VkExternalMemoryBufferCreateInfo_self(enc, (const VkExternalMemoryBufferCreateInfo *)pnext);
195bf215546Sopenharmony_ci            return;
196bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO:
197bf215546Sopenharmony_ci            vn_encode_simple_pointer(enc, pnext);
198bf215546Sopenharmony_ci            vn_encode_VkStructureType(enc, &pnext->sType);
199bf215546Sopenharmony_ci            vn_encode_VkBufferCreateInfo_pnext(enc, pnext->pNext);
200bf215546Sopenharmony_ci            vn_encode_VkBufferOpaqueCaptureAddressCreateInfo_self(enc, (const VkBufferOpaqueCaptureAddressCreateInfo *)pnext);
201bf215546Sopenharmony_ci            return;
202bf215546Sopenharmony_ci        default:
203bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
204bf215546Sopenharmony_ci            break;
205bf215546Sopenharmony_ci        }
206bf215546Sopenharmony_ci        pnext = pnext->pNext;
207bf215546Sopenharmony_ci    }
208bf215546Sopenharmony_ci
209bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
210bf215546Sopenharmony_ci}
211bf215546Sopenharmony_ci
212bf215546Sopenharmony_cistatic inline void
213bf215546Sopenharmony_civn_encode_VkBufferCreateInfo_self(struct vn_cs_encoder *enc, const VkBufferCreateInfo *val)
214bf215546Sopenharmony_ci{
215bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
216bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->flags);
217bf215546Sopenharmony_ci    vn_encode_VkDeviceSize(enc, &val->size);
218bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &val->usage);
219bf215546Sopenharmony_ci    vn_encode_VkSharingMode(enc, &val->sharingMode);
220bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->queueFamilyIndexCount);
221bf215546Sopenharmony_ci    if (val->pQueueFamilyIndices) {
222bf215546Sopenharmony_ci        vn_encode_array_size(enc, val->queueFamilyIndexCount);
223bf215546Sopenharmony_ci        vn_encode_uint32_t_array(enc, val->pQueueFamilyIndices, val->queueFamilyIndexCount);
224bf215546Sopenharmony_ci    } else {
225bf215546Sopenharmony_ci        vn_encode_array_size(enc, 0);
226bf215546Sopenharmony_ci    }
227bf215546Sopenharmony_ci}
228bf215546Sopenharmony_ci
229bf215546Sopenharmony_cistatic inline void
230bf215546Sopenharmony_civn_encode_VkBufferCreateInfo(struct vn_cs_encoder *enc, const VkBufferCreateInfo *val)
231bf215546Sopenharmony_ci{
232bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO);
233bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO });
234bf215546Sopenharmony_ci    vn_encode_VkBufferCreateInfo_pnext(enc, val->pNext);
235bf215546Sopenharmony_ci    vn_encode_VkBufferCreateInfo_self(enc, val);
236bf215546Sopenharmony_ci}
237bf215546Sopenharmony_ci
238bf215546Sopenharmony_ci/* struct VkBindBufferMemoryDeviceGroupInfo chain */
239bf215546Sopenharmony_ci
240bf215546Sopenharmony_cistatic inline size_t
241bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryDeviceGroupInfo_pnext(const void *val)
242bf215546Sopenharmony_ci{
243bf215546Sopenharmony_ci    /* no known/supported struct */
244bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
245bf215546Sopenharmony_ci}
246bf215546Sopenharmony_ci
247bf215546Sopenharmony_cistatic inline size_t
248bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryDeviceGroupInfo_self(const VkBindBufferMemoryDeviceGroupInfo *val)
249bf215546Sopenharmony_ci{
250bf215546Sopenharmony_ci    size_t size = 0;
251bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
252bf215546Sopenharmony_ci    size += vn_sizeof_uint32_t(&val->deviceIndexCount);
253bf215546Sopenharmony_ci    if (val->pDeviceIndices) {
254bf215546Sopenharmony_ci        size += vn_sizeof_array_size(val->deviceIndexCount);
255bf215546Sopenharmony_ci        size += vn_sizeof_uint32_t_array(val->pDeviceIndices, val->deviceIndexCount);
256bf215546Sopenharmony_ci    } else {
257bf215546Sopenharmony_ci        size += vn_sizeof_array_size(0);
258bf215546Sopenharmony_ci    }
259bf215546Sopenharmony_ci    return size;
260bf215546Sopenharmony_ci}
261bf215546Sopenharmony_ci
262bf215546Sopenharmony_cistatic inline size_t
263bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryDeviceGroupInfo(const VkBindBufferMemoryDeviceGroupInfo *val)
264bf215546Sopenharmony_ci{
265bf215546Sopenharmony_ci    size_t size = 0;
266bf215546Sopenharmony_ci
267bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
268bf215546Sopenharmony_ci    size += vn_sizeof_VkBindBufferMemoryDeviceGroupInfo_pnext(val->pNext);
269bf215546Sopenharmony_ci    size += vn_sizeof_VkBindBufferMemoryDeviceGroupInfo_self(val);
270bf215546Sopenharmony_ci
271bf215546Sopenharmony_ci    return size;
272bf215546Sopenharmony_ci}
273bf215546Sopenharmony_ci
274bf215546Sopenharmony_cistatic inline void
275bf215546Sopenharmony_civn_encode_VkBindBufferMemoryDeviceGroupInfo_pnext(struct vn_cs_encoder *enc, const void *val)
276bf215546Sopenharmony_ci{
277bf215546Sopenharmony_ci    /* no known/supported struct */
278bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
279bf215546Sopenharmony_ci}
280bf215546Sopenharmony_ci
281bf215546Sopenharmony_cistatic inline void
282bf215546Sopenharmony_civn_encode_VkBindBufferMemoryDeviceGroupInfo_self(struct vn_cs_encoder *enc, const VkBindBufferMemoryDeviceGroupInfo *val)
283bf215546Sopenharmony_ci{
284bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
285bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &val->deviceIndexCount);
286bf215546Sopenharmony_ci    if (val->pDeviceIndices) {
287bf215546Sopenharmony_ci        vn_encode_array_size(enc, val->deviceIndexCount);
288bf215546Sopenharmony_ci        vn_encode_uint32_t_array(enc, val->pDeviceIndices, val->deviceIndexCount);
289bf215546Sopenharmony_ci    } else {
290bf215546Sopenharmony_ci        vn_encode_array_size(enc, 0);
291bf215546Sopenharmony_ci    }
292bf215546Sopenharmony_ci}
293bf215546Sopenharmony_ci
294bf215546Sopenharmony_cistatic inline void
295bf215546Sopenharmony_civn_encode_VkBindBufferMemoryDeviceGroupInfo(struct vn_cs_encoder *enc, const VkBindBufferMemoryDeviceGroupInfo *val)
296bf215546Sopenharmony_ci{
297bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO);
298bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO });
299bf215546Sopenharmony_ci    vn_encode_VkBindBufferMemoryDeviceGroupInfo_pnext(enc, val->pNext);
300bf215546Sopenharmony_ci    vn_encode_VkBindBufferMemoryDeviceGroupInfo_self(enc, val);
301bf215546Sopenharmony_ci}
302bf215546Sopenharmony_ci
303bf215546Sopenharmony_ci/* struct VkBindBufferMemoryInfo chain */
304bf215546Sopenharmony_ci
305bf215546Sopenharmony_cistatic inline size_t
306bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryInfo_pnext(const void *val)
307bf215546Sopenharmony_ci{
308bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
309bf215546Sopenharmony_ci    size_t size = 0;
310bf215546Sopenharmony_ci
311bf215546Sopenharmony_ci    while (pnext) {
312bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
313bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO:
314bf215546Sopenharmony_ci            size += vn_sizeof_simple_pointer(pnext);
315bf215546Sopenharmony_ci            size += vn_sizeof_VkStructureType(&pnext->sType);
316bf215546Sopenharmony_ci            size += vn_sizeof_VkBindBufferMemoryInfo_pnext(pnext->pNext);
317bf215546Sopenharmony_ci            size += vn_sizeof_VkBindBufferMemoryDeviceGroupInfo_self((const VkBindBufferMemoryDeviceGroupInfo *)pnext);
318bf215546Sopenharmony_ci            return size;
319bf215546Sopenharmony_ci        default:
320bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
321bf215546Sopenharmony_ci            break;
322bf215546Sopenharmony_ci        }
323bf215546Sopenharmony_ci        pnext = pnext->pNext;
324bf215546Sopenharmony_ci    }
325bf215546Sopenharmony_ci
326bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
327bf215546Sopenharmony_ci}
328bf215546Sopenharmony_ci
329bf215546Sopenharmony_cistatic inline size_t
330bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryInfo_self(const VkBindBufferMemoryInfo *val)
331bf215546Sopenharmony_ci{
332bf215546Sopenharmony_ci    size_t size = 0;
333bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
334bf215546Sopenharmony_ci    size += vn_sizeof_VkBuffer(&val->buffer);
335bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceMemory(&val->memory);
336bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceSize(&val->memoryOffset);
337bf215546Sopenharmony_ci    return size;
338bf215546Sopenharmony_ci}
339bf215546Sopenharmony_ci
340bf215546Sopenharmony_cistatic inline size_t
341bf215546Sopenharmony_civn_sizeof_VkBindBufferMemoryInfo(const VkBindBufferMemoryInfo *val)
342bf215546Sopenharmony_ci{
343bf215546Sopenharmony_ci    size_t size = 0;
344bf215546Sopenharmony_ci
345bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
346bf215546Sopenharmony_ci    size += vn_sizeof_VkBindBufferMemoryInfo_pnext(val->pNext);
347bf215546Sopenharmony_ci    size += vn_sizeof_VkBindBufferMemoryInfo_self(val);
348bf215546Sopenharmony_ci
349bf215546Sopenharmony_ci    return size;
350bf215546Sopenharmony_ci}
351bf215546Sopenharmony_ci
352bf215546Sopenharmony_cistatic inline void
353bf215546Sopenharmony_civn_encode_VkBindBufferMemoryInfo_pnext(struct vn_cs_encoder *enc, const void *val)
354bf215546Sopenharmony_ci{
355bf215546Sopenharmony_ci    const VkBaseInStructure *pnext = val;
356bf215546Sopenharmony_ci
357bf215546Sopenharmony_ci    while (pnext) {
358bf215546Sopenharmony_ci        switch ((int32_t)pnext->sType) {
359bf215546Sopenharmony_ci        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO:
360bf215546Sopenharmony_ci            vn_encode_simple_pointer(enc, pnext);
361bf215546Sopenharmony_ci            vn_encode_VkStructureType(enc, &pnext->sType);
362bf215546Sopenharmony_ci            vn_encode_VkBindBufferMemoryInfo_pnext(enc, pnext->pNext);
363bf215546Sopenharmony_ci            vn_encode_VkBindBufferMemoryDeviceGroupInfo_self(enc, (const VkBindBufferMemoryDeviceGroupInfo *)pnext);
364bf215546Sopenharmony_ci            return;
365bf215546Sopenharmony_ci        default:
366bf215546Sopenharmony_ci            /* ignore unknown/unsupported struct */
367bf215546Sopenharmony_ci            break;
368bf215546Sopenharmony_ci        }
369bf215546Sopenharmony_ci        pnext = pnext->pNext;
370bf215546Sopenharmony_ci    }
371bf215546Sopenharmony_ci
372bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
373bf215546Sopenharmony_ci}
374bf215546Sopenharmony_ci
375bf215546Sopenharmony_cistatic inline void
376bf215546Sopenharmony_civn_encode_VkBindBufferMemoryInfo_self(struct vn_cs_encoder *enc, const VkBindBufferMemoryInfo *val)
377bf215546Sopenharmony_ci{
378bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
379bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &val->buffer);
380bf215546Sopenharmony_ci    vn_encode_VkDeviceMemory(enc, &val->memory);
381bf215546Sopenharmony_ci    vn_encode_VkDeviceSize(enc, &val->memoryOffset);
382bf215546Sopenharmony_ci}
383bf215546Sopenharmony_ci
384bf215546Sopenharmony_cistatic inline void
385bf215546Sopenharmony_civn_encode_VkBindBufferMemoryInfo(struct vn_cs_encoder *enc, const VkBindBufferMemoryInfo *val)
386bf215546Sopenharmony_ci{
387bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO);
388bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO });
389bf215546Sopenharmony_ci    vn_encode_VkBindBufferMemoryInfo_pnext(enc, val->pNext);
390bf215546Sopenharmony_ci    vn_encode_VkBindBufferMemoryInfo_self(enc, val);
391bf215546Sopenharmony_ci}
392bf215546Sopenharmony_ci
393bf215546Sopenharmony_ci/* struct VkBufferMemoryRequirementsInfo2 chain */
394bf215546Sopenharmony_ci
395bf215546Sopenharmony_cistatic inline size_t
396bf215546Sopenharmony_civn_sizeof_VkBufferMemoryRequirementsInfo2_pnext(const void *val)
397bf215546Sopenharmony_ci{
398bf215546Sopenharmony_ci    /* no known/supported struct */
399bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
400bf215546Sopenharmony_ci}
401bf215546Sopenharmony_ci
402bf215546Sopenharmony_cistatic inline size_t
403bf215546Sopenharmony_civn_sizeof_VkBufferMemoryRequirementsInfo2_self(const VkBufferMemoryRequirementsInfo2 *val)
404bf215546Sopenharmony_ci{
405bf215546Sopenharmony_ci    size_t size = 0;
406bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
407bf215546Sopenharmony_ci    size += vn_sizeof_VkBuffer(&val->buffer);
408bf215546Sopenharmony_ci    return size;
409bf215546Sopenharmony_ci}
410bf215546Sopenharmony_ci
411bf215546Sopenharmony_cistatic inline size_t
412bf215546Sopenharmony_civn_sizeof_VkBufferMemoryRequirementsInfo2(const VkBufferMemoryRequirementsInfo2 *val)
413bf215546Sopenharmony_ci{
414bf215546Sopenharmony_ci    size_t size = 0;
415bf215546Sopenharmony_ci
416bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
417bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferMemoryRequirementsInfo2_pnext(val->pNext);
418bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferMemoryRequirementsInfo2_self(val);
419bf215546Sopenharmony_ci
420bf215546Sopenharmony_ci    return size;
421bf215546Sopenharmony_ci}
422bf215546Sopenharmony_ci
423bf215546Sopenharmony_cistatic inline void
424bf215546Sopenharmony_civn_encode_VkBufferMemoryRequirementsInfo2_pnext(struct vn_cs_encoder *enc, const void *val)
425bf215546Sopenharmony_ci{
426bf215546Sopenharmony_ci    /* no known/supported struct */
427bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
428bf215546Sopenharmony_ci}
429bf215546Sopenharmony_ci
430bf215546Sopenharmony_cistatic inline void
431bf215546Sopenharmony_civn_encode_VkBufferMemoryRequirementsInfo2_self(struct vn_cs_encoder *enc, const VkBufferMemoryRequirementsInfo2 *val)
432bf215546Sopenharmony_ci{
433bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
434bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &val->buffer);
435bf215546Sopenharmony_ci}
436bf215546Sopenharmony_ci
437bf215546Sopenharmony_cistatic inline void
438bf215546Sopenharmony_civn_encode_VkBufferMemoryRequirementsInfo2(struct vn_cs_encoder *enc, const VkBufferMemoryRequirementsInfo2 *val)
439bf215546Sopenharmony_ci{
440bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2);
441bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 });
442bf215546Sopenharmony_ci    vn_encode_VkBufferMemoryRequirementsInfo2_pnext(enc, val->pNext);
443bf215546Sopenharmony_ci    vn_encode_VkBufferMemoryRequirementsInfo2_self(enc, val);
444bf215546Sopenharmony_ci}
445bf215546Sopenharmony_ci
446bf215546Sopenharmony_ci/* struct VkDeviceBufferMemoryRequirements chain */
447bf215546Sopenharmony_ci
448bf215546Sopenharmony_cistatic inline size_t
449bf215546Sopenharmony_civn_sizeof_VkDeviceBufferMemoryRequirements_pnext(const void *val)
450bf215546Sopenharmony_ci{
451bf215546Sopenharmony_ci    /* no known/supported struct */
452bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
453bf215546Sopenharmony_ci}
454bf215546Sopenharmony_ci
455bf215546Sopenharmony_cistatic inline size_t
456bf215546Sopenharmony_civn_sizeof_VkDeviceBufferMemoryRequirements_self(const VkDeviceBufferMemoryRequirements *val)
457bf215546Sopenharmony_ci{
458bf215546Sopenharmony_ci    size_t size = 0;
459bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
460bf215546Sopenharmony_ci    size += vn_sizeof_simple_pointer(val->pCreateInfo);
461bf215546Sopenharmony_ci    if (val->pCreateInfo)
462bf215546Sopenharmony_ci        size += vn_sizeof_VkBufferCreateInfo(val->pCreateInfo);
463bf215546Sopenharmony_ci    return size;
464bf215546Sopenharmony_ci}
465bf215546Sopenharmony_ci
466bf215546Sopenharmony_cistatic inline size_t
467bf215546Sopenharmony_civn_sizeof_VkDeviceBufferMemoryRequirements(const VkDeviceBufferMemoryRequirements *val)
468bf215546Sopenharmony_ci{
469bf215546Sopenharmony_ci    size_t size = 0;
470bf215546Sopenharmony_ci
471bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
472bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceBufferMemoryRequirements_pnext(val->pNext);
473bf215546Sopenharmony_ci    size += vn_sizeof_VkDeviceBufferMemoryRequirements_self(val);
474bf215546Sopenharmony_ci
475bf215546Sopenharmony_ci    return size;
476bf215546Sopenharmony_ci}
477bf215546Sopenharmony_ci
478bf215546Sopenharmony_cistatic inline void
479bf215546Sopenharmony_civn_encode_VkDeviceBufferMemoryRequirements_pnext(struct vn_cs_encoder *enc, const void *val)
480bf215546Sopenharmony_ci{
481bf215546Sopenharmony_ci    /* no known/supported struct */
482bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
483bf215546Sopenharmony_ci}
484bf215546Sopenharmony_ci
485bf215546Sopenharmony_cistatic inline void
486bf215546Sopenharmony_civn_encode_VkDeviceBufferMemoryRequirements_self(struct vn_cs_encoder *enc, const VkDeviceBufferMemoryRequirements *val)
487bf215546Sopenharmony_ci{
488bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
489bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, val->pCreateInfo))
490bf215546Sopenharmony_ci        vn_encode_VkBufferCreateInfo(enc, val->pCreateInfo);
491bf215546Sopenharmony_ci}
492bf215546Sopenharmony_ci
493bf215546Sopenharmony_cistatic inline void
494bf215546Sopenharmony_civn_encode_VkDeviceBufferMemoryRequirements(struct vn_cs_encoder *enc, const VkDeviceBufferMemoryRequirements *val)
495bf215546Sopenharmony_ci{
496bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS);
497bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS });
498bf215546Sopenharmony_ci    vn_encode_VkDeviceBufferMemoryRequirements_pnext(enc, val->pNext);
499bf215546Sopenharmony_ci    vn_encode_VkDeviceBufferMemoryRequirements_self(enc, val);
500bf215546Sopenharmony_ci}
501bf215546Sopenharmony_ci
502bf215546Sopenharmony_ci/* struct VkBufferDeviceAddressInfo chain */
503bf215546Sopenharmony_ci
504bf215546Sopenharmony_cistatic inline size_t
505bf215546Sopenharmony_civn_sizeof_VkBufferDeviceAddressInfo_pnext(const void *val)
506bf215546Sopenharmony_ci{
507bf215546Sopenharmony_ci    /* no known/supported struct */
508bf215546Sopenharmony_ci    return vn_sizeof_simple_pointer(NULL);
509bf215546Sopenharmony_ci}
510bf215546Sopenharmony_ci
511bf215546Sopenharmony_cistatic inline size_t
512bf215546Sopenharmony_civn_sizeof_VkBufferDeviceAddressInfo_self(const VkBufferDeviceAddressInfo *val)
513bf215546Sopenharmony_ci{
514bf215546Sopenharmony_ci    size_t size = 0;
515bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
516bf215546Sopenharmony_ci    size += vn_sizeof_VkBuffer(&val->buffer);
517bf215546Sopenharmony_ci    return size;
518bf215546Sopenharmony_ci}
519bf215546Sopenharmony_ci
520bf215546Sopenharmony_cistatic inline size_t
521bf215546Sopenharmony_civn_sizeof_VkBufferDeviceAddressInfo(const VkBufferDeviceAddressInfo *val)
522bf215546Sopenharmony_ci{
523bf215546Sopenharmony_ci    size_t size = 0;
524bf215546Sopenharmony_ci
525bf215546Sopenharmony_ci    size += vn_sizeof_VkStructureType(&val->sType);
526bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferDeviceAddressInfo_pnext(val->pNext);
527bf215546Sopenharmony_ci    size += vn_sizeof_VkBufferDeviceAddressInfo_self(val);
528bf215546Sopenharmony_ci
529bf215546Sopenharmony_ci    return size;
530bf215546Sopenharmony_ci}
531bf215546Sopenharmony_ci
532bf215546Sopenharmony_cistatic inline void
533bf215546Sopenharmony_civn_encode_VkBufferDeviceAddressInfo_pnext(struct vn_cs_encoder *enc, const void *val)
534bf215546Sopenharmony_ci{
535bf215546Sopenharmony_ci    /* no known/supported struct */
536bf215546Sopenharmony_ci    vn_encode_simple_pointer(enc, NULL);
537bf215546Sopenharmony_ci}
538bf215546Sopenharmony_ci
539bf215546Sopenharmony_cistatic inline void
540bf215546Sopenharmony_civn_encode_VkBufferDeviceAddressInfo_self(struct vn_cs_encoder *enc, const VkBufferDeviceAddressInfo *val)
541bf215546Sopenharmony_ci{
542bf215546Sopenharmony_ci    /* skip val->{sType,pNext} */
543bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &val->buffer);
544bf215546Sopenharmony_ci}
545bf215546Sopenharmony_ci
546bf215546Sopenharmony_cistatic inline void
547bf215546Sopenharmony_civn_encode_VkBufferDeviceAddressInfo(struct vn_cs_encoder *enc, const VkBufferDeviceAddressInfo *val)
548bf215546Sopenharmony_ci{
549bf215546Sopenharmony_ci    assert(val->sType == VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO);
550bf215546Sopenharmony_ci    vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO });
551bf215546Sopenharmony_ci    vn_encode_VkBufferDeviceAddressInfo_pnext(enc, val->pNext);
552bf215546Sopenharmony_ci    vn_encode_VkBufferDeviceAddressInfo_self(enc, val);
553bf215546Sopenharmony_ci}
554bf215546Sopenharmony_ci
555bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
556bf215546Sopenharmony_ci{
557bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements_EXT;
558bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
559bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
560bf215546Sopenharmony_ci
561bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
562bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkBuffer(&buffer);
563bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
564bf215546Sopenharmony_ci    if (pMemoryRequirements)
565bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements_partial(pMemoryRequirements);
566bf215546Sopenharmony_ci
567bf215546Sopenharmony_ci    return cmd_size;
568bf215546Sopenharmony_ci}
569bf215546Sopenharmony_ci
570bf215546Sopenharmony_cistatic inline void vn_encode_vkGetBufferMemoryRequirements(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
571bf215546Sopenharmony_ci{
572bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements_EXT;
573bf215546Sopenharmony_ci
574bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
575bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
576bf215546Sopenharmony_ci
577bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
578bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &buffer);
579bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pMemoryRequirements))
580bf215546Sopenharmony_ci        vn_encode_VkMemoryRequirements_partial(enc, pMemoryRequirements);
581bf215546Sopenharmony_ci}
582bf215546Sopenharmony_ci
583bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferMemoryRequirements_reply(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
584bf215546Sopenharmony_ci{
585bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements_EXT;
586bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
587bf215546Sopenharmony_ci
588bf215546Sopenharmony_ci    /* skip device */
589bf215546Sopenharmony_ci    /* skip buffer */
590bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
591bf215546Sopenharmony_ci    if (pMemoryRequirements)
592bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements(pMemoryRequirements);
593bf215546Sopenharmony_ci
594bf215546Sopenharmony_ci    return cmd_size;
595bf215546Sopenharmony_ci}
596bf215546Sopenharmony_ci
597bf215546Sopenharmony_cistatic inline void vn_decode_vkGetBufferMemoryRequirements_reply(struct vn_cs_decoder *dec, VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
598bf215546Sopenharmony_ci{
599bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
600bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
601bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkGetBufferMemoryRequirements_EXT);
602bf215546Sopenharmony_ci
603bf215546Sopenharmony_ci    /* skip device */
604bf215546Sopenharmony_ci    /* skip buffer */
605bf215546Sopenharmony_ci    if (vn_decode_simple_pointer(dec)) {
606bf215546Sopenharmony_ci        vn_decode_VkMemoryRequirements(dec, pMemoryRequirements);
607bf215546Sopenharmony_ci    } else {
608bf215546Sopenharmony_ci        pMemoryRequirements = NULL;
609bf215546Sopenharmony_ci    }
610bf215546Sopenharmony_ci}
611bf215546Sopenharmony_ci
612bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
613bf215546Sopenharmony_ci{
614bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory_EXT;
615bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
616bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
617bf215546Sopenharmony_ci
618bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
619bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkBuffer(&buffer);
620bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDeviceMemory(&memory);
621bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDeviceSize(&memoryOffset);
622bf215546Sopenharmony_ci
623bf215546Sopenharmony_ci    return cmd_size;
624bf215546Sopenharmony_ci}
625bf215546Sopenharmony_ci
626bf215546Sopenharmony_cistatic inline void vn_encode_vkBindBufferMemory(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
627bf215546Sopenharmony_ci{
628bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory_EXT;
629bf215546Sopenharmony_ci
630bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
631bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
632bf215546Sopenharmony_ci
633bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
634bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &buffer);
635bf215546Sopenharmony_ci    vn_encode_VkDeviceMemory(enc, &memory);
636bf215546Sopenharmony_ci    vn_encode_VkDeviceSize(enc, &memoryOffset);
637bf215546Sopenharmony_ci}
638bf215546Sopenharmony_ci
639bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkBindBufferMemory_reply(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
640bf215546Sopenharmony_ci{
641bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory_EXT;
642bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
643bf215546Sopenharmony_ci
644bf215546Sopenharmony_ci    VkResult ret;
645bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkResult(&ret);
646bf215546Sopenharmony_ci    /* skip device */
647bf215546Sopenharmony_ci    /* skip buffer */
648bf215546Sopenharmony_ci    /* skip memory */
649bf215546Sopenharmony_ci    /* skip memoryOffset */
650bf215546Sopenharmony_ci
651bf215546Sopenharmony_ci    return cmd_size;
652bf215546Sopenharmony_ci}
653bf215546Sopenharmony_ci
654bf215546Sopenharmony_cistatic inline VkResult vn_decode_vkBindBufferMemory_reply(struct vn_cs_decoder *dec, VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
655bf215546Sopenharmony_ci{
656bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
657bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
658bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkBindBufferMemory_EXT);
659bf215546Sopenharmony_ci
660bf215546Sopenharmony_ci    VkResult ret;
661bf215546Sopenharmony_ci    vn_decode_VkResult(dec, &ret);
662bf215546Sopenharmony_ci    /* skip device */
663bf215546Sopenharmony_ci    /* skip buffer */
664bf215546Sopenharmony_ci    /* skip memory */
665bf215546Sopenharmony_ci    /* skip memoryOffset */
666bf215546Sopenharmony_ci
667bf215546Sopenharmony_ci    return ret;
668bf215546Sopenharmony_ci}
669bf215546Sopenharmony_ci
670bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
671bf215546Sopenharmony_ci{
672bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateBuffer_EXT;
673bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
674bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
675bf215546Sopenharmony_ci
676bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
677bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pCreateInfo);
678bf215546Sopenharmony_ci    if (pCreateInfo)
679bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBufferCreateInfo(pCreateInfo);
680bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pAllocator);
681bf215546Sopenharmony_ci    if (pAllocator)
682bf215546Sopenharmony_ci        assert(false);
683bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pBuffer);
684bf215546Sopenharmony_ci    if (pBuffer)
685bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBuffer(pBuffer);
686bf215546Sopenharmony_ci
687bf215546Sopenharmony_ci    return cmd_size;
688bf215546Sopenharmony_ci}
689bf215546Sopenharmony_ci
690bf215546Sopenharmony_cistatic inline void vn_encode_vkCreateBuffer(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
691bf215546Sopenharmony_ci{
692bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateBuffer_EXT;
693bf215546Sopenharmony_ci
694bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
695bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
696bf215546Sopenharmony_ci
697bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
698bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pCreateInfo))
699bf215546Sopenharmony_ci        vn_encode_VkBufferCreateInfo(enc, pCreateInfo);
700bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pAllocator))
701bf215546Sopenharmony_ci        assert(false);
702bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pBuffer))
703bf215546Sopenharmony_ci        vn_encode_VkBuffer(enc, pBuffer);
704bf215546Sopenharmony_ci}
705bf215546Sopenharmony_ci
706bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkCreateBuffer_reply(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
707bf215546Sopenharmony_ci{
708bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateBuffer_EXT;
709bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
710bf215546Sopenharmony_ci
711bf215546Sopenharmony_ci    VkResult ret;
712bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkResult(&ret);
713bf215546Sopenharmony_ci    /* skip device */
714bf215546Sopenharmony_ci    /* skip pCreateInfo */
715bf215546Sopenharmony_ci    /* skip pAllocator */
716bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pBuffer);
717bf215546Sopenharmony_ci    if (pBuffer)
718bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBuffer(pBuffer);
719bf215546Sopenharmony_ci
720bf215546Sopenharmony_ci    return cmd_size;
721bf215546Sopenharmony_ci}
722bf215546Sopenharmony_ci
723bf215546Sopenharmony_cistatic inline VkResult vn_decode_vkCreateBuffer_reply(struct vn_cs_decoder *dec, VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
724bf215546Sopenharmony_ci{
725bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
726bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
727bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkCreateBuffer_EXT);
728bf215546Sopenharmony_ci
729bf215546Sopenharmony_ci    VkResult ret;
730bf215546Sopenharmony_ci    vn_decode_VkResult(dec, &ret);
731bf215546Sopenharmony_ci    /* skip device */
732bf215546Sopenharmony_ci    /* skip pCreateInfo */
733bf215546Sopenharmony_ci    /* skip pAllocator */
734bf215546Sopenharmony_ci    if (vn_decode_simple_pointer(dec)) {
735bf215546Sopenharmony_ci        vn_decode_VkBuffer(dec, pBuffer);
736bf215546Sopenharmony_ci    } else {
737bf215546Sopenharmony_ci        pBuffer = NULL;
738bf215546Sopenharmony_ci    }
739bf215546Sopenharmony_ci
740bf215546Sopenharmony_ci    return ret;
741bf215546Sopenharmony_ci}
742bf215546Sopenharmony_ci
743bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
744bf215546Sopenharmony_ci{
745bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyBuffer_EXT;
746bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
747bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
748bf215546Sopenharmony_ci
749bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
750bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkBuffer(&buffer);
751bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pAllocator);
752bf215546Sopenharmony_ci    if (pAllocator)
753bf215546Sopenharmony_ci        assert(false);
754bf215546Sopenharmony_ci
755bf215546Sopenharmony_ci    return cmd_size;
756bf215546Sopenharmony_ci}
757bf215546Sopenharmony_ci
758bf215546Sopenharmony_cistatic inline void vn_encode_vkDestroyBuffer(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
759bf215546Sopenharmony_ci{
760bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyBuffer_EXT;
761bf215546Sopenharmony_ci
762bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
763bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
764bf215546Sopenharmony_ci
765bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
766bf215546Sopenharmony_ci    vn_encode_VkBuffer(enc, &buffer);
767bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pAllocator))
768bf215546Sopenharmony_ci        assert(false);
769bf215546Sopenharmony_ci}
770bf215546Sopenharmony_ci
771bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkDestroyBuffer_reply(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
772bf215546Sopenharmony_ci{
773bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyBuffer_EXT;
774bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
775bf215546Sopenharmony_ci
776bf215546Sopenharmony_ci    /* skip device */
777bf215546Sopenharmony_ci    /* skip buffer */
778bf215546Sopenharmony_ci    /* skip pAllocator */
779bf215546Sopenharmony_ci
780bf215546Sopenharmony_ci    return cmd_size;
781bf215546Sopenharmony_ci}
782bf215546Sopenharmony_ci
783bf215546Sopenharmony_cistatic inline void vn_decode_vkDestroyBuffer_reply(struct vn_cs_decoder *dec, VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
784bf215546Sopenharmony_ci{
785bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
786bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
787bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkDestroyBuffer_EXT);
788bf215546Sopenharmony_ci
789bf215546Sopenharmony_ci    /* skip device */
790bf215546Sopenharmony_ci    /* skip buffer */
791bf215546Sopenharmony_ci    /* skip pAllocator */
792bf215546Sopenharmony_ci}
793bf215546Sopenharmony_ci
794bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
795bf215546Sopenharmony_ci{
796bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory2_EXT;
797bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
798bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
799bf215546Sopenharmony_ci
800bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
801bf215546Sopenharmony_ci    cmd_size += vn_sizeof_uint32_t(&bindInfoCount);
802bf215546Sopenharmony_ci    if (pBindInfos) {
803bf215546Sopenharmony_ci        cmd_size += vn_sizeof_array_size(bindInfoCount);
804bf215546Sopenharmony_ci        for (uint32_t i = 0; i < bindInfoCount; i++)
805bf215546Sopenharmony_ci            cmd_size += vn_sizeof_VkBindBufferMemoryInfo(&pBindInfos[i]);
806bf215546Sopenharmony_ci    } else {
807bf215546Sopenharmony_ci        cmd_size += vn_sizeof_array_size(0);
808bf215546Sopenharmony_ci    }
809bf215546Sopenharmony_ci
810bf215546Sopenharmony_ci    return cmd_size;
811bf215546Sopenharmony_ci}
812bf215546Sopenharmony_ci
813bf215546Sopenharmony_cistatic inline void vn_encode_vkBindBufferMemory2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
814bf215546Sopenharmony_ci{
815bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory2_EXT;
816bf215546Sopenharmony_ci
817bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
818bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
819bf215546Sopenharmony_ci
820bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
821bf215546Sopenharmony_ci    vn_encode_uint32_t(enc, &bindInfoCount);
822bf215546Sopenharmony_ci    if (pBindInfos) {
823bf215546Sopenharmony_ci        vn_encode_array_size(enc, bindInfoCount);
824bf215546Sopenharmony_ci        for (uint32_t i = 0; i < bindInfoCount; i++)
825bf215546Sopenharmony_ci            vn_encode_VkBindBufferMemoryInfo(enc, &pBindInfos[i]);
826bf215546Sopenharmony_ci    } else {
827bf215546Sopenharmony_ci        vn_encode_array_size(enc, 0);
828bf215546Sopenharmony_ci    }
829bf215546Sopenharmony_ci}
830bf215546Sopenharmony_ci
831bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkBindBufferMemory2_reply(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
832bf215546Sopenharmony_ci{
833bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindBufferMemory2_EXT;
834bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
835bf215546Sopenharmony_ci
836bf215546Sopenharmony_ci    VkResult ret;
837bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkResult(&ret);
838bf215546Sopenharmony_ci    /* skip device */
839bf215546Sopenharmony_ci    /* skip bindInfoCount */
840bf215546Sopenharmony_ci    /* skip pBindInfos */
841bf215546Sopenharmony_ci
842bf215546Sopenharmony_ci    return cmd_size;
843bf215546Sopenharmony_ci}
844bf215546Sopenharmony_ci
845bf215546Sopenharmony_cistatic inline VkResult vn_decode_vkBindBufferMemory2_reply(struct vn_cs_decoder *dec, VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
846bf215546Sopenharmony_ci{
847bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
848bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
849bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkBindBufferMemory2_EXT);
850bf215546Sopenharmony_ci
851bf215546Sopenharmony_ci    VkResult ret;
852bf215546Sopenharmony_ci    vn_decode_VkResult(dec, &ret);
853bf215546Sopenharmony_ci    /* skip device */
854bf215546Sopenharmony_ci    /* skip bindInfoCount */
855bf215546Sopenharmony_ci    /* skip pBindInfos */
856bf215546Sopenharmony_ci
857bf215546Sopenharmony_ci    return ret;
858bf215546Sopenharmony_ci}
859bf215546Sopenharmony_ci
860bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
861bf215546Sopenharmony_ci{
862bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements2_EXT;
863bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
864bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
865bf215546Sopenharmony_ci
866bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
867bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pInfo);
868bf215546Sopenharmony_ci    if (pInfo)
869bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBufferMemoryRequirementsInfo2(pInfo);
870bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
871bf215546Sopenharmony_ci    if (pMemoryRequirements)
872bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements2_partial(pMemoryRequirements);
873bf215546Sopenharmony_ci
874bf215546Sopenharmony_ci    return cmd_size;
875bf215546Sopenharmony_ci}
876bf215546Sopenharmony_ci
877bf215546Sopenharmony_cistatic inline void vn_encode_vkGetBufferMemoryRequirements2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
878bf215546Sopenharmony_ci{
879bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements2_EXT;
880bf215546Sopenharmony_ci
881bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
882bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
883bf215546Sopenharmony_ci
884bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
885bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pInfo))
886bf215546Sopenharmony_ci        vn_encode_VkBufferMemoryRequirementsInfo2(enc, pInfo);
887bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pMemoryRequirements))
888bf215546Sopenharmony_ci        vn_encode_VkMemoryRequirements2_partial(enc, pMemoryRequirements);
889bf215546Sopenharmony_ci}
890bf215546Sopenharmony_ci
891bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferMemoryRequirements2_reply(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
892bf215546Sopenharmony_ci{
893bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferMemoryRequirements2_EXT;
894bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
895bf215546Sopenharmony_ci
896bf215546Sopenharmony_ci    /* skip device */
897bf215546Sopenharmony_ci    /* skip pInfo */
898bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
899bf215546Sopenharmony_ci    if (pMemoryRequirements)
900bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements2(pMemoryRequirements);
901bf215546Sopenharmony_ci
902bf215546Sopenharmony_ci    return cmd_size;
903bf215546Sopenharmony_ci}
904bf215546Sopenharmony_ci
905bf215546Sopenharmony_cistatic inline void vn_decode_vkGetBufferMemoryRequirements2_reply(struct vn_cs_decoder *dec, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
906bf215546Sopenharmony_ci{
907bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
908bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
909bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkGetBufferMemoryRequirements2_EXT);
910bf215546Sopenharmony_ci
911bf215546Sopenharmony_ci    /* skip device */
912bf215546Sopenharmony_ci    /* skip pInfo */
913bf215546Sopenharmony_ci    if (vn_decode_simple_pointer(dec)) {
914bf215546Sopenharmony_ci        vn_decode_VkMemoryRequirements2(dec, pMemoryRequirements);
915bf215546Sopenharmony_ci    } else {
916bf215546Sopenharmony_ci        pMemoryRequirements = NULL;
917bf215546Sopenharmony_ci    }
918bf215546Sopenharmony_ci}
919bf215546Sopenharmony_ci
920bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
921bf215546Sopenharmony_ci{
922bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetDeviceBufferMemoryRequirements_EXT;
923bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
924bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
925bf215546Sopenharmony_ci
926bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
927bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pInfo);
928bf215546Sopenharmony_ci    if (pInfo)
929bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkDeviceBufferMemoryRequirements(pInfo);
930bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
931bf215546Sopenharmony_ci    if (pMemoryRequirements)
932bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements2_partial(pMemoryRequirements);
933bf215546Sopenharmony_ci
934bf215546Sopenharmony_ci    return cmd_size;
935bf215546Sopenharmony_ci}
936bf215546Sopenharmony_ci
937bf215546Sopenharmony_cistatic inline void vn_encode_vkGetDeviceBufferMemoryRequirements(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
938bf215546Sopenharmony_ci{
939bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetDeviceBufferMemoryRequirements_EXT;
940bf215546Sopenharmony_ci
941bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
942bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
943bf215546Sopenharmony_ci
944bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
945bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pInfo))
946bf215546Sopenharmony_ci        vn_encode_VkDeviceBufferMemoryRequirements(enc, pInfo);
947bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pMemoryRequirements))
948bf215546Sopenharmony_ci        vn_encode_VkMemoryRequirements2_partial(enc, pMemoryRequirements);
949bf215546Sopenharmony_ci}
950bf215546Sopenharmony_ci
951bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetDeviceBufferMemoryRequirements_reply(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
952bf215546Sopenharmony_ci{
953bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetDeviceBufferMemoryRequirements_EXT;
954bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
955bf215546Sopenharmony_ci
956bf215546Sopenharmony_ci    /* skip device */
957bf215546Sopenharmony_ci    /* skip pInfo */
958bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements);
959bf215546Sopenharmony_ci    if (pMemoryRequirements)
960bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkMemoryRequirements2(pMemoryRequirements);
961bf215546Sopenharmony_ci
962bf215546Sopenharmony_ci    return cmd_size;
963bf215546Sopenharmony_ci}
964bf215546Sopenharmony_ci
965bf215546Sopenharmony_cistatic inline void vn_decode_vkGetDeviceBufferMemoryRequirements_reply(struct vn_cs_decoder *dec, VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
966bf215546Sopenharmony_ci{
967bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
968bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
969bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkGetDeviceBufferMemoryRequirements_EXT);
970bf215546Sopenharmony_ci
971bf215546Sopenharmony_ci    /* skip device */
972bf215546Sopenharmony_ci    /* skip pInfo */
973bf215546Sopenharmony_ci    if (vn_decode_simple_pointer(dec)) {
974bf215546Sopenharmony_ci        vn_decode_VkMemoryRequirements2(dec, pMemoryRequirements);
975bf215546Sopenharmony_ci    } else {
976bf215546Sopenharmony_ci        pMemoryRequirements = NULL;
977bf215546Sopenharmony_ci    }
978bf215546Sopenharmony_ci}
979bf215546Sopenharmony_ci
980bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
981bf215546Sopenharmony_ci{
982bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferOpaqueCaptureAddress_EXT;
983bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
984bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
985bf215546Sopenharmony_ci
986bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
987bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pInfo);
988bf215546Sopenharmony_ci    if (pInfo)
989bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBufferDeviceAddressInfo(pInfo);
990bf215546Sopenharmony_ci
991bf215546Sopenharmony_ci    return cmd_size;
992bf215546Sopenharmony_ci}
993bf215546Sopenharmony_ci
994bf215546Sopenharmony_cistatic inline void vn_encode_vkGetBufferOpaqueCaptureAddress(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
995bf215546Sopenharmony_ci{
996bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferOpaqueCaptureAddress_EXT;
997bf215546Sopenharmony_ci
998bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
999bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
1000bf215546Sopenharmony_ci
1001bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
1002bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pInfo))
1003bf215546Sopenharmony_ci        vn_encode_VkBufferDeviceAddressInfo(enc, pInfo);
1004bf215546Sopenharmony_ci}
1005bf215546Sopenharmony_ci
1006bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferOpaqueCaptureAddress_reply(VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1007bf215546Sopenharmony_ci{
1008bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferOpaqueCaptureAddress_EXT;
1009bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1010bf215546Sopenharmony_ci
1011bf215546Sopenharmony_ci    uint64_t ret;
1012bf215546Sopenharmony_ci    cmd_size += vn_sizeof_uint64_t(&ret);
1013bf215546Sopenharmony_ci    /* skip device */
1014bf215546Sopenharmony_ci    /* skip pInfo */
1015bf215546Sopenharmony_ci
1016bf215546Sopenharmony_ci    return cmd_size;
1017bf215546Sopenharmony_ci}
1018bf215546Sopenharmony_ci
1019bf215546Sopenharmony_cistatic inline uint64_t vn_decode_vkGetBufferOpaqueCaptureAddress_reply(struct vn_cs_decoder *dec, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1020bf215546Sopenharmony_ci{
1021bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
1022bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
1023bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkGetBufferOpaqueCaptureAddress_EXT);
1024bf215546Sopenharmony_ci
1025bf215546Sopenharmony_ci    uint64_t ret;
1026bf215546Sopenharmony_ci    vn_decode_uint64_t(dec, &ret);
1027bf215546Sopenharmony_ci    /* skip device */
1028bf215546Sopenharmony_ci    /* skip pInfo */
1029bf215546Sopenharmony_ci
1030bf215546Sopenharmony_ci    return ret;
1031bf215546Sopenharmony_ci}
1032bf215546Sopenharmony_ci
1033bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1034bf215546Sopenharmony_ci{
1035bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferDeviceAddress_EXT;
1036bf215546Sopenharmony_ci    const VkFlags cmd_flags = 0;
1037bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
1038bf215546Sopenharmony_ci
1039bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDevice(&device);
1040bf215546Sopenharmony_ci    cmd_size += vn_sizeof_simple_pointer(pInfo);
1041bf215546Sopenharmony_ci    if (pInfo)
1042bf215546Sopenharmony_ci        cmd_size += vn_sizeof_VkBufferDeviceAddressInfo(pInfo);
1043bf215546Sopenharmony_ci
1044bf215546Sopenharmony_ci    return cmd_size;
1045bf215546Sopenharmony_ci}
1046bf215546Sopenharmony_ci
1047bf215546Sopenharmony_cistatic inline void vn_encode_vkGetBufferDeviceAddress(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1048bf215546Sopenharmony_ci{
1049bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferDeviceAddress_EXT;
1050bf215546Sopenharmony_ci
1051bf215546Sopenharmony_ci    vn_encode_VkCommandTypeEXT(enc, &cmd_type);
1052bf215546Sopenharmony_ci    vn_encode_VkFlags(enc, &cmd_flags);
1053bf215546Sopenharmony_ci
1054bf215546Sopenharmony_ci    vn_encode_VkDevice(enc, &device);
1055bf215546Sopenharmony_ci    if (vn_encode_simple_pointer(enc, pInfo))
1056bf215546Sopenharmony_ci        vn_encode_VkBufferDeviceAddressInfo(enc, pInfo);
1057bf215546Sopenharmony_ci}
1058bf215546Sopenharmony_ci
1059bf215546Sopenharmony_cistatic inline size_t vn_sizeof_vkGetBufferDeviceAddress_reply(VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1060bf215546Sopenharmony_ci{
1061bf215546Sopenharmony_ci    const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetBufferDeviceAddress_EXT;
1062bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
1063bf215546Sopenharmony_ci
1064bf215546Sopenharmony_ci    VkDeviceAddress ret;
1065bf215546Sopenharmony_ci    cmd_size += vn_sizeof_VkDeviceAddress(&ret);
1066bf215546Sopenharmony_ci    /* skip device */
1067bf215546Sopenharmony_ci    /* skip pInfo */
1068bf215546Sopenharmony_ci
1069bf215546Sopenharmony_ci    return cmd_size;
1070bf215546Sopenharmony_ci}
1071bf215546Sopenharmony_ci
1072bf215546Sopenharmony_cistatic inline VkDeviceAddress vn_decode_vkGetBufferDeviceAddress_reply(struct vn_cs_decoder *dec, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1073bf215546Sopenharmony_ci{
1074bf215546Sopenharmony_ci    VkCommandTypeEXT command_type;
1075bf215546Sopenharmony_ci    vn_decode_VkCommandTypeEXT(dec, &command_type);
1076bf215546Sopenharmony_ci    assert(command_type == VK_COMMAND_TYPE_vkGetBufferDeviceAddress_EXT);
1077bf215546Sopenharmony_ci
1078bf215546Sopenharmony_ci    VkDeviceAddress ret;
1079bf215546Sopenharmony_ci    vn_decode_VkDeviceAddress(dec, &ret);
1080bf215546Sopenharmony_ci    /* skip device */
1081bf215546Sopenharmony_ci    /* skip pInfo */
1082bf215546Sopenharmony_ci
1083bf215546Sopenharmony_ci    return ret;
1084bf215546Sopenharmony_ci}
1085bf215546Sopenharmony_ci
1086bf215546Sopenharmony_cistatic inline void vn_submit_vkGetBufferMemoryRequirements(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements, struct vn_instance_submit_command *submit)
1087bf215546Sopenharmony_ci{
1088bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1089bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1090bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1091bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1092bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1093bf215546Sopenharmony_ci        if (!cmd_data)
1094bf215546Sopenharmony_ci            cmd_size = 0;
1095bf215546Sopenharmony_ci    }
1096bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetBufferMemoryRequirements_reply(device, buffer, pMemoryRequirements) : 0;
1097bf215546Sopenharmony_ci
1098bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1099bf215546Sopenharmony_ci    if (cmd_size) {
1100bf215546Sopenharmony_ci        vn_encode_vkGetBufferMemoryRequirements(enc, cmd_flags, device, buffer, pMemoryRequirements);
1101bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1102bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1103bf215546Sopenharmony_ci            free(cmd_data);
1104bf215546Sopenharmony_ci    }
1105bf215546Sopenharmony_ci}
1106bf215546Sopenharmony_ci
1107bf215546Sopenharmony_cistatic inline void vn_submit_vkBindBufferMemory(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset, struct vn_instance_submit_command *submit)
1108bf215546Sopenharmony_ci{
1109bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1110bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1111bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkBindBufferMemory(device, buffer, memory, memoryOffset);
1112bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1113bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1114bf215546Sopenharmony_ci        if (!cmd_data)
1115bf215546Sopenharmony_ci            cmd_size = 0;
1116bf215546Sopenharmony_ci    }
1117bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkBindBufferMemory_reply(device, buffer, memory, memoryOffset) : 0;
1118bf215546Sopenharmony_ci
1119bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1120bf215546Sopenharmony_ci    if (cmd_size) {
1121bf215546Sopenharmony_ci        vn_encode_vkBindBufferMemory(enc, cmd_flags, device, buffer, memory, memoryOffset);
1122bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1123bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1124bf215546Sopenharmony_ci            free(cmd_data);
1125bf215546Sopenharmony_ci    }
1126bf215546Sopenharmony_ci}
1127bf215546Sopenharmony_ci
1128bf215546Sopenharmony_cistatic inline void vn_submit_vkCreateBuffer(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer, struct vn_instance_submit_command *submit)
1129bf215546Sopenharmony_ci{
1130bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1131bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1132bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
1133bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1134bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1135bf215546Sopenharmony_ci        if (!cmd_data)
1136bf215546Sopenharmony_ci            cmd_size = 0;
1137bf215546Sopenharmony_ci    }
1138bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateBuffer_reply(device, pCreateInfo, pAllocator, pBuffer) : 0;
1139bf215546Sopenharmony_ci
1140bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1141bf215546Sopenharmony_ci    if (cmd_size) {
1142bf215546Sopenharmony_ci        vn_encode_vkCreateBuffer(enc, cmd_flags, device, pCreateInfo, pAllocator, pBuffer);
1143bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1144bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1145bf215546Sopenharmony_ci            free(cmd_data);
1146bf215546Sopenharmony_ci    }
1147bf215546Sopenharmony_ci}
1148bf215546Sopenharmony_ci
1149bf215546Sopenharmony_cistatic inline void vn_submit_vkDestroyBuffer(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator, struct vn_instance_submit_command *submit)
1150bf215546Sopenharmony_ci{
1151bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1152bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1153bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkDestroyBuffer(device, buffer, pAllocator);
1154bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1155bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1156bf215546Sopenharmony_ci        if (!cmd_data)
1157bf215546Sopenharmony_ci            cmd_size = 0;
1158bf215546Sopenharmony_ci    }
1159bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkDestroyBuffer_reply(device, buffer, pAllocator) : 0;
1160bf215546Sopenharmony_ci
1161bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1162bf215546Sopenharmony_ci    if (cmd_size) {
1163bf215546Sopenharmony_ci        vn_encode_vkDestroyBuffer(enc, cmd_flags, device, buffer, pAllocator);
1164bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1165bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1166bf215546Sopenharmony_ci            free(cmd_data);
1167bf215546Sopenharmony_ci    }
1168bf215546Sopenharmony_ci}
1169bf215546Sopenharmony_ci
1170bf215546Sopenharmony_cistatic inline void vn_submit_vkBindBufferMemory2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos, struct vn_instance_submit_command *submit)
1171bf215546Sopenharmony_ci{
1172bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1173bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1174bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkBindBufferMemory2(device, bindInfoCount, pBindInfos);
1175bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1176bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1177bf215546Sopenharmony_ci        if (!cmd_data)
1178bf215546Sopenharmony_ci            cmd_size = 0;
1179bf215546Sopenharmony_ci    }
1180bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkBindBufferMemory2_reply(device, bindInfoCount, pBindInfos) : 0;
1181bf215546Sopenharmony_ci
1182bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1183bf215546Sopenharmony_ci    if (cmd_size) {
1184bf215546Sopenharmony_ci        vn_encode_vkBindBufferMemory2(enc, cmd_flags, device, bindInfoCount, pBindInfos);
1185bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1186bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1187bf215546Sopenharmony_ci            free(cmd_data);
1188bf215546Sopenharmony_ci    }
1189bf215546Sopenharmony_ci}
1190bf215546Sopenharmony_ci
1191bf215546Sopenharmony_cistatic inline void vn_submit_vkGetBufferMemoryRequirements2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements, struct vn_instance_submit_command *submit)
1192bf215546Sopenharmony_ci{
1193bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1194bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1195bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
1196bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1197bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1198bf215546Sopenharmony_ci        if (!cmd_data)
1199bf215546Sopenharmony_ci            cmd_size = 0;
1200bf215546Sopenharmony_ci    }
1201bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetBufferMemoryRequirements2_reply(device, pInfo, pMemoryRequirements) : 0;
1202bf215546Sopenharmony_ci
1203bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1204bf215546Sopenharmony_ci    if (cmd_size) {
1205bf215546Sopenharmony_ci        vn_encode_vkGetBufferMemoryRequirements2(enc, cmd_flags, device, pInfo, pMemoryRequirements);
1206bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1207bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1208bf215546Sopenharmony_ci            free(cmd_data);
1209bf215546Sopenharmony_ci    }
1210bf215546Sopenharmony_ci}
1211bf215546Sopenharmony_ci
1212bf215546Sopenharmony_cistatic inline void vn_submit_vkGetDeviceBufferMemoryRequirements(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements, struct vn_instance_submit_command *submit)
1213bf215546Sopenharmony_ci{
1214bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1215bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1216bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkGetDeviceBufferMemoryRequirements(device, pInfo, pMemoryRequirements);
1217bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1218bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1219bf215546Sopenharmony_ci        if (!cmd_data)
1220bf215546Sopenharmony_ci            cmd_size = 0;
1221bf215546Sopenharmony_ci    }
1222bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetDeviceBufferMemoryRequirements_reply(device, pInfo, pMemoryRequirements) : 0;
1223bf215546Sopenharmony_ci
1224bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1225bf215546Sopenharmony_ci    if (cmd_size) {
1226bf215546Sopenharmony_ci        vn_encode_vkGetDeviceBufferMemoryRequirements(enc, cmd_flags, device, pInfo, pMemoryRequirements);
1227bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1228bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1229bf215546Sopenharmony_ci            free(cmd_data);
1230bf215546Sopenharmony_ci    }
1231bf215546Sopenharmony_ci}
1232bf215546Sopenharmony_ci
1233bf215546Sopenharmony_cistatic inline void vn_submit_vkGetBufferOpaqueCaptureAddress(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferDeviceAddressInfo* pInfo, struct vn_instance_submit_command *submit)
1234bf215546Sopenharmony_ci{
1235bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1236bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1237bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkGetBufferOpaqueCaptureAddress(device, pInfo);
1238bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1239bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1240bf215546Sopenharmony_ci        if (!cmd_data)
1241bf215546Sopenharmony_ci            cmd_size = 0;
1242bf215546Sopenharmony_ci    }
1243bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetBufferOpaqueCaptureAddress_reply(device, pInfo) : 0;
1244bf215546Sopenharmony_ci
1245bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1246bf215546Sopenharmony_ci    if (cmd_size) {
1247bf215546Sopenharmony_ci        vn_encode_vkGetBufferOpaqueCaptureAddress(enc, cmd_flags, device, pInfo);
1248bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1249bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1250bf215546Sopenharmony_ci            free(cmd_data);
1251bf215546Sopenharmony_ci    }
1252bf215546Sopenharmony_ci}
1253bf215546Sopenharmony_ci
1254bf215546Sopenharmony_cistatic inline void vn_submit_vkGetBufferDeviceAddress(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkBufferDeviceAddressInfo* pInfo, struct vn_instance_submit_command *submit)
1255bf215546Sopenharmony_ci{
1256bf215546Sopenharmony_ci    uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
1257bf215546Sopenharmony_ci    void *cmd_data = local_cmd_data;
1258bf215546Sopenharmony_ci    size_t cmd_size = vn_sizeof_vkGetBufferDeviceAddress(device, pInfo);
1259bf215546Sopenharmony_ci    if (cmd_size > sizeof(local_cmd_data)) {
1260bf215546Sopenharmony_ci        cmd_data = malloc(cmd_size);
1261bf215546Sopenharmony_ci        if (!cmd_data)
1262bf215546Sopenharmony_ci            cmd_size = 0;
1263bf215546Sopenharmony_ci    }
1264bf215546Sopenharmony_ci    const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetBufferDeviceAddress_reply(device, pInfo) : 0;
1265bf215546Sopenharmony_ci
1266bf215546Sopenharmony_ci    struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
1267bf215546Sopenharmony_ci    if (cmd_size) {
1268bf215546Sopenharmony_ci        vn_encode_vkGetBufferDeviceAddress(enc, cmd_flags, device, pInfo);
1269bf215546Sopenharmony_ci        vn_instance_submit_command(vn_instance, submit);
1270bf215546Sopenharmony_ci        if (cmd_data != local_cmd_data)
1271bf215546Sopenharmony_ci            free(cmd_data);
1272bf215546Sopenharmony_ci    }
1273bf215546Sopenharmony_ci}
1274bf215546Sopenharmony_ci
1275bf215546Sopenharmony_cistatic inline void vn_call_vkGetBufferMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
1276bf215546Sopenharmony_ci{
1277bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1278bf215546Sopenharmony_ci
1279bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1280bf215546Sopenharmony_ci    vn_submit_vkGetBufferMemoryRequirements(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, buffer, pMemoryRequirements, &submit);
1281bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1282bf215546Sopenharmony_ci    if (dec) {
1283bf215546Sopenharmony_ci        vn_decode_vkGetBufferMemoryRequirements_reply(dec, device, buffer, pMemoryRequirements);
1284bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1285bf215546Sopenharmony_ci    }
1286bf215546Sopenharmony_ci}
1287bf215546Sopenharmony_ci
1288bf215546Sopenharmony_cistatic inline void vn_async_vkGetBufferMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
1289bf215546Sopenharmony_ci{
1290bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1291bf215546Sopenharmony_ci    vn_submit_vkGetBufferMemoryRequirements(vn_instance, 0, device, buffer, pMemoryRequirements, &submit);
1292bf215546Sopenharmony_ci}
1293bf215546Sopenharmony_ci
1294bf215546Sopenharmony_cistatic inline VkResult vn_call_vkBindBufferMemory(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
1295bf215546Sopenharmony_ci{
1296bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1297bf215546Sopenharmony_ci
1298bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1299bf215546Sopenharmony_ci    vn_submit_vkBindBufferMemory(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, buffer, memory, memoryOffset, &submit);
1300bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1301bf215546Sopenharmony_ci    if (dec) {
1302bf215546Sopenharmony_ci        const VkResult ret = vn_decode_vkBindBufferMemory_reply(dec, device, buffer, memory, memoryOffset);
1303bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1304bf215546Sopenharmony_ci        return ret;
1305bf215546Sopenharmony_ci    } else {
1306bf215546Sopenharmony_ci        return VK_ERROR_OUT_OF_HOST_MEMORY;
1307bf215546Sopenharmony_ci    }
1308bf215546Sopenharmony_ci}
1309bf215546Sopenharmony_ci
1310bf215546Sopenharmony_cistatic inline void vn_async_vkBindBufferMemory(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
1311bf215546Sopenharmony_ci{
1312bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1313bf215546Sopenharmony_ci    vn_submit_vkBindBufferMemory(vn_instance, 0, device, buffer, memory, memoryOffset, &submit);
1314bf215546Sopenharmony_ci}
1315bf215546Sopenharmony_ci
1316bf215546Sopenharmony_cistatic inline VkResult vn_call_vkCreateBuffer(struct vn_instance *vn_instance, VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
1317bf215546Sopenharmony_ci{
1318bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1319bf215546Sopenharmony_ci
1320bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1321bf215546Sopenharmony_ci    vn_submit_vkCreateBuffer(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pCreateInfo, pAllocator, pBuffer, &submit);
1322bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1323bf215546Sopenharmony_ci    if (dec) {
1324bf215546Sopenharmony_ci        const VkResult ret = vn_decode_vkCreateBuffer_reply(dec, device, pCreateInfo, pAllocator, pBuffer);
1325bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1326bf215546Sopenharmony_ci        return ret;
1327bf215546Sopenharmony_ci    } else {
1328bf215546Sopenharmony_ci        return VK_ERROR_OUT_OF_HOST_MEMORY;
1329bf215546Sopenharmony_ci    }
1330bf215546Sopenharmony_ci}
1331bf215546Sopenharmony_ci
1332bf215546Sopenharmony_cistatic inline void vn_async_vkCreateBuffer(struct vn_instance *vn_instance, VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
1333bf215546Sopenharmony_ci{
1334bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1335bf215546Sopenharmony_ci    vn_submit_vkCreateBuffer(vn_instance, 0, device, pCreateInfo, pAllocator, pBuffer, &submit);
1336bf215546Sopenharmony_ci}
1337bf215546Sopenharmony_ci
1338bf215546Sopenharmony_cistatic inline void vn_call_vkDestroyBuffer(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
1339bf215546Sopenharmony_ci{
1340bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1341bf215546Sopenharmony_ci
1342bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1343bf215546Sopenharmony_ci    vn_submit_vkDestroyBuffer(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, buffer, pAllocator, &submit);
1344bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1345bf215546Sopenharmony_ci    if (dec) {
1346bf215546Sopenharmony_ci        vn_decode_vkDestroyBuffer_reply(dec, device, buffer, pAllocator);
1347bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1348bf215546Sopenharmony_ci    }
1349bf215546Sopenharmony_ci}
1350bf215546Sopenharmony_ci
1351bf215546Sopenharmony_cistatic inline void vn_async_vkDestroyBuffer(struct vn_instance *vn_instance, VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
1352bf215546Sopenharmony_ci{
1353bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1354bf215546Sopenharmony_ci    vn_submit_vkDestroyBuffer(vn_instance, 0, device, buffer, pAllocator, &submit);
1355bf215546Sopenharmony_ci}
1356bf215546Sopenharmony_ci
1357bf215546Sopenharmony_cistatic inline VkResult vn_call_vkBindBufferMemory2(struct vn_instance *vn_instance, VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
1358bf215546Sopenharmony_ci{
1359bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1360bf215546Sopenharmony_ci
1361bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1362bf215546Sopenharmony_ci    vn_submit_vkBindBufferMemory2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, bindInfoCount, pBindInfos, &submit);
1363bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1364bf215546Sopenharmony_ci    if (dec) {
1365bf215546Sopenharmony_ci        const VkResult ret = vn_decode_vkBindBufferMemory2_reply(dec, device, bindInfoCount, pBindInfos);
1366bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1367bf215546Sopenharmony_ci        return ret;
1368bf215546Sopenharmony_ci    } else {
1369bf215546Sopenharmony_ci        return VK_ERROR_OUT_OF_HOST_MEMORY;
1370bf215546Sopenharmony_ci    }
1371bf215546Sopenharmony_ci}
1372bf215546Sopenharmony_ci
1373bf215546Sopenharmony_cistatic inline void vn_async_vkBindBufferMemory2(struct vn_instance *vn_instance, VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos)
1374bf215546Sopenharmony_ci{
1375bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1376bf215546Sopenharmony_ci    vn_submit_vkBindBufferMemory2(vn_instance, 0, device, bindInfoCount, pBindInfos, &submit);
1377bf215546Sopenharmony_ci}
1378bf215546Sopenharmony_ci
1379bf215546Sopenharmony_cistatic inline void vn_call_vkGetBufferMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
1380bf215546Sopenharmony_ci{
1381bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1382bf215546Sopenharmony_ci
1383bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1384bf215546Sopenharmony_ci    vn_submit_vkGetBufferMemoryRequirements2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, pMemoryRequirements, &submit);
1385bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1386bf215546Sopenharmony_ci    if (dec) {
1387bf215546Sopenharmony_ci        vn_decode_vkGetBufferMemoryRequirements2_reply(dec, device, pInfo, pMemoryRequirements);
1388bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1389bf215546Sopenharmony_ci    }
1390bf215546Sopenharmony_ci}
1391bf215546Sopenharmony_ci
1392bf215546Sopenharmony_cistatic inline void vn_async_vkGetBufferMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements)
1393bf215546Sopenharmony_ci{
1394bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1395bf215546Sopenharmony_ci    vn_submit_vkGetBufferMemoryRequirements2(vn_instance, 0, device, pInfo, pMemoryRequirements, &submit);
1396bf215546Sopenharmony_ci}
1397bf215546Sopenharmony_ci
1398bf215546Sopenharmony_cistatic inline void vn_call_vkGetDeviceBufferMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
1399bf215546Sopenharmony_ci{
1400bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1401bf215546Sopenharmony_ci
1402bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1403bf215546Sopenharmony_ci    vn_submit_vkGetDeviceBufferMemoryRequirements(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, pMemoryRequirements, &submit);
1404bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1405bf215546Sopenharmony_ci    if (dec) {
1406bf215546Sopenharmony_ci        vn_decode_vkGetDeviceBufferMemoryRequirements_reply(dec, device, pInfo, pMemoryRequirements);
1407bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1408bf215546Sopenharmony_ci    }
1409bf215546Sopenharmony_ci}
1410bf215546Sopenharmony_ci
1411bf215546Sopenharmony_cistatic inline void vn_async_vkGetDeviceBufferMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements)
1412bf215546Sopenharmony_ci{
1413bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1414bf215546Sopenharmony_ci    vn_submit_vkGetDeviceBufferMemoryRequirements(vn_instance, 0, device, pInfo, pMemoryRequirements, &submit);
1415bf215546Sopenharmony_ci}
1416bf215546Sopenharmony_ci
1417bf215546Sopenharmony_cistatic inline uint64_t vn_call_vkGetBufferOpaqueCaptureAddress(struct vn_instance *vn_instance, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1418bf215546Sopenharmony_ci{
1419bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1420bf215546Sopenharmony_ci
1421bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1422bf215546Sopenharmony_ci    vn_submit_vkGetBufferOpaqueCaptureAddress(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, &submit);
1423bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1424bf215546Sopenharmony_ci    if (dec) {
1425bf215546Sopenharmony_ci        const uint64_t ret = vn_decode_vkGetBufferOpaqueCaptureAddress_reply(dec, device, pInfo);
1426bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1427bf215546Sopenharmony_ci        return ret;
1428bf215546Sopenharmony_ci    } else {
1429bf215546Sopenharmony_ci        return VK_ERROR_OUT_OF_HOST_MEMORY;
1430bf215546Sopenharmony_ci    }
1431bf215546Sopenharmony_ci}
1432bf215546Sopenharmony_ci
1433bf215546Sopenharmony_cistatic inline void vn_async_vkGetBufferOpaqueCaptureAddress(struct vn_instance *vn_instance, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1434bf215546Sopenharmony_ci{
1435bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1436bf215546Sopenharmony_ci    vn_submit_vkGetBufferOpaqueCaptureAddress(vn_instance, 0, device, pInfo, &submit);
1437bf215546Sopenharmony_ci}
1438bf215546Sopenharmony_ci
1439bf215546Sopenharmony_cistatic inline VkDeviceAddress vn_call_vkGetBufferDeviceAddress(struct vn_instance *vn_instance, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1440bf215546Sopenharmony_ci{
1441bf215546Sopenharmony_ci    VN_TRACE_FUNC();
1442bf215546Sopenharmony_ci
1443bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1444bf215546Sopenharmony_ci    vn_submit_vkGetBufferDeviceAddress(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, &submit);
1445bf215546Sopenharmony_ci    struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
1446bf215546Sopenharmony_ci    if (dec) {
1447bf215546Sopenharmony_ci        const VkDeviceAddress ret = vn_decode_vkGetBufferDeviceAddress_reply(dec, device, pInfo);
1448bf215546Sopenharmony_ci        vn_instance_free_command_reply(vn_instance, &submit);
1449bf215546Sopenharmony_ci        return ret;
1450bf215546Sopenharmony_ci    } else {
1451bf215546Sopenharmony_ci        return VK_ERROR_OUT_OF_HOST_MEMORY;
1452bf215546Sopenharmony_ci    }
1453bf215546Sopenharmony_ci}
1454bf215546Sopenharmony_ci
1455bf215546Sopenharmony_cistatic inline void vn_async_vkGetBufferDeviceAddress(struct vn_instance *vn_instance, VkDevice device, const VkBufferDeviceAddressInfo* pInfo)
1456bf215546Sopenharmony_ci{
1457bf215546Sopenharmony_ci    struct vn_instance_submit_command submit;
1458bf215546Sopenharmony_ci    vn_submit_vkGetBufferDeviceAddress(vn_instance, 0, device, pInfo, &submit);
1459bf215546Sopenharmony_ci}
1460bf215546Sopenharmony_ci
1461bf215546Sopenharmony_ci#endif /* VN_PROTOCOL_DRIVER_BUFFER_H */
1462