1 /* This file is generated by venus-protocol. See vn_protocol_renderer.h. */
2
3 /*
4 * Copyright 2020 Google LLC
5 * SPDX-License-Identifier: MIT
6 */
7
8 #ifndef VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H
9 #define VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H
10
11 #include "vn_protocol_renderer_structs.h"
12
13 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Wpointer-arith"
15 #pragma GCC diagnostic ignored "-Wunused-parameter"
16
17 /*
18 * These structs/unions/commands are not included
19 *
20 * VkImportMemoryFdInfoKHR
21 * vkMapMemory
22 */
23
24 /* struct VkExportMemoryAllocateInfo chain */
25
26 static inline void *
vn_decode_VkExportMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)27 vn_decode_VkExportMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
28 {
29 /* no known/supported struct */
30 if (vn_decode_simple_pointer(dec))
31 vn_cs_decoder_set_fatal(dec);
32 return NULL;
33 }
34
35 static inline void
vn_decode_VkExportMemoryAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkExportMemoryAllocateInfo * val)36 vn_decode_VkExportMemoryAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkExportMemoryAllocateInfo *val)
37 {
38 /* skip val->{sType,pNext} */
39 vn_decode_VkFlags(dec, &val->handleTypes);
40 }
41
42 static inline void
vn_decode_VkExportMemoryAllocateInfo_temp(struct vn_cs_decoder * dec,VkExportMemoryAllocateInfo * val)43 vn_decode_VkExportMemoryAllocateInfo_temp(struct vn_cs_decoder *dec, VkExportMemoryAllocateInfo *val)
44 {
45 VkStructureType stype;
46 vn_decode_VkStructureType(dec, &stype);
47 if (stype != VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO)
48 vn_cs_decoder_set_fatal(dec);
49
50 val->sType = stype;
51 val->pNext = vn_decode_VkExportMemoryAllocateInfo_pnext_temp(dec);
52 vn_decode_VkExportMemoryAllocateInfo_self_temp(dec, val);
53 }
54
55 static inline void
vn_replace_VkExportMemoryAllocateInfo_handle_self(VkExportMemoryAllocateInfo * val)56 vn_replace_VkExportMemoryAllocateInfo_handle_self(VkExportMemoryAllocateInfo *val)
57 {
58 /* skip val->sType */
59 /* skip val->pNext */
60 /* skip val->handleTypes */
61 }
62
63 static inline void
vn_replace_VkExportMemoryAllocateInfo_handle(VkExportMemoryAllocateInfo * val)64 vn_replace_VkExportMemoryAllocateInfo_handle(VkExportMemoryAllocateInfo *val)
65 {
66 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
67
68 do {
69 switch ((int32_t)pnext->sType) {
70 case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
71 vn_replace_VkExportMemoryAllocateInfo_handle_self((VkExportMemoryAllocateInfo *)pnext);
72 break;
73 default:
74 /* ignore unknown/unsupported struct */
75 break;
76 }
77 pnext = pnext->pNext;
78 } while (pnext);
79 }
80
81 /* struct VkMemoryAllocateFlagsInfo chain */
82
83 static inline void *
vn_decode_VkMemoryAllocateFlagsInfo_pnext_temp(struct vn_cs_decoder * dec)84 vn_decode_VkMemoryAllocateFlagsInfo_pnext_temp(struct vn_cs_decoder *dec)
85 {
86 /* no known/supported struct */
87 if (vn_decode_simple_pointer(dec))
88 vn_cs_decoder_set_fatal(dec);
89 return NULL;
90 }
91
92 static inline void
vn_decode_VkMemoryAllocateFlagsInfo_self_temp(struct vn_cs_decoder * dec,VkMemoryAllocateFlagsInfo * val)93 vn_decode_VkMemoryAllocateFlagsInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryAllocateFlagsInfo *val)
94 {
95 /* skip val->{sType,pNext} */
96 vn_decode_VkFlags(dec, &val->flags);
97 vn_decode_uint32_t(dec, &val->deviceMask);
98 }
99
100 static inline void
vn_decode_VkMemoryAllocateFlagsInfo_temp(struct vn_cs_decoder * dec,VkMemoryAllocateFlagsInfo * val)101 vn_decode_VkMemoryAllocateFlagsInfo_temp(struct vn_cs_decoder *dec, VkMemoryAllocateFlagsInfo *val)
102 {
103 VkStructureType stype;
104 vn_decode_VkStructureType(dec, &stype);
105 if (stype != VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO)
106 vn_cs_decoder_set_fatal(dec);
107
108 val->sType = stype;
109 val->pNext = vn_decode_VkMemoryAllocateFlagsInfo_pnext_temp(dec);
110 vn_decode_VkMemoryAllocateFlagsInfo_self_temp(dec, val);
111 }
112
113 static inline void
vn_replace_VkMemoryAllocateFlagsInfo_handle_self(VkMemoryAllocateFlagsInfo * val)114 vn_replace_VkMemoryAllocateFlagsInfo_handle_self(VkMemoryAllocateFlagsInfo *val)
115 {
116 /* skip val->sType */
117 /* skip val->pNext */
118 /* skip val->flags */
119 /* skip val->deviceMask */
120 }
121
122 static inline void
vn_replace_VkMemoryAllocateFlagsInfo_handle(VkMemoryAllocateFlagsInfo * val)123 vn_replace_VkMemoryAllocateFlagsInfo_handle(VkMemoryAllocateFlagsInfo *val)
124 {
125 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
126
127 do {
128 switch ((int32_t)pnext->sType) {
129 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
130 vn_replace_VkMemoryAllocateFlagsInfo_handle_self((VkMemoryAllocateFlagsInfo *)pnext);
131 break;
132 default:
133 /* ignore unknown/unsupported struct */
134 break;
135 }
136 pnext = pnext->pNext;
137 } while (pnext);
138 }
139
140 /* struct VkMemoryDedicatedAllocateInfo chain */
141
142 static inline void *
vn_decode_VkMemoryDedicatedAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)143 vn_decode_VkMemoryDedicatedAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
144 {
145 /* no known/supported struct */
146 if (vn_decode_simple_pointer(dec))
147 vn_cs_decoder_set_fatal(dec);
148 return NULL;
149 }
150
151 static inline void
vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkMemoryDedicatedAllocateInfo * val)152 vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryDedicatedAllocateInfo *val)
153 {
154 /* skip val->{sType,pNext} */
155 vn_decode_VkImage_lookup(dec, &val->image);
156 vn_decode_VkBuffer_lookup(dec, &val->buffer);
157 }
158
159 static inline void
vn_decode_VkMemoryDedicatedAllocateInfo_temp(struct vn_cs_decoder * dec,VkMemoryDedicatedAllocateInfo * val)160 vn_decode_VkMemoryDedicatedAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryDedicatedAllocateInfo *val)
161 {
162 VkStructureType stype;
163 vn_decode_VkStructureType(dec, &stype);
164 if (stype != VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO)
165 vn_cs_decoder_set_fatal(dec);
166
167 val->sType = stype;
168 val->pNext = vn_decode_VkMemoryDedicatedAllocateInfo_pnext_temp(dec);
169 vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(dec, val);
170 }
171
172 static inline void
vn_replace_VkMemoryDedicatedAllocateInfo_handle_self(VkMemoryDedicatedAllocateInfo * val)173 vn_replace_VkMemoryDedicatedAllocateInfo_handle_self(VkMemoryDedicatedAllocateInfo *val)
174 {
175 /* skip val->sType */
176 /* skip val->pNext */
177 vn_replace_VkImage_handle(&val->image);
178 vn_replace_VkBuffer_handle(&val->buffer);
179 }
180
181 static inline void
vn_replace_VkMemoryDedicatedAllocateInfo_handle(VkMemoryDedicatedAllocateInfo * val)182 vn_replace_VkMemoryDedicatedAllocateInfo_handle(VkMemoryDedicatedAllocateInfo *val)
183 {
184 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
185
186 do {
187 switch ((int32_t)pnext->sType) {
188 case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
189 vn_replace_VkMemoryDedicatedAllocateInfo_handle_self((VkMemoryDedicatedAllocateInfo *)pnext);
190 break;
191 default:
192 /* ignore unknown/unsupported struct */
193 break;
194 }
195 pnext = pnext->pNext;
196 } while (pnext);
197 }
198
199 /* struct VkMemoryOpaqueCaptureAddressAllocateInfo chain */
200
201 static inline void *
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)202 vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
203 {
204 /* no known/supported struct */
205 if (vn_decode_simple_pointer(dec))
206 vn_cs_decoder_set_fatal(dec);
207 return NULL;
208 }
209
210 static inline void
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkMemoryOpaqueCaptureAddressAllocateInfo * val)211 vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryOpaqueCaptureAddressAllocateInfo *val)
212 {
213 /* skip val->{sType,pNext} */
214 vn_decode_uint64_t(dec, &val->opaqueCaptureAddress);
215 }
216
217 static inline void
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_temp(struct vn_cs_decoder * dec,VkMemoryOpaqueCaptureAddressAllocateInfo * val)218 vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryOpaqueCaptureAddressAllocateInfo *val)
219 {
220 VkStructureType stype;
221 vn_decode_VkStructureType(dec, &stype);
222 if (stype != VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO)
223 vn_cs_decoder_set_fatal(dec);
224
225 val->sType = stype;
226 val->pNext = vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_pnext_temp(dec);
227 vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(dec, val);
228 }
229
230 static inline void
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self(VkMemoryOpaqueCaptureAddressAllocateInfo * val)231 vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self(VkMemoryOpaqueCaptureAddressAllocateInfo *val)
232 {
233 /* skip val->sType */
234 /* skip val->pNext */
235 /* skip val->opaqueCaptureAddress */
236 }
237
238 static inline void
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle(VkMemoryOpaqueCaptureAddressAllocateInfo * val)239 vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle(VkMemoryOpaqueCaptureAddressAllocateInfo *val)
240 {
241 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
242
243 do {
244 switch ((int32_t)pnext->sType) {
245 case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
246 vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self((VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
247 break;
248 default:
249 /* ignore unknown/unsupported struct */
250 break;
251 }
252 pnext = pnext->pNext;
253 } while (pnext);
254 }
255
256 /* struct VkImportMemoryResourceInfoMESA chain */
257
258 static inline void *
vn_decode_VkImportMemoryResourceInfoMESA_pnext_temp(struct vn_cs_decoder * dec)259 vn_decode_VkImportMemoryResourceInfoMESA_pnext_temp(struct vn_cs_decoder *dec)
260 {
261 /* no known/supported struct */
262 if (vn_decode_simple_pointer(dec))
263 vn_cs_decoder_set_fatal(dec);
264 return NULL;
265 }
266
267 static inline void
vn_decode_VkImportMemoryResourceInfoMESA_self_temp(struct vn_cs_decoder * dec,VkImportMemoryResourceInfoMESA * val)268 vn_decode_VkImportMemoryResourceInfoMESA_self_temp(struct vn_cs_decoder *dec, VkImportMemoryResourceInfoMESA *val)
269 {
270 /* skip val->{sType,pNext} */
271 vn_decode_uint32_t(dec, &val->resourceId);
272 }
273
274 static inline void
vn_decode_VkImportMemoryResourceInfoMESA_temp(struct vn_cs_decoder * dec,VkImportMemoryResourceInfoMESA * val)275 vn_decode_VkImportMemoryResourceInfoMESA_temp(struct vn_cs_decoder *dec, VkImportMemoryResourceInfoMESA *val)
276 {
277 VkStructureType stype;
278 vn_decode_VkStructureType(dec, &stype);
279 if (stype != VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA)
280 vn_cs_decoder_set_fatal(dec);
281
282 val->sType = stype;
283 val->pNext = vn_decode_VkImportMemoryResourceInfoMESA_pnext_temp(dec);
284 vn_decode_VkImportMemoryResourceInfoMESA_self_temp(dec, val);
285 }
286
287 static inline void
vn_replace_VkImportMemoryResourceInfoMESA_handle_self(VkImportMemoryResourceInfoMESA * val)288 vn_replace_VkImportMemoryResourceInfoMESA_handle_self(VkImportMemoryResourceInfoMESA *val)
289 {
290 /* skip val->sType */
291 /* skip val->pNext */
292 /* skip val->resourceId */
293 }
294
295 static inline void
vn_replace_VkImportMemoryResourceInfoMESA_handle(VkImportMemoryResourceInfoMESA * val)296 vn_replace_VkImportMemoryResourceInfoMESA_handle(VkImportMemoryResourceInfoMESA *val)
297 {
298 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
299
300 do {
301 switch ((int32_t)pnext->sType) {
302 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA:
303 vn_replace_VkImportMemoryResourceInfoMESA_handle_self((VkImportMemoryResourceInfoMESA *)pnext);
304 break;
305 default:
306 /* ignore unknown/unsupported struct */
307 break;
308 }
309 pnext = pnext->pNext;
310 } while (pnext);
311 }
312
313 /* struct VkMemoryAllocateInfo chain */
314
315 static inline void *
vn_decode_VkMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)316 vn_decode_VkMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
317 {
318 VkBaseOutStructure *pnext;
319 VkStructureType stype;
320
321 if (!vn_decode_simple_pointer(dec))
322 return NULL;
323
324 vn_decode_VkStructureType(dec, &stype);
325 switch ((int32_t)stype) {
326 case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
327 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkExportMemoryAllocateInfo));
328 if (pnext) {
329 pnext->sType = stype;
330 pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
331 vn_decode_VkExportMemoryAllocateInfo_self_temp(dec, (VkExportMemoryAllocateInfo *)pnext);
332 }
333 break;
334 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
335 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryAllocateFlagsInfo));
336 if (pnext) {
337 pnext->sType = stype;
338 pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
339 vn_decode_VkMemoryAllocateFlagsInfo_self_temp(dec, (VkMemoryAllocateFlagsInfo *)pnext);
340 }
341 break;
342 case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
343 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryDedicatedAllocateInfo));
344 if (pnext) {
345 pnext->sType = stype;
346 pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
347 vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(dec, (VkMemoryDedicatedAllocateInfo *)pnext);
348 }
349 break;
350 case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
351 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryOpaqueCaptureAddressAllocateInfo));
352 if (pnext) {
353 pnext->sType = stype;
354 pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
355 vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(dec, (VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
356 }
357 break;
358 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA:
359 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkImportMemoryResourceInfoMESA));
360 if (pnext) {
361 pnext->sType = stype;
362 pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
363 vn_decode_VkImportMemoryResourceInfoMESA_self_temp(dec, (VkImportMemoryResourceInfoMESA *)pnext);
364 }
365 break;
366 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR:
367 default:
368 /* unexpected struct */
369 pnext = NULL;
370 vn_cs_decoder_set_fatal(dec);
371 break;
372 }
373
374 return pnext;
375 }
376
377 static inline void
vn_decode_VkMemoryAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkMemoryAllocateInfo * val)378 vn_decode_VkMemoryAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryAllocateInfo *val)
379 {
380 /* skip val->{sType,pNext} */
381 vn_decode_VkDeviceSize(dec, &val->allocationSize);
382 vn_decode_uint32_t(dec, &val->memoryTypeIndex);
383 }
384
385 static inline void
vn_decode_VkMemoryAllocateInfo_temp(struct vn_cs_decoder * dec,VkMemoryAllocateInfo * val)386 vn_decode_VkMemoryAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryAllocateInfo *val)
387 {
388 VkStructureType stype;
389 vn_decode_VkStructureType(dec, &stype);
390 if (stype != VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
391 vn_cs_decoder_set_fatal(dec);
392
393 val->sType = stype;
394 val->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
395 vn_decode_VkMemoryAllocateInfo_self_temp(dec, val);
396 }
397
398 static inline void
vn_replace_VkMemoryAllocateInfo_handle_self(VkMemoryAllocateInfo * val)399 vn_replace_VkMemoryAllocateInfo_handle_self(VkMemoryAllocateInfo *val)
400 {
401 /* skip val->sType */
402 /* skip val->pNext */
403 /* skip val->allocationSize */
404 /* skip val->memoryTypeIndex */
405 }
406
407 static inline void
vn_replace_VkMemoryAllocateInfo_handle(VkMemoryAllocateInfo * val)408 vn_replace_VkMemoryAllocateInfo_handle(VkMemoryAllocateInfo *val)
409 {
410 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
411
412 do {
413 switch ((int32_t)pnext->sType) {
414 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO:
415 vn_replace_VkMemoryAllocateInfo_handle_self((VkMemoryAllocateInfo *)pnext);
416 break;
417 case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
418 vn_replace_VkExportMemoryAllocateInfo_handle_self((VkExportMemoryAllocateInfo *)pnext);
419 break;
420 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
421 vn_replace_VkMemoryAllocateFlagsInfo_handle_self((VkMemoryAllocateFlagsInfo *)pnext);
422 break;
423 case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
424 vn_replace_VkMemoryDedicatedAllocateInfo_handle_self((VkMemoryDedicatedAllocateInfo *)pnext);
425 break;
426 case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
427 vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self((VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
428 break;
429 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA:
430 vn_replace_VkImportMemoryResourceInfoMESA_handle_self((VkImportMemoryResourceInfoMESA *)pnext);
431 break;
432 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR:
433 default:
434 /* ignore unknown/unsupported struct */
435 break;
436 }
437 pnext = pnext->pNext;
438 } while (pnext);
439 }
440
441 /* struct VkMappedMemoryRange chain */
442
443 static inline void
vn_encode_VkMappedMemoryRange_pnext(struct vn_cs_encoder * enc,const void * val)444 vn_encode_VkMappedMemoryRange_pnext(struct vn_cs_encoder *enc, const void *val)
445 {
446 /* no known/supported struct */
447 vn_encode_simple_pointer(enc, NULL);
448 }
449
450 static inline void
vn_encode_VkMappedMemoryRange_self(struct vn_cs_encoder * enc,const VkMappedMemoryRange * val)451 vn_encode_VkMappedMemoryRange_self(struct vn_cs_encoder *enc, const VkMappedMemoryRange *val)
452 {
453 /* skip val->{sType,pNext} */
454 vn_encode_VkDeviceMemory(enc, &val->memory);
455 vn_encode_VkDeviceSize(enc, &val->offset);
456 vn_encode_VkDeviceSize(enc, &val->size);
457 }
458
459 static inline void
vn_encode_VkMappedMemoryRange(struct vn_cs_encoder * enc,const VkMappedMemoryRange * val)460 vn_encode_VkMappedMemoryRange(struct vn_cs_encoder *enc, const VkMappedMemoryRange *val)
461 {
462 assert(val->sType == VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE);
463 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE });
464 vn_encode_VkMappedMemoryRange_pnext(enc, val->pNext);
465 vn_encode_VkMappedMemoryRange_self(enc, val);
466 }
467
468 static inline void *
vn_decode_VkMappedMemoryRange_pnext_temp(struct vn_cs_decoder * dec)469 vn_decode_VkMappedMemoryRange_pnext_temp(struct vn_cs_decoder *dec)
470 {
471 /* no known/supported struct */
472 if (vn_decode_simple_pointer(dec))
473 vn_cs_decoder_set_fatal(dec);
474 return NULL;
475 }
476
477 static inline void
vn_decode_VkMappedMemoryRange_self_temp(struct vn_cs_decoder * dec,VkMappedMemoryRange * val)478 vn_decode_VkMappedMemoryRange_self_temp(struct vn_cs_decoder *dec, VkMappedMemoryRange *val)
479 {
480 /* skip val->{sType,pNext} */
481 vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
482 vn_decode_VkDeviceSize(dec, &val->offset);
483 vn_decode_VkDeviceSize(dec, &val->size);
484 }
485
486 static inline void
vn_decode_VkMappedMemoryRange_temp(struct vn_cs_decoder * dec,VkMappedMemoryRange * val)487 vn_decode_VkMappedMemoryRange_temp(struct vn_cs_decoder *dec, VkMappedMemoryRange *val)
488 {
489 VkStructureType stype;
490 vn_decode_VkStructureType(dec, &stype);
491 if (stype != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE)
492 vn_cs_decoder_set_fatal(dec);
493
494 val->sType = stype;
495 val->pNext = vn_decode_VkMappedMemoryRange_pnext_temp(dec);
496 vn_decode_VkMappedMemoryRange_self_temp(dec, val);
497 }
498
499 static inline void
vn_replace_VkMappedMemoryRange_handle_self(VkMappedMemoryRange * val)500 vn_replace_VkMappedMemoryRange_handle_self(VkMappedMemoryRange *val)
501 {
502 /* skip val->sType */
503 /* skip val->pNext */
504 vn_replace_VkDeviceMemory_handle(&val->memory);
505 /* skip val->offset */
506 /* skip val->size */
507 }
508
509 static inline void
vn_replace_VkMappedMemoryRange_handle(VkMappedMemoryRange * val)510 vn_replace_VkMappedMemoryRange_handle(VkMappedMemoryRange *val)
511 {
512 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
513
514 do {
515 switch ((int32_t)pnext->sType) {
516 case VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE:
517 vn_replace_VkMappedMemoryRange_handle_self((VkMappedMemoryRange *)pnext);
518 break;
519 default:
520 /* ignore unknown/unsupported struct */
521 break;
522 }
523 pnext = pnext->pNext;
524 } while (pnext);
525 }
526
527 /* struct VkDeviceMemoryOpaqueCaptureAddressInfo chain */
528
529 static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext(struct vn_cs_encoder * enc,const void * val)530 vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext(struct vn_cs_encoder *enc, const void *val)
531 {
532 /* no known/supported struct */
533 vn_encode_simple_pointer(enc, NULL);
534 }
535
536 static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_self(struct vn_cs_encoder * enc,const VkDeviceMemoryOpaqueCaptureAddressInfo * val)537 vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_self(struct vn_cs_encoder *enc, const VkDeviceMemoryOpaqueCaptureAddressInfo *val)
538 {
539 /* skip val->{sType,pNext} */
540 vn_encode_VkDeviceMemory(enc, &val->memory);
541 }
542
543 static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo(struct vn_cs_encoder * enc,const VkDeviceMemoryOpaqueCaptureAddressInfo * val)544 vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo(struct vn_cs_encoder *enc, const VkDeviceMemoryOpaqueCaptureAddressInfo *val)
545 {
546 assert(val->sType == VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO);
547 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO });
548 vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext(enc, val->pNext);
549 vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_self(enc, val);
550 }
551
552 static inline void *
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext_temp(struct vn_cs_decoder * dec)553 vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext_temp(struct vn_cs_decoder *dec)
554 {
555 /* no known/supported struct */
556 if (vn_decode_simple_pointer(dec))
557 vn_cs_decoder_set_fatal(dec);
558 return NULL;
559 }
560
561 static inline void
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_self_temp(struct vn_cs_decoder * dec,VkDeviceMemoryOpaqueCaptureAddressInfo * val)562 vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceMemoryOpaqueCaptureAddressInfo *val)
563 {
564 /* skip val->{sType,pNext} */
565 vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
566 }
567
568 static inline void
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_temp(struct vn_cs_decoder * dec,VkDeviceMemoryOpaqueCaptureAddressInfo * val)569 vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_temp(struct vn_cs_decoder *dec, VkDeviceMemoryOpaqueCaptureAddressInfo *val)
570 {
571 VkStructureType stype;
572 vn_decode_VkStructureType(dec, &stype);
573 if (stype != VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO)
574 vn_cs_decoder_set_fatal(dec);
575
576 val->sType = stype;
577 val->pNext = vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext_temp(dec);
578 vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_self_temp(dec, val);
579 }
580
581 static inline void
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle_self(VkDeviceMemoryOpaqueCaptureAddressInfo * val)582 vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle_self(VkDeviceMemoryOpaqueCaptureAddressInfo *val)
583 {
584 /* skip val->sType */
585 /* skip val->pNext */
586 vn_replace_VkDeviceMemory_handle(&val->memory);
587 }
588
589 static inline void
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle(VkDeviceMemoryOpaqueCaptureAddressInfo * val)590 vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle(VkDeviceMemoryOpaqueCaptureAddressInfo *val)
591 {
592 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
593
594 do {
595 switch ((int32_t)pnext->sType) {
596 case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO:
597 vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle_self((VkDeviceMemoryOpaqueCaptureAddressInfo *)pnext);
598 break;
599 default:
600 /* ignore unknown/unsupported struct */
601 break;
602 }
603 pnext = pnext->pNext;
604 } while (pnext);
605 }
606
vn_decode_vkAllocateMemory_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkAllocateMemory * args)607 static inline void vn_decode_vkAllocateMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkAllocateMemory *args)
608 {
609 vn_decode_VkDevice_lookup(dec, &args->device);
610 if (vn_decode_simple_pointer(dec)) {
611 args->pAllocateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pAllocateInfo));
612 if (!args->pAllocateInfo) return;
613 vn_decode_VkMemoryAllocateInfo_temp(dec, (VkMemoryAllocateInfo *)args->pAllocateInfo);
614 } else {
615 args->pAllocateInfo = NULL;
616 vn_cs_decoder_set_fatal(dec);
617 }
618 if (vn_decode_simple_pointer(dec)) {
619 vn_cs_decoder_set_fatal(dec);
620 } else {
621 args->pAllocator = NULL;
622 }
623 if (vn_decode_simple_pointer(dec)) {
624 args->pMemory = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemory));
625 if (!args->pMemory) return;
626 vn_decode_VkDeviceMemory(dec, args->pMemory);
627 } else {
628 args->pMemory = NULL;
629 vn_cs_decoder_set_fatal(dec);
630 }
631 }
632
vn_replace_vkAllocateMemory_args_handle(struct vn_command_vkAllocateMemory * args)633 static inline void vn_replace_vkAllocateMemory_args_handle(struct vn_command_vkAllocateMemory *args)
634 {
635 vn_replace_VkDevice_handle(&args->device);
636 if (args->pAllocateInfo)
637 vn_replace_VkMemoryAllocateInfo_handle((VkMemoryAllocateInfo *)args->pAllocateInfo);
638 /* skip args->pAllocator */
639 /* skip args->pMemory */
640 }
641
vn_encode_vkAllocateMemory_reply(struct vn_cs_encoder * enc,const struct vn_command_vkAllocateMemory * args)642 static inline void vn_encode_vkAllocateMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkAllocateMemory *args)
643 {
644 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkAllocateMemory_EXT});
645
646 vn_encode_VkResult(enc, &args->ret);
647 /* skip args->device */
648 /* skip args->pAllocateInfo */
649 /* skip args->pAllocator */
650 if (vn_encode_simple_pointer(enc, args->pMemory))
651 vn_encode_VkDeviceMemory(enc, args->pMemory);
652 }
653
vn_decode_vkFreeMemory_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkFreeMemory * args)654 static inline void vn_decode_vkFreeMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFreeMemory *args)
655 {
656 vn_decode_VkDevice_lookup(dec, &args->device);
657 vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
658 if (vn_decode_simple_pointer(dec)) {
659 vn_cs_decoder_set_fatal(dec);
660 } else {
661 args->pAllocator = NULL;
662 }
663 }
664
vn_replace_vkFreeMemory_args_handle(struct vn_command_vkFreeMemory * args)665 static inline void vn_replace_vkFreeMemory_args_handle(struct vn_command_vkFreeMemory *args)
666 {
667 vn_replace_VkDevice_handle(&args->device);
668 vn_replace_VkDeviceMemory_handle(&args->memory);
669 /* skip args->pAllocator */
670 }
671
vn_encode_vkFreeMemory_reply(struct vn_cs_encoder * enc,const struct vn_command_vkFreeMemory * args)672 static inline void vn_encode_vkFreeMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFreeMemory *args)
673 {
674 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFreeMemory_EXT});
675
676 /* skip args->device */
677 /* skip args->memory */
678 /* skip args->pAllocator */
679 }
680
vn_decode_vkUnmapMemory_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkUnmapMemory * args)681 static inline void vn_decode_vkUnmapMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkUnmapMemory *args)
682 {
683 vn_decode_VkDevice_lookup(dec, &args->device);
684 vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
685 }
686
vn_replace_vkUnmapMemory_args_handle(struct vn_command_vkUnmapMemory * args)687 static inline void vn_replace_vkUnmapMemory_args_handle(struct vn_command_vkUnmapMemory *args)
688 {
689 vn_replace_VkDevice_handle(&args->device);
690 vn_replace_VkDeviceMemory_handle(&args->memory);
691 }
692
vn_encode_vkUnmapMemory_reply(struct vn_cs_encoder * enc,const struct vn_command_vkUnmapMemory * args)693 static inline void vn_encode_vkUnmapMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkUnmapMemory *args)
694 {
695 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkUnmapMemory_EXT});
696
697 /* skip args->device */
698 /* skip args->memory */
699 }
700
vn_decode_vkFlushMappedMemoryRanges_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkFlushMappedMemoryRanges * args)701 static inline void vn_decode_vkFlushMappedMemoryRanges_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFlushMappedMemoryRanges *args)
702 {
703 vn_decode_VkDevice_lookup(dec, &args->device);
704 vn_decode_uint32_t(dec, &args->memoryRangeCount);
705 if (vn_peek_array_size(dec)) {
706 const uint32_t iter_count = vn_decode_array_size(dec, args->memoryRangeCount);
707 args->pMemoryRanges = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryRanges) * iter_count);
708 if (!args->pMemoryRanges) return;
709 for (uint32_t i = 0; i < iter_count; i++)
710 vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
711 } else {
712 vn_decode_array_size(dec, args->memoryRangeCount);
713 args->pMemoryRanges = NULL;
714 }
715 }
716
vn_replace_vkFlushMappedMemoryRanges_args_handle(struct vn_command_vkFlushMappedMemoryRanges * args)717 static inline void vn_replace_vkFlushMappedMemoryRanges_args_handle(struct vn_command_vkFlushMappedMemoryRanges *args)
718 {
719 vn_replace_VkDevice_handle(&args->device);
720 /* skip args->memoryRangeCount */
721 if (args->pMemoryRanges) {
722 for (uint32_t i = 0; i < args->memoryRangeCount; i++)
723 vn_replace_VkMappedMemoryRange_handle(&((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
724 }
725 }
726
vn_encode_vkFlushMappedMemoryRanges_reply(struct vn_cs_encoder * enc,const struct vn_command_vkFlushMappedMemoryRanges * args)727 static inline void vn_encode_vkFlushMappedMemoryRanges_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFlushMappedMemoryRanges *args)
728 {
729 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFlushMappedMemoryRanges_EXT});
730
731 vn_encode_VkResult(enc, &args->ret);
732 /* skip args->device */
733 /* skip args->memoryRangeCount */
734 /* skip args->pMemoryRanges */
735 }
736
vn_decode_vkInvalidateMappedMemoryRanges_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkInvalidateMappedMemoryRanges * args)737 static inline void vn_decode_vkInvalidateMappedMemoryRanges_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkInvalidateMappedMemoryRanges *args)
738 {
739 vn_decode_VkDevice_lookup(dec, &args->device);
740 vn_decode_uint32_t(dec, &args->memoryRangeCount);
741 if (vn_peek_array_size(dec)) {
742 const uint32_t iter_count = vn_decode_array_size(dec, args->memoryRangeCount);
743 args->pMemoryRanges = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryRanges) * iter_count);
744 if (!args->pMemoryRanges) return;
745 for (uint32_t i = 0; i < iter_count; i++)
746 vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
747 } else {
748 vn_decode_array_size(dec, args->memoryRangeCount);
749 args->pMemoryRanges = NULL;
750 }
751 }
752
vn_replace_vkInvalidateMappedMemoryRanges_args_handle(struct vn_command_vkInvalidateMappedMemoryRanges * args)753 static inline void vn_replace_vkInvalidateMappedMemoryRanges_args_handle(struct vn_command_vkInvalidateMappedMemoryRanges *args)
754 {
755 vn_replace_VkDevice_handle(&args->device);
756 /* skip args->memoryRangeCount */
757 if (args->pMemoryRanges) {
758 for (uint32_t i = 0; i < args->memoryRangeCount; i++)
759 vn_replace_VkMappedMemoryRange_handle(&((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
760 }
761 }
762
vn_encode_vkInvalidateMappedMemoryRanges_reply(struct vn_cs_encoder * enc,const struct vn_command_vkInvalidateMappedMemoryRanges * args)763 static inline void vn_encode_vkInvalidateMappedMemoryRanges_reply(struct vn_cs_encoder *enc, const struct vn_command_vkInvalidateMappedMemoryRanges *args)
764 {
765 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkInvalidateMappedMemoryRanges_EXT});
766
767 vn_encode_VkResult(enc, &args->ret);
768 /* skip args->device */
769 /* skip args->memoryRangeCount */
770 /* skip args->pMemoryRanges */
771 }
772
vn_decode_vkGetDeviceMemoryCommitment_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkGetDeviceMemoryCommitment * args)773 static inline void vn_decode_vkGetDeviceMemoryCommitment_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDeviceMemoryCommitment *args)
774 {
775 vn_decode_VkDevice_lookup(dec, &args->device);
776 vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
777 if (vn_decode_simple_pointer(dec)) {
778 args->pCommittedMemoryInBytes = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCommittedMemoryInBytes));
779 if (!args->pCommittedMemoryInBytes) return;
780 } else {
781 args->pCommittedMemoryInBytes = NULL;
782 vn_cs_decoder_set_fatal(dec);
783 }
784 }
785
vn_replace_vkGetDeviceMemoryCommitment_args_handle(struct vn_command_vkGetDeviceMemoryCommitment * args)786 static inline void vn_replace_vkGetDeviceMemoryCommitment_args_handle(struct vn_command_vkGetDeviceMemoryCommitment *args)
787 {
788 vn_replace_VkDevice_handle(&args->device);
789 vn_replace_VkDeviceMemory_handle(&args->memory);
790 /* skip args->pCommittedMemoryInBytes */
791 }
792
vn_encode_vkGetDeviceMemoryCommitment_reply(struct vn_cs_encoder * enc,const struct vn_command_vkGetDeviceMemoryCommitment * args)793 static inline void vn_encode_vkGetDeviceMemoryCommitment_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDeviceMemoryCommitment *args)
794 {
795 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDeviceMemoryCommitment_EXT});
796
797 /* skip args->device */
798 /* skip args->memory */
799 if (vn_encode_simple_pointer(enc, args->pCommittedMemoryInBytes))
800 vn_encode_VkDeviceSize(enc, args->pCommittedMemoryInBytes);
801 }
802
vn_decode_vkGetDeviceMemoryOpaqueCaptureAddress_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress * args)803 static inline void vn_decode_vkGetDeviceMemoryOpaqueCaptureAddress_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
804 {
805 vn_decode_VkDevice_lookup(dec, &args->device);
806 if (vn_decode_simple_pointer(dec)) {
807 args->pInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pInfo));
808 if (!args->pInfo) return;
809 vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_temp(dec, (VkDeviceMemoryOpaqueCaptureAddressInfo *)args->pInfo);
810 } else {
811 args->pInfo = NULL;
812 vn_cs_decoder_set_fatal(dec);
813 }
814 }
815
vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress * args)816 static inline void vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
817 {
818 vn_replace_VkDevice_handle(&args->device);
819 if (args->pInfo)
820 vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle((VkDeviceMemoryOpaqueCaptureAddressInfo *)args->pInfo);
821 }
822
vn_encode_vkGetDeviceMemoryOpaqueCaptureAddress_reply(struct vn_cs_encoder * enc,const struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress * args)823 static inline void vn_encode_vkGetDeviceMemoryOpaqueCaptureAddress_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
824 {
825 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDeviceMemoryOpaqueCaptureAddress_EXT});
826
827 vn_encode_uint64_t(enc, &args->ret);
828 /* skip args->device */
829 /* skip args->pInfo */
830 }
831
vn_dispatch_vkAllocateMemory(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)832 static inline void vn_dispatch_vkAllocateMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
833 {
834 struct vn_command_vkAllocateMemory args;
835
836 if (!ctx->dispatch_vkAllocateMemory) {
837 vn_cs_decoder_set_fatal(ctx->decoder);
838 return;
839 }
840
841 vn_decode_vkAllocateMemory_args_temp(ctx->decoder, &args);
842 if (!args.device) {
843 vn_cs_decoder_set_fatal(ctx->decoder);
844 return;
845 }
846
847 if (!vn_cs_decoder_get_fatal(ctx->decoder))
848 ctx->dispatch_vkAllocateMemory(ctx, &args);
849
850 #ifdef DEBUG
851 if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
852 vn_dispatch_debug_log(ctx, "vkAllocateMemory returned %d", args.ret);
853 #endif
854
855 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
856 vn_encode_vkAllocateMemory_reply(ctx->encoder, &args);
857
858 vn_cs_decoder_reset_temp_pool(ctx->decoder);
859 }
860
vn_dispatch_vkFreeMemory(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)861 static inline void vn_dispatch_vkFreeMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
862 {
863 struct vn_command_vkFreeMemory args;
864
865 if (!ctx->dispatch_vkFreeMemory) {
866 vn_cs_decoder_set_fatal(ctx->decoder);
867 return;
868 }
869
870 vn_decode_vkFreeMemory_args_temp(ctx->decoder, &args);
871 if (!args.device) {
872 vn_cs_decoder_set_fatal(ctx->decoder);
873 return;
874 }
875
876 if (!vn_cs_decoder_get_fatal(ctx->decoder))
877 ctx->dispatch_vkFreeMemory(ctx, &args);
878
879
880 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
881 vn_encode_vkFreeMemory_reply(ctx->encoder, &args);
882
883 vn_cs_decoder_reset_temp_pool(ctx->decoder);
884 }
885
vn_dispatch_vkUnmapMemory(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)886 static inline void vn_dispatch_vkUnmapMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
887 {
888 struct vn_command_vkUnmapMemory args;
889
890 if (!ctx->dispatch_vkUnmapMemory) {
891 vn_cs_decoder_set_fatal(ctx->decoder);
892 return;
893 }
894
895 vn_decode_vkUnmapMemory_args_temp(ctx->decoder, &args);
896 if (!args.device) {
897 vn_cs_decoder_set_fatal(ctx->decoder);
898 return;
899 }
900
901 if (!vn_cs_decoder_get_fatal(ctx->decoder))
902 ctx->dispatch_vkUnmapMemory(ctx, &args);
903
904
905 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
906 vn_encode_vkUnmapMemory_reply(ctx->encoder, &args);
907
908 vn_cs_decoder_reset_temp_pool(ctx->decoder);
909 }
910
vn_dispatch_vkFlushMappedMemoryRanges(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)911 static inline void vn_dispatch_vkFlushMappedMemoryRanges(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
912 {
913 struct vn_command_vkFlushMappedMemoryRanges args;
914
915 if (!ctx->dispatch_vkFlushMappedMemoryRanges) {
916 vn_cs_decoder_set_fatal(ctx->decoder);
917 return;
918 }
919
920 vn_decode_vkFlushMappedMemoryRanges_args_temp(ctx->decoder, &args);
921 if (!args.device) {
922 vn_cs_decoder_set_fatal(ctx->decoder);
923 return;
924 }
925
926 if (!vn_cs_decoder_get_fatal(ctx->decoder))
927 ctx->dispatch_vkFlushMappedMemoryRanges(ctx, &args);
928
929 #ifdef DEBUG
930 if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
931 vn_dispatch_debug_log(ctx, "vkFlushMappedMemoryRanges returned %d", args.ret);
932 #endif
933
934 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
935 vn_encode_vkFlushMappedMemoryRanges_reply(ctx->encoder, &args);
936
937 vn_cs_decoder_reset_temp_pool(ctx->decoder);
938 }
939
vn_dispatch_vkInvalidateMappedMemoryRanges(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)940 static inline void vn_dispatch_vkInvalidateMappedMemoryRanges(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
941 {
942 struct vn_command_vkInvalidateMappedMemoryRanges args;
943
944 if (!ctx->dispatch_vkInvalidateMappedMemoryRanges) {
945 vn_cs_decoder_set_fatal(ctx->decoder);
946 return;
947 }
948
949 vn_decode_vkInvalidateMappedMemoryRanges_args_temp(ctx->decoder, &args);
950 if (!args.device) {
951 vn_cs_decoder_set_fatal(ctx->decoder);
952 return;
953 }
954
955 if (!vn_cs_decoder_get_fatal(ctx->decoder))
956 ctx->dispatch_vkInvalidateMappedMemoryRanges(ctx, &args);
957
958 #ifdef DEBUG
959 if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
960 vn_dispatch_debug_log(ctx, "vkInvalidateMappedMemoryRanges returned %d", args.ret);
961 #endif
962
963 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
964 vn_encode_vkInvalidateMappedMemoryRanges_reply(ctx->encoder, &args);
965
966 vn_cs_decoder_reset_temp_pool(ctx->decoder);
967 }
968
vn_dispatch_vkGetDeviceMemoryCommitment(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)969 static inline void vn_dispatch_vkGetDeviceMemoryCommitment(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
970 {
971 struct vn_command_vkGetDeviceMemoryCommitment args;
972
973 if (!ctx->dispatch_vkGetDeviceMemoryCommitment) {
974 vn_cs_decoder_set_fatal(ctx->decoder);
975 return;
976 }
977
978 vn_decode_vkGetDeviceMemoryCommitment_args_temp(ctx->decoder, &args);
979 if (!args.device) {
980 vn_cs_decoder_set_fatal(ctx->decoder);
981 return;
982 }
983
984 if (!vn_cs_decoder_get_fatal(ctx->decoder))
985 ctx->dispatch_vkGetDeviceMemoryCommitment(ctx, &args);
986
987
988 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
989 vn_encode_vkGetDeviceMemoryCommitment_reply(ctx->encoder, &args);
990
991 vn_cs_decoder_reset_temp_pool(ctx->decoder);
992 }
993
vn_dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)994 static inline void vn_dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
995 {
996 struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress args;
997
998 if (!ctx->dispatch_vkGetDeviceMemoryOpaqueCaptureAddress) {
999 vn_cs_decoder_set_fatal(ctx->decoder);
1000 return;
1001 }
1002
1003 vn_decode_vkGetDeviceMemoryOpaqueCaptureAddress_args_temp(ctx->decoder, &args);
1004 if (!args.device) {
1005 vn_cs_decoder_set_fatal(ctx->decoder);
1006 return;
1007 }
1008
1009 if (!vn_cs_decoder_get_fatal(ctx->decoder))
1010 ctx->dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(ctx, &args);
1011
1012
1013 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
1014 vn_encode_vkGetDeviceMemoryOpaqueCaptureAddress_reply(ctx->encoder, &args);
1015
1016 vn_cs_decoder_reset_temp_pool(ctx->decoder);
1017 }
1018
1019 #pragma GCC diagnostic pop
1020
1021 #endif /* VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H */
1022