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_TRANSPORT_H
9 #define VN_PROTOCOL_RENDERER_TRANSPORT_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 * vkGetMemoryFdKHR
21 * vkGetMemoryFdPropertiesKHR
22 */
23
24 /* struct VkCommandStreamDescriptionMESA */
25
26 static inline void
vn_decode_VkCommandStreamDescriptionMESA_temp(struct vn_cs_decoder * dec,VkCommandStreamDescriptionMESA * val)27 vn_decode_VkCommandStreamDescriptionMESA_temp(struct vn_cs_decoder *dec, VkCommandStreamDescriptionMESA *val)
28 {
29 vn_decode_uint32_t(dec, &val->resourceId);
30 vn_decode_size_t(dec, &val->offset);
31 vn_decode_size_t(dec, &val->size);
32 }
33
34 static inline void
vn_replace_VkCommandStreamDescriptionMESA_handle(VkCommandStreamDescriptionMESA * val)35 vn_replace_VkCommandStreamDescriptionMESA_handle(VkCommandStreamDescriptionMESA *val)
36 {
37 /* skip val->resourceId */
38 /* skip val->offset */
39 /* skip val->size */
40 }
41
42 /* struct VkCommandStreamDependencyMESA */
43
44 static inline void
vn_decode_VkCommandStreamDependencyMESA_temp(struct vn_cs_decoder * dec,VkCommandStreamDependencyMESA * val)45 vn_decode_VkCommandStreamDependencyMESA_temp(struct vn_cs_decoder *dec, VkCommandStreamDependencyMESA *val)
46 {
47 vn_decode_uint32_t(dec, &val->srcCommandStream);
48 vn_decode_uint32_t(dec, &val->dstCommandStream);
49 }
50
51 static inline void
vn_replace_VkCommandStreamDependencyMESA_handle(VkCommandStreamDependencyMESA * val)52 vn_replace_VkCommandStreamDependencyMESA_handle(VkCommandStreamDependencyMESA *val)
53 {
54 /* skip val->srcCommandStream */
55 /* skip val->dstCommandStream */
56 }
57
58 /* struct VkRingCreateInfoMESA chain */
59
60 static inline void *
vn_decode_VkRingCreateInfoMESA_pnext_temp(struct vn_cs_decoder * dec)61 vn_decode_VkRingCreateInfoMESA_pnext_temp(struct vn_cs_decoder *dec)
62 {
63 /* no known/supported struct */
64 if (vn_decode_simple_pointer(dec))
65 vn_cs_decoder_set_fatal(dec);
66 return NULL;
67 }
68
69 static inline void
vn_decode_VkRingCreateInfoMESA_self_temp(struct vn_cs_decoder * dec,VkRingCreateInfoMESA * val)70 vn_decode_VkRingCreateInfoMESA_self_temp(struct vn_cs_decoder *dec, VkRingCreateInfoMESA *val)
71 {
72 /* skip val->{sType,pNext} */
73 vn_decode_VkFlags(dec, &val->flags);
74 vn_decode_uint32_t(dec, &val->resourceId);
75 vn_decode_size_t(dec, &val->offset);
76 vn_decode_size_t(dec, &val->size);
77 vn_decode_uint64_t(dec, &val->idleTimeout);
78 vn_decode_size_t(dec, &val->headOffset);
79 vn_decode_size_t(dec, &val->tailOffset);
80 vn_decode_size_t(dec, &val->statusOffset);
81 vn_decode_size_t(dec, &val->bufferOffset);
82 vn_decode_size_t(dec, &val->bufferSize);
83 vn_decode_size_t(dec, &val->extraOffset);
84 vn_decode_size_t(dec, &val->extraSize);
85 }
86
87 static inline void
vn_decode_VkRingCreateInfoMESA_temp(struct vn_cs_decoder * dec,VkRingCreateInfoMESA * val)88 vn_decode_VkRingCreateInfoMESA_temp(struct vn_cs_decoder *dec, VkRingCreateInfoMESA *val)
89 {
90 VkStructureType stype;
91 vn_decode_VkStructureType(dec, &stype);
92 if (stype != VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA)
93 vn_cs_decoder_set_fatal(dec);
94
95 val->sType = stype;
96 val->pNext = vn_decode_VkRingCreateInfoMESA_pnext_temp(dec);
97 vn_decode_VkRingCreateInfoMESA_self_temp(dec, val);
98 }
99
100 static inline void
vn_replace_VkRingCreateInfoMESA_handle_self(VkRingCreateInfoMESA * val)101 vn_replace_VkRingCreateInfoMESA_handle_self(VkRingCreateInfoMESA *val)
102 {
103 /* skip val->sType */
104 /* skip val->pNext */
105 /* skip val->flags */
106 /* skip val->resourceId */
107 /* skip val->offset */
108 /* skip val->size */
109 /* skip val->idleTimeout */
110 /* skip val->headOffset */
111 /* skip val->tailOffset */
112 /* skip val->statusOffset */
113 /* skip val->bufferOffset */
114 /* skip val->bufferSize */
115 /* skip val->extraOffset */
116 /* skip val->extraSize */
117 }
118
119 static inline void
vn_replace_VkRingCreateInfoMESA_handle(VkRingCreateInfoMESA * val)120 vn_replace_VkRingCreateInfoMESA_handle(VkRingCreateInfoMESA *val)
121 {
122 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
123
124 do {
125 switch ((int32_t)pnext->sType) {
126 case VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA:
127 vn_replace_VkRingCreateInfoMESA_handle_self((VkRingCreateInfoMESA *)pnext);
128 break;
129 default:
130 /* ignore unknown/unsupported struct */
131 break;
132 }
133 pnext = pnext->pNext;
134 } while (pnext);
135 }
136
137 /* struct VkMemoryResourceAllocationSizeProperties100000MESA chain */
138
139 static inline void
vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(struct vn_cs_encoder * enc,const void * val)140 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(struct vn_cs_encoder *enc, const void *val)
141 {
142 /* no known/supported struct */
143 vn_encode_simple_pointer(enc, NULL);
144 }
145
146 static inline void
vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(struct vn_cs_encoder * enc,const VkMemoryResourceAllocationSizeProperties100000MESA * val)147 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val)
148 {
149 /* skip val->{sType,pNext} */
150 vn_encode_uint64_t(enc, &val->allocationSize);
151 }
152
153 static inline void
vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA(struct vn_cs_encoder * enc,const VkMemoryResourceAllocationSizeProperties100000MESA * val)154 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val)
155 {
156 assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA);
157 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA });
158 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(enc, val->pNext);
159 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(enc, val);
160 }
161
162 static inline void *
vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial_temp(struct vn_cs_decoder * dec)163 vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial_temp(struct vn_cs_decoder *dec)
164 {
165 /* no known/supported struct */
166 if (vn_decode_simple_pointer(dec))
167 vn_cs_decoder_set_fatal(dec);
168 return NULL;
169 }
170
171 static inline void
vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(struct vn_cs_decoder * dec,VkMemoryResourceAllocationSizeProperties100000MESA * val)172 vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val)
173 {
174 /* skip val->{sType,pNext} */
175 /* skip val->allocationSize */
176 }
177
178 static inline void
vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_partial_temp(struct vn_cs_decoder * dec,VkMemoryResourceAllocationSizeProperties100000MESA * val)179 vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val)
180 {
181 VkStructureType stype;
182 vn_decode_VkStructureType(dec, &stype);
183 if (stype != VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA)
184 vn_cs_decoder_set_fatal(dec);
185
186 val->sType = stype;
187 val->pNext = vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial_temp(dec);
188 vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(dec, val);
189 }
190
191 /* struct VkMemoryResourcePropertiesMESA chain */
192
193 static inline void
vn_encode_VkMemoryResourcePropertiesMESA_pnext(struct vn_cs_encoder * enc,const void * val)194 vn_encode_VkMemoryResourcePropertiesMESA_pnext(struct vn_cs_encoder *enc, const void *val)
195 {
196 const VkBaseInStructure *pnext = val;
197
198 while (pnext) {
199 switch ((int32_t)pnext->sType) {
200 case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
201 vn_encode_simple_pointer(enc, pnext);
202 vn_encode_VkStructureType(enc, &pnext->sType);
203 vn_encode_VkMemoryResourcePropertiesMESA_pnext(enc, pnext->pNext);
204 vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(enc, (const VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
205 return;
206 default:
207 /* ignore unknown/unsupported struct */
208 break;
209 }
210 pnext = pnext->pNext;
211 }
212
213 vn_encode_simple_pointer(enc, NULL);
214 }
215
216 static inline void
vn_encode_VkMemoryResourcePropertiesMESA_self(struct vn_cs_encoder * enc,const VkMemoryResourcePropertiesMESA * val)217 vn_encode_VkMemoryResourcePropertiesMESA_self(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
218 {
219 /* skip val->{sType,pNext} */
220 vn_encode_uint32_t(enc, &val->memoryTypeBits);
221 }
222
223 static inline void
vn_encode_VkMemoryResourcePropertiesMESA(struct vn_cs_encoder * enc,const VkMemoryResourcePropertiesMESA * val)224 vn_encode_VkMemoryResourcePropertiesMESA(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
225 {
226 assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA);
227 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA });
228 vn_encode_VkMemoryResourcePropertiesMESA_pnext(enc, val->pNext);
229 vn_encode_VkMemoryResourcePropertiesMESA_self(enc, val);
230 }
231
232 static inline void *
vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(struct vn_cs_decoder * dec)233 vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(struct vn_cs_decoder *dec)
234 {
235 VkBaseOutStructure *pnext;
236 VkStructureType stype;
237
238 if (!vn_decode_simple_pointer(dec))
239 return NULL;
240
241 vn_decode_VkStructureType(dec, &stype);
242 switch ((int32_t)stype) {
243 case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA:
244 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryResourceAllocationSizeProperties100000MESA));
245 if (pnext) {
246 pnext->sType = stype;
247 pnext->pNext = vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(dec);
248 vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(dec, (VkMemoryResourceAllocationSizeProperties100000MESA *)pnext);
249 }
250 break;
251 default:
252 /* unexpected struct */
253 pnext = NULL;
254 vn_cs_decoder_set_fatal(dec);
255 break;
256 }
257
258 return pnext;
259 }
260
261 static inline void
vn_decode_VkMemoryResourcePropertiesMESA_self_partial_temp(struct vn_cs_decoder * dec,VkMemoryResourcePropertiesMESA * val)262 vn_decode_VkMemoryResourcePropertiesMESA_self_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
263 {
264 /* skip val->{sType,pNext} */
265 /* skip val->memoryTypeBits */
266 }
267
268 static inline void
vn_decode_VkMemoryResourcePropertiesMESA_partial_temp(struct vn_cs_decoder * dec,VkMemoryResourcePropertiesMESA * val)269 vn_decode_VkMemoryResourcePropertiesMESA_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
270 {
271 VkStructureType stype;
272 vn_decode_VkStructureType(dec, &stype);
273 if (stype != VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA)
274 vn_cs_decoder_set_fatal(dec);
275
276 val->sType = stype;
277 val->pNext = vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(dec);
278 vn_decode_VkMemoryResourcePropertiesMESA_self_partial_temp(dec, val);
279 }
280
vn_decode_vkSetReplyCommandStreamMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkSetReplyCommandStreamMESA * args)281 static inline void vn_decode_vkSetReplyCommandStreamMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSetReplyCommandStreamMESA *args)
282 {
283 if (vn_decode_simple_pointer(dec)) {
284 args->pStream = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pStream));
285 if (!args->pStream) return;
286 vn_decode_VkCommandStreamDescriptionMESA_temp(dec, (VkCommandStreamDescriptionMESA *)args->pStream);
287 } else {
288 args->pStream = NULL;
289 vn_cs_decoder_set_fatal(dec);
290 }
291 }
292
vn_replace_vkSetReplyCommandStreamMESA_args_handle(struct vn_command_vkSetReplyCommandStreamMESA * args)293 static inline void vn_replace_vkSetReplyCommandStreamMESA_args_handle(struct vn_command_vkSetReplyCommandStreamMESA *args)
294 {
295 if (args->pStream)
296 vn_replace_VkCommandStreamDescriptionMESA_handle((VkCommandStreamDescriptionMESA *)args->pStream);
297 }
298
vn_encode_vkSetReplyCommandStreamMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkSetReplyCommandStreamMESA * args)299 static inline void vn_encode_vkSetReplyCommandStreamMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSetReplyCommandStreamMESA *args)
300 {
301 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT});
302
303 /* skip args->pStream */
304 }
305
vn_decode_vkSeekReplyCommandStreamMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkSeekReplyCommandStreamMESA * args)306 static inline void vn_decode_vkSeekReplyCommandStreamMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSeekReplyCommandStreamMESA *args)
307 {
308 vn_decode_size_t(dec, &args->position);
309 }
310
vn_replace_vkSeekReplyCommandStreamMESA_args_handle(struct vn_command_vkSeekReplyCommandStreamMESA * args)311 static inline void vn_replace_vkSeekReplyCommandStreamMESA_args_handle(struct vn_command_vkSeekReplyCommandStreamMESA *args)
312 {
313 /* skip args->position */
314 }
315
vn_encode_vkSeekReplyCommandStreamMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkSeekReplyCommandStreamMESA * args)316 static inline void vn_encode_vkSeekReplyCommandStreamMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSeekReplyCommandStreamMESA *args)
317 {
318 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT});
319
320 /* skip args->position */
321 }
322
vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkExecuteCommandStreamsMESA * args)323 static inline void vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkExecuteCommandStreamsMESA *args)
324 {
325 vn_decode_uint32_t(dec, &args->streamCount);
326 if (vn_peek_array_size(dec)) {
327 const uint32_t iter_count = vn_decode_array_size(dec, args->streamCount);
328 args->pStreams = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pStreams) * iter_count);
329 if (!args->pStreams) return;
330 for (uint32_t i = 0; i < iter_count; i++)
331 vn_decode_VkCommandStreamDescriptionMESA_temp(dec, &((VkCommandStreamDescriptionMESA *)args->pStreams)[i]);
332 } else {
333 vn_decode_array_size(dec, args->streamCount);
334 args->pStreams = NULL;
335 }
336 if (vn_peek_array_size(dec)) {
337 const size_t array_size = vn_decode_array_size(dec, args->streamCount);
338 args->pReplyPositions = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pReplyPositions) * array_size);
339 if (!args->pReplyPositions) return;
340 vn_decode_size_t_array(dec, (size_t *)args->pReplyPositions, array_size);
341 } else {
342 vn_decode_array_size_unchecked(dec);
343 args->pReplyPositions = NULL;
344 }
345 vn_decode_uint32_t(dec, &args->dependencyCount);
346 if (vn_peek_array_size(dec)) {
347 const uint32_t iter_count = vn_decode_array_size(dec, args->dependencyCount);
348 args->pDependencies = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDependencies) * iter_count);
349 if (!args->pDependencies) return;
350 for (uint32_t i = 0; i < iter_count; i++)
351 vn_decode_VkCommandStreamDependencyMESA_temp(dec, &((VkCommandStreamDependencyMESA *)args->pDependencies)[i]);
352 } else {
353 vn_decode_array_size(dec, args->dependencyCount);
354 args->pDependencies = NULL;
355 }
356 vn_decode_VkFlags(dec, &args->flags);
357 }
358
vn_replace_vkExecuteCommandStreamsMESA_args_handle(struct vn_command_vkExecuteCommandStreamsMESA * args)359 static inline void vn_replace_vkExecuteCommandStreamsMESA_args_handle(struct vn_command_vkExecuteCommandStreamsMESA *args)
360 {
361 /* skip args->streamCount */
362 if (args->pStreams) {
363 for (uint32_t i = 0; i < args->streamCount; i++)
364 vn_replace_VkCommandStreamDescriptionMESA_handle(&((VkCommandStreamDescriptionMESA *)args->pStreams)[i]);
365 }
366 /* skip args->pReplyPositions */
367 /* skip args->dependencyCount */
368 if (args->pDependencies) {
369 for (uint32_t i = 0; i < args->dependencyCount; i++)
370 vn_replace_VkCommandStreamDependencyMESA_handle(&((VkCommandStreamDependencyMESA *)args->pDependencies)[i]);
371 }
372 /* skip args->flags */
373 }
374
vn_encode_vkExecuteCommandStreamsMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkExecuteCommandStreamsMESA * args)375 static inline void vn_encode_vkExecuteCommandStreamsMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkExecuteCommandStreamsMESA *args)
376 {
377 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT});
378
379 /* skip args->streamCount */
380 /* skip args->pStreams */
381 /* skip args->pReplyPositions */
382 /* skip args->dependencyCount */
383 /* skip args->pDependencies */
384 /* skip args->flags */
385 }
386
vn_decode_vkCreateRingMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkCreateRingMESA * args)387 static inline void vn_decode_vkCreateRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateRingMESA *args)
388 {
389 vn_decode_uint64_t(dec, &args->ring);
390 if (vn_decode_simple_pointer(dec)) {
391 args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
392 if (!args->pCreateInfo) return;
393 vn_decode_VkRingCreateInfoMESA_temp(dec, (VkRingCreateInfoMESA *)args->pCreateInfo);
394 } else {
395 args->pCreateInfo = NULL;
396 vn_cs_decoder_set_fatal(dec);
397 }
398 }
399
vn_replace_vkCreateRingMESA_args_handle(struct vn_command_vkCreateRingMESA * args)400 static inline void vn_replace_vkCreateRingMESA_args_handle(struct vn_command_vkCreateRingMESA *args)
401 {
402 /* skip args->ring */
403 if (args->pCreateInfo)
404 vn_replace_VkRingCreateInfoMESA_handle((VkRingCreateInfoMESA *)args->pCreateInfo);
405 }
406
vn_encode_vkCreateRingMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkCreateRingMESA * args)407 static inline void vn_encode_vkCreateRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateRingMESA *args)
408 {
409 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateRingMESA_EXT});
410
411 /* skip args->ring */
412 /* skip args->pCreateInfo */
413 }
414
vn_decode_vkDestroyRingMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkDestroyRingMESA * args)415 static inline void vn_decode_vkDestroyRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyRingMESA *args)
416 {
417 vn_decode_uint64_t(dec, &args->ring);
418 }
419
vn_replace_vkDestroyRingMESA_args_handle(struct vn_command_vkDestroyRingMESA * args)420 static inline void vn_replace_vkDestroyRingMESA_args_handle(struct vn_command_vkDestroyRingMESA *args)
421 {
422 /* skip args->ring */
423 }
424
vn_encode_vkDestroyRingMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkDestroyRingMESA * args)425 static inline void vn_encode_vkDestroyRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyRingMESA *args)
426 {
427 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyRingMESA_EXT});
428
429 /* skip args->ring */
430 }
431
vn_decode_vkNotifyRingMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkNotifyRingMESA * args)432 static inline void vn_decode_vkNotifyRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkNotifyRingMESA *args)
433 {
434 vn_decode_uint64_t(dec, &args->ring);
435 vn_decode_uint32_t(dec, &args->seqno);
436 vn_decode_VkFlags(dec, &args->flags);
437 }
438
vn_replace_vkNotifyRingMESA_args_handle(struct vn_command_vkNotifyRingMESA * args)439 static inline void vn_replace_vkNotifyRingMESA_args_handle(struct vn_command_vkNotifyRingMESA *args)
440 {
441 /* skip args->ring */
442 /* skip args->seqno */
443 /* skip args->flags */
444 }
445
vn_encode_vkNotifyRingMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkNotifyRingMESA * args)446 static inline void vn_encode_vkNotifyRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkNotifyRingMESA *args)
447 {
448 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkNotifyRingMESA_EXT});
449
450 /* skip args->ring */
451 /* skip args->seqno */
452 /* skip args->flags */
453 }
454
vn_decode_vkWriteRingExtraMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkWriteRingExtraMESA * args)455 static inline void vn_decode_vkWriteRingExtraMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkWriteRingExtraMESA *args)
456 {
457 vn_decode_uint64_t(dec, &args->ring);
458 vn_decode_size_t(dec, &args->offset);
459 vn_decode_uint32_t(dec, &args->value);
460 }
461
vn_replace_vkWriteRingExtraMESA_args_handle(struct vn_command_vkWriteRingExtraMESA * args)462 static inline void vn_replace_vkWriteRingExtraMESA_args_handle(struct vn_command_vkWriteRingExtraMESA *args)
463 {
464 /* skip args->ring */
465 /* skip args->offset */
466 /* skip args->value */
467 }
468
vn_encode_vkWriteRingExtraMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkWriteRingExtraMESA * args)469 static inline void vn_encode_vkWriteRingExtraMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkWriteRingExtraMESA *args)
470 {
471 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT});
472
473 /* skip args->ring */
474 /* skip args->offset */
475 /* skip args->value */
476 }
477
vn_decode_vkGetMemoryResourcePropertiesMESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkGetMemoryResourcePropertiesMESA * args)478 static inline void vn_decode_vkGetMemoryResourcePropertiesMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
479 {
480 vn_decode_VkDevice_lookup(dec, &args->device);
481 vn_decode_uint32_t(dec, &args->resourceId);
482 if (vn_decode_simple_pointer(dec)) {
483 args->pMemoryResourceProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryResourceProperties));
484 if (!args->pMemoryResourceProperties) return;
485 vn_decode_VkMemoryResourcePropertiesMESA_partial_temp(dec, args->pMemoryResourceProperties);
486 } else {
487 args->pMemoryResourceProperties = NULL;
488 vn_cs_decoder_set_fatal(dec);
489 }
490 }
491
vn_replace_vkGetMemoryResourcePropertiesMESA_args_handle(struct vn_command_vkGetMemoryResourcePropertiesMESA * args)492 static inline void vn_replace_vkGetMemoryResourcePropertiesMESA_args_handle(struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
493 {
494 vn_replace_VkDevice_handle(&args->device);
495 /* skip args->resourceId */
496 /* skip args->pMemoryResourceProperties */
497 }
498
vn_encode_vkGetMemoryResourcePropertiesMESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkGetMemoryResourcePropertiesMESA * args)499 static inline void vn_encode_vkGetMemoryResourcePropertiesMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
500 {
501 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT});
502
503 vn_encode_VkResult(enc, &args->ret);
504 /* skip args->device */
505 /* skip args->resourceId */
506 if (vn_encode_simple_pointer(enc, args->pMemoryResourceProperties))
507 vn_encode_VkMemoryResourcePropertiesMESA(enc, args->pMemoryResourceProperties);
508 }
509
vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkGetVenusExperimentalFeatureData100000MESA * args)510 static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args)
511 {
512 if (vn_decode_simple_pointer(dec)) {
513 args->pDataSize = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDataSize));
514 if (!args->pDataSize) return;
515 vn_decode_size_t(dec, args->pDataSize);
516 } else {
517 args->pDataSize = NULL;
518 vn_cs_decoder_set_fatal(dec);
519 }
520 if (vn_peek_array_size(dec)) {
521 const size_t array_size = vn_decode_array_size(dec, (args->pDataSize ? *args->pDataSize : 0));
522 args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
523 if (!args->pData) return;
524 } else {
525 vn_decode_array_size_unchecked(dec);
526 args->pData = NULL;
527 }
528 }
529
vn_replace_vkGetVenusExperimentalFeatureData100000MESA_args_handle(struct vn_command_vkGetVenusExperimentalFeatureData100000MESA * args)530 static inline void vn_replace_vkGetVenusExperimentalFeatureData100000MESA_args_handle(struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args)
531 {
532 /* skip args->pDataSize */
533 /* skip args->pData */
534 }
535
vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(struct vn_cs_encoder * enc,const struct vn_command_vkGetVenusExperimentalFeatureData100000MESA * args)536 static inline void vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args)
537 {
538 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT});
539
540 if (vn_encode_simple_pointer(enc, args->pDataSize))
541 vn_encode_size_t(enc, args->pDataSize);
542 if (args->pData) {
543 vn_encode_array_size(enc, (args->pDataSize ? *args->pDataSize : 0));
544 vn_encode_blob_array(enc, args->pData, (args->pDataSize ? *args->pDataSize : 0));
545 } else {
546 vn_encode_array_size(enc, 0);
547 }
548 }
549
vn_dispatch_vkSetReplyCommandStreamMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)550 static inline void vn_dispatch_vkSetReplyCommandStreamMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
551 {
552 struct vn_command_vkSetReplyCommandStreamMESA args;
553
554 if (!ctx->dispatch_vkSetReplyCommandStreamMESA) {
555 vn_cs_decoder_set_fatal(ctx->decoder);
556 return;
557 }
558
559 vn_decode_vkSetReplyCommandStreamMESA_args_temp(ctx->decoder, &args);
560
561 if (!vn_cs_decoder_get_fatal(ctx->decoder))
562 ctx->dispatch_vkSetReplyCommandStreamMESA(ctx, &args);
563
564
565 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
566 vn_encode_vkSetReplyCommandStreamMESA_reply(ctx->encoder, &args);
567
568 vn_cs_decoder_reset_temp_pool(ctx->decoder);
569 }
570
vn_dispatch_vkSeekReplyCommandStreamMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)571 static inline void vn_dispatch_vkSeekReplyCommandStreamMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
572 {
573 struct vn_command_vkSeekReplyCommandStreamMESA args;
574
575 if (!ctx->dispatch_vkSeekReplyCommandStreamMESA) {
576 vn_cs_decoder_set_fatal(ctx->decoder);
577 return;
578 }
579
580 vn_decode_vkSeekReplyCommandStreamMESA_args_temp(ctx->decoder, &args);
581
582 if (!vn_cs_decoder_get_fatal(ctx->decoder))
583 ctx->dispatch_vkSeekReplyCommandStreamMESA(ctx, &args);
584
585
586 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
587 vn_encode_vkSeekReplyCommandStreamMESA_reply(ctx->encoder, &args);
588
589 vn_cs_decoder_reset_temp_pool(ctx->decoder);
590 }
591
vn_dispatch_vkExecuteCommandStreamsMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)592 static inline void vn_dispatch_vkExecuteCommandStreamsMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
593 {
594 struct vn_command_vkExecuteCommandStreamsMESA args;
595
596 if (!ctx->dispatch_vkExecuteCommandStreamsMESA) {
597 vn_cs_decoder_set_fatal(ctx->decoder);
598 return;
599 }
600
601 vn_decode_vkExecuteCommandStreamsMESA_args_temp(ctx->decoder, &args);
602
603 if (!vn_cs_decoder_get_fatal(ctx->decoder))
604 ctx->dispatch_vkExecuteCommandStreamsMESA(ctx, &args);
605
606
607 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
608 vn_encode_vkExecuteCommandStreamsMESA_reply(ctx->encoder, &args);
609
610 vn_cs_decoder_reset_temp_pool(ctx->decoder);
611 }
612
vn_dispatch_vkCreateRingMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)613 static inline void vn_dispatch_vkCreateRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
614 {
615 struct vn_command_vkCreateRingMESA args;
616
617 if (!ctx->dispatch_vkCreateRingMESA) {
618 vn_cs_decoder_set_fatal(ctx->decoder);
619 return;
620 }
621
622 vn_decode_vkCreateRingMESA_args_temp(ctx->decoder, &args);
623
624 if (!vn_cs_decoder_get_fatal(ctx->decoder))
625 ctx->dispatch_vkCreateRingMESA(ctx, &args);
626
627
628 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
629 vn_encode_vkCreateRingMESA_reply(ctx->encoder, &args);
630
631 vn_cs_decoder_reset_temp_pool(ctx->decoder);
632 }
633
vn_dispatch_vkDestroyRingMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)634 static inline void vn_dispatch_vkDestroyRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
635 {
636 struct vn_command_vkDestroyRingMESA args;
637
638 if (!ctx->dispatch_vkDestroyRingMESA) {
639 vn_cs_decoder_set_fatal(ctx->decoder);
640 return;
641 }
642
643 vn_decode_vkDestroyRingMESA_args_temp(ctx->decoder, &args);
644
645 if (!vn_cs_decoder_get_fatal(ctx->decoder))
646 ctx->dispatch_vkDestroyRingMESA(ctx, &args);
647
648
649 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
650 vn_encode_vkDestroyRingMESA_reply(ctx->encoder, &args);
651
652 vn_cs_decoder_reset_temp_pool(ctx->decoder);
653 }
654
vn_dispatch_vkNotifyRingMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)655 static inline void vn_dispatch_vkNotifyRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
656 {
657 struct vn_command_vkNotifyRingMESA args;
658
659 if (!ctx->dispatch_vkNotifyRingMESA) {
660 vn_cs_decoder_set_fatal(ctx->decoder);
661 return;
662 }
663
664 vn_decode_vkNotifyRingMESA_args_temp(ctx->decoder, &args);
665
666 if (!vn_cs_decoder_get_fatal(ctx->decoder))
667 ctx->dispatch_vkNotifyRingMESA(ctx, &args);
668
669
670 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
671 vn_encode_vkNotifyRingMESA_reply(ctx->encoder, &args);
672
673 vn_cs_decoder_reset_temp_pool(ctx->decoder);
674 }
675
vn_dispatch_vkWriteRingExtraMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)676 static inline void vn_dispatch_vkWriteRingExtraMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
677 {
678 struct vn_command_vkWriteRingExtraMESA args;
679
680 if (!ctx->dispatch_vkWriteRingExtraMESA) {
681 vn_cs_decoder_set_fatal(ctx->decoder);
682 return;
683 }
684
685 vn_decode_vkWriteRingExtraMESA_args_temp(ctx->decoder, &args);
686
687 if (!vn_cs_decoder_get_fatal(ctx->decoder))
688 ctx->dispatch_vkWriteRingExtraMESA(ctx, &args);
689
690
691 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
692 vn_encode_vkWriteRingExtraMESA_reply(ctx->encoder, &args);
693
694 vn_cs_decoder_reset_temp_pool(ctx->decoder);
695 }
696
vn_dispatch_vkGetMemoryResourcePropertiesMESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)697 static inline void vn_dispatch_vkGetMemoryResourcePropertiesMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
698 {
699 struct vn_command_vkGetMemoryResourcePropertiesMESA args;
700
701 if (!ctx->dispatch_vkGetMemoryResourcePropertiesMESA) {
702 vn_cs_decoder_set_fatal(ctx->decoder);
703 return;
704 }
705
706 vn_decode_vkGetMemoryResourcePropertiesMESA_args_temp(ctx->decoder, &args);
707 if (!args.device) {
708 vn_cs_decoder_set_fatal(ctx->decoder);
709 return;
710 }
711
712 if (!vn_cs_decoder_get_fatal(ctx->decoder))
713 ctx->dispatch_vkGetMemoryResourcePropertiesMESA(ctx, &args);
714
715 #ifdef DEBUG
716 if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
717 vn_dispatch_debug_log(ctx, "vkGetMemoryResourcePropertiesMESA returned %d", args.ret);
718 #endif
719
720 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
721 vn_encode_vkGetMemoryResourcePropertiesMESA_reply(ctx->encoder, &args);
722
723 vn_cs_decoder_reset_temp_pool(ctx->decoder);
724 }
725
vn_dispatch_vkGetVenusExperimentalFeatureData100000MESA(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)726 static inline void vn_dispatch_vkGetVenusExperimentalFeatureData100000MESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
727 {
728 struct vn_command_vkGetVenusExperimentalFeatureData100000MESA args;
729
730 if (!ctx->dispatch_vkGetVenusExperimentalFeatureData100000MESA) {
731 vn_cs_decoder_set_fatal(ctx->decoder);
732 return;
733 }
734
735 vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_temp(ctx->decoder, &args);
736
737 if (!vn_cs_decoder_get_fatal(ctx->decoder))
738 ctx->dispatch_vkGetVenusExperimentalFeatureData100000MESA(ctx, &args);
739
740
741 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
742 vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(ctx->encoder, &args);
743
744 vn_cs_decoder_reset_temp_pool(ctx->decoder);
745 }
746
747 #pragma GCC diagnostic pop
748
749 #endif /* VN_PROTOCOL_RENDERER_TRANSPORT_H */
750