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