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