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_DESCRIPTOR_SET_LAYOUT_H
9 #define VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_LAYOUT_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 /* struct VkDescriptorSetLayoutBinding */
18
19 static inline void
vn_decode_VkDescriptorSetLayoutBinding_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutBinding * val)20 vn_decode_VkDescriptorSetLayoutBinding_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBinding *val)
21 {
22 vn_decode_uint32_t(dec, &val->binding);
23 vn_decode_VkDescriptorType(dec, &val->descriptorType);
24 vn_decode_uint32_t(dec, &val->descriptorCount);
25 vn_decode_VkFlags(dec, &val->stageFlags);
26 if (vn_peek_array_size(dec)) {
27 const uint32_t iter_count = vn_decode_array_size(dec, val->descriptorCount);
28 val->pImmutableSamplers = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pImmutableSamplers) * iter_count);
29 if (!val->pImmutableSamplers) return;
30 for (uint32_t i = 0; i < iter_count; i++)
31 vn_decode_VkSampler_lookup(dec, &((VkSampler *)val->pImmutableSamplers)[i]);
32 } else {
33 vn_decode_array_size_unchecked(dec);
34 val->pImmutableSamplers = NULL;
35 }
36 }
37
38 static inline void
vn_replace_VkDescriptorSetLayoutBinding_handle(VkDescriptorSetLayoutBinding * val)39 vn_replace_VkDescriptorSetLayoutBinding_handle(VkDescriptorSetLayoutBinding *val)
40 {
41 /* skip val->binding */
42 /* skip val->descriptorType */
43 /* skip val->descriptorCount */
44 /* skip val->stageFlags */
45 if (val->pImmutableSamplers) {
46 for (uint32_t i = 0; i < val->descriptorCount; i++)
47 vn_replace_VkSampler_handle(&((VkSampler *)val->pImmutableSamplers)[i]);
48 }
49 }
50
51 /* struct VkDescriptorSetLayoutBindingFlagsCreateInfo chain */
52
53 static inline void *
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_pnext_temp(struct vn_cs_decoder * dec)54 vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
55 {
56 /* no known/supported struct */
57 if (vn_decode_simple_pointer(dec))
58 vn_cs_decoder_set_fatal(dec);
59 return NULL;
60 }
61
62 static inline void
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutBindingFlagsCreateInfo * val)63 vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
64 {
65 /* skip val->{sType,pNext} */
66 vn_decode_uint32_t(dec, &val->bindingCount);
67 if (vn_peek_array_size(dec)) {
68 const uint32_t iter_count = vn_decode_array_size(dec, val->bindingCount);
69 val->pBindingFlags = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBindingFlags) * iter_count);
70 if (!val->pBindingFlags) return;
71 for (uint32_t i = 0; i < iter_count; i++)
72 vn_decode_VkFlags(dec, &((VkDescriptorBindingFlags *)val->pBindingFlags)[i]);
73 } else {
74 vn_decode_array_size(dec, val->bindingCount);
75 val->pBindingFlags = NULL;
76 }
77 }
78
79 static inline void
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutBindingFlagsCreateInfo * val)80 vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
81 {
82 VkStructureType stype;
83 vn_decode_VkStructureType(dec, &stype);
84 if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO)
85 vn_cs_decoder_set_fatal(dec);
86
87 val->sType = stype;
88 val->pNext = vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_pnext_temp(dec);
89 vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(dec, val);
90 }
91
92 static inline void
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self(VkDescriptorSetLayoutBindingFlagsCreateInfo * val)93 vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self(VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
94 {
95 /* skip val->sType */
96 /* skip val->pNext */
97 /* skip val->bindingCount */
98 /* skip val->pBindingFlags */
99 }
100
101 static inline void
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle(VkDescriptorSetLayoutBindingFlagsCreateInfo * val)102 vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle(VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
103 {
104 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
105
106 do {
107 switch ((int32_t)pnext->sType) {
108 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
109 vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self((VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
110 break;
111 default:
112 /* ignore unknown/unsupported struct */
113 break;
114 }
115 pnext = pnext->pNext;
116 } while (pnext);
117 }
118
119 /* struct VkDescriptorSetLayoutCreateInfo chain */
120
121 static inline void *
vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(struct vn_cs_decoder * dec)122 vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
123 {
124 VkBaseOutStructure *pnext;
125 VkStructureType stype;
126
127 if (!vn_decode_simple_pointer(dec))
128 return NULL;
129
130 vn_decode_VkStructureType(dec, &stype);
131 switch ((int32_t)stype) {
132 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
133 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetLayoutBindingFlagsCreateInfo));
134 if (pnext) {
135 pnext->sType = stype;
136 pnext->pNext = vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(dec);
137 vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(dec, (VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
138 }
139 break;
140 default:
141 /* unexpected struct */
142 pnext = NULL;
143 vn_cs_decoder_set_fatal(dec);
144 break;
145 }
146
147 return pnext;
148 }
149
150 static inline void
vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutCreateInfo * val)151 vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutCreateInfo *val)
152 {
153 /* skip val->{sType,pNext} */
154 vn_decode_VkFlags(dec, &val->flags);
155 vn_decode_uint32_t(dec, &val->bindingCount);
156 if (vn_peek_array_size(dec)) {
157 const uint32_t iter_count = vn_decode_array_size(dec, val->bindingCount);
158 val->pBindings = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBindings) * iter_count);
159 if (!val->pBindings) return;
160 for (uint32_t i = 0; i < iter_count; i++)
161 vn_decode_VkDescriptorSetLayoutBinding_temp(dec, &((VkDescriptorSetLayoutBinding *)val->pBindings)[i]);
162 } else {
163 vn_decode_array_size(dec, val->bindingCount);
164 val->pBindings = NULL;
165 }
166 }
167
168 static inline void
vn_decode_VkDescriptorSetLayoutCreateInfo_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutCreateInfo * val)169 vn_decode_VkDescriptorSetLayoutCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutCreateInfo *val)
170 {
171 VkStructureType stype;
172 vn_decode_VkStructureType(dec, &stype);
173 if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
174 vn_cs_decoder_set_fatal(dec);
175
176 val->sType = stype;
177 val->pNext = vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(dec);
178 vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(dec, val);
179 }
180
181 static inline void
vn_replace_VkDescriptorSetLayoutCreateInfo_handle_self(VkDescriptorSetLayoutCreateInfo * val)182 vn_replace_VkDescriptorSetLayoutCreateInfo_handle_self(VkDescriptorSetLayoutCreateInfo *val)
183 {
184 /* skip val->sType */
185 /* skip val->pNext */
186 /* skip val->flags */
187 /* skip val->bindingCount */
188 if (val->pBindings) {
189 for (uint32_t i = 0; i < val->bindingCount; i++)
190 vn_replace_VkDescriptorSetLayoutBinding_handle(&((VkDescriptorSetLayoutBinding *)val->pBindings)[i]);
191 }
192 }
193
194 static inline void
vn_replace_VkDescriptorSetLayoutCreateInfo_handle(VkDescriptorSetLayoutCreateInfo * val)195 vn_replace_VkDescriptorSetLayoutCreateInfo_handle(VkDescriptorSetLayoutCreateInfo *val)
196 {
197 struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
198
199 do {
200 switch ((int32_t)pnext->sType) {
201 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO:
202 vn_replace_VkDescriptorSetLayoutCreateInfo_handle_self((VkDescriptorSetLayoutCreateInfo *)pnext);
203 break;
204 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
205 vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self((VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
206 break;
207 default:
208 /* ignore unknown/unsupported struct */
209 break;
210 }
211 pnext = pnext->pNext;
212 } while (pnext);
213 }
214
215 /* struct VkDescriptorSetVariableDescriptorCountLayoutSupport chain */
216
217 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext(struct vn_cs_encoder * enc,const void * val)218 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext(struct vn_cs_encoder *enc, const void *val)
219 {
220 /* no known/supported struct */
221 vn_encode_simple_pointer(enc, NULL);
222 }
223
224 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(struct vn_cs_encoder * enc,const VkDescriptorSetVariableDescriptorCountLayoutSupport * val)225 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
226 {
227 /* skip val->{sType,pNext} */
228 vn_encode_uint32_t(enc, &val->maxVariableDescriptorCount);
229 }
230
231 static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport(struct vn_cs_encoder * enc,const VkDescriptorSetVariableDescriptorCountLayoutSupport * val)232 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
233 {
234 assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT);
235 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT });
236 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext(enc, val->pNext);
237 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(enc, val);
238 }
239
240 static inline void *
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext_partial_temp(struct vn_cs_decoder * dec)241 vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext_partial_temp(struct vn_cs_decoder *dec)
242 {
243 /* no known/supported struct */
244 if (vn_decode_simple_pointer(dec))
245 vn_cs_decoder_set_fatal(dec);
246 return NULL;
247 }
248
249 static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(struct vn_cs_decoder * dec,VkDescriptorSetVariableDescriptorCountLayoutSupport * val)250 vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
251 {
252 /* skip val->{sType,pNext} */
253 /* skip val->maxVariableDescriptorCount */
254 }
255
256 static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_partial_temp(struct vn_cs_decoder * dec,VkDescriptorSetVariableDescriptorCountLayoutSupport * val)257 vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
258 {
259 VkStructureType stype;
260 vn_decode_VkStructureType(dec, &stype);
261 if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT)
262 vn_cs_decoder_set_fatal(dec);
263
264 val->sType = stype;
265 val->pNext = vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext_partial_temp(dec);
266 vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(dec, val);
267 }
268
269 /* struct VkDescriptorSetLayoutSupport chain */
270
271 static inline void
vn_encode_VkDescriptorSetLayoutSupport_pnext(struct vn_cs_encoder * enc,const void * val)272 vn_encode_VkDescriptorSetLayoutSupport_pnext(struct vn_cs_encoder *enc, const void *val)
273 {
274 const VkBaseInStructure *pnext = val;
275
276 while (pnext) {
277 switch ((int32_t)pnext->sType) {
278 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT:
279 vn_encode_simple_pointer(enc, pnext);
280 vn_encode_VkStructureType(enc, &pnext->sType);
281 vn_encode_VkDescriptorSetLayoutSupport_pnext(enc, pnext->pNext);
282 vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(enc, (const VkDescriptorSetVariableDescriptorCountLayoutSupport *)pnext);
283 return;
284 default:
285 /* ignore unknown/unsupported struct */
286 break;
287 }
288 pnext = pnext->pNext;
289 }
290
291 vn_encode_simple_pointer(enc, NULL);
292 }
293
294 static inline void
vn_encode_VkDescriptorSetLayoutSupport_self(struct vn_cs_encoder * enc,const VkDescriptorSetLayoutSupport * val)295 vn_encode_VkDescriptorSetLayoutSupport_self(struct vn_cs_encoder *enc, const VkDescriptorSetLayoutSupport *val)
296 {
297 /* skip val->{sType,pNext} */
298 vn_encode_VkBool32(enc, &val->supported);
299 }
300
301 static inline void
vn_encode_VkDescriptorSetLayoutSupport(struct vn_cs_encoder * enc,const VkDescriptorSetLayoutSupport * val)302 vn_encode_VkDescriptorSetLayoutSupport(struct vn_cs_encoder *enc, const VkDescriptorSetLayoutSupport *val)
303 {
304 assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT);
305 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT });
306 vn_encode_VkDescriptorSetLayoutSupport_pnext(enc, val->pNext);
307 vn_encode_VkDescriptorSetLayoutSupport_self(enc, val);
308 }
309
310 static inline void *
vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(struct vn_cs_decoder * dec)311 vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(struct vn_cs_decoder *dec)
312 {
313 VkBaseOutStructure *pnext;
314 VkStructureType stype;
315
316 if (!vn_decode_simple_pointer(dec))
317 return NULL;
318
319 vn_decode_VkStructureType(dec, &stype);
320 switch ((int32_t)stype) {
321 case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT:
322 pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetVariableDescriptorCountLayoutSupport));
323 if (pnext) {
324 pnext->sType = stype;
325 pnext->pNext = vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(dec);
326 vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(dec, (VkDescriptorSetVariableDescriptorCountLayoutSupport *)pnext);
327 }
328 break;
329 default:
330 /* unexpected struct */
331 pnext = NULL;
332 vn_cs_decoder_set_fatal(dec);
333 break;
334 }
335
336 return pnext;
337 }
338
339 static inline void
vn_decode_VkDescriptorSetLayoutSupport_self_partial_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutSupport * val)340 vn_decode_VkDescriptorSetLayoutSupport_self_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutSupport *val)
341 {
342 /* skip val->{sType,pNext} */
343 /* skip val->supported */
344 }
345
346 static inline void
vn_decode_VkDescriptorSetLayoutSupport_partial_temp(struct vn_cs_decoder * dec,VkDescriptorSetLayoutSupport * val)347 vn_decode_VkDescriptorSetLayoutSupport_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutSupport *val)
348 {
349 VkStructureType stype;
350 vn_decode_VkStructureType(dec, &stype);
351 if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT)
352 vn_cs_decoder_set_fatal(dec);
353
354 val->sType = stype;
355 val->pNext = vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(dec);
356 vn_decode_VkDescriptorSetLayoutSupport_self_partial_temp(dec, val);
357 }
358
vn_decode_vkCreateDescriptorSetLayout_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkCreateDescriptorSetLayout * args)359 static inline void vn_decode_vkCreateDescriptorSetLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateDescriptorSetLayout *args)
360 {
361 vn_decode_VkDevice_lookup(dec, &args->device);
362 if (vn_decode_simple_pointer(dec)) {
363 args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
364 if (!args->pCreateInfo) return;
365 vn_decode_VkDescriptorSetLayoutCreateInfo_temp(dec, (VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
366 } else {
367 args->pCreateInfo = NULL;
368 vn_cs_decoder_set_fatal(dec);
369 }
370 if (vn_decode_simple_pointer(dec)) {
371 vn_cs_decoder_set_fatal(dec);
372 } else {
373 args->pAllocator = NULL;
374 }
375 if (vn_decode_simple_pointer(dec)) {
376 args->pSetLayout = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSetLayout));
377 if (!args->pSetLayout) return;
378 vn_decode_VkDescriptorSetLayout(dec, args->pSetLayout);
379 } else {
380 args->pSetLayout = NULL;
381 vn_cs_decoder_set_fatal(dec);
382 }
383 }
384
vn_replace_vkCreateDescriptorSetLayout_args_handle(struct vn_command_vkCreateDescriptorSetLayout * args)385 static inline void vn_replace_vkCreateDescriptorSetLayout_args_handle(struct vn_command_vkCreateDescriptorSetLayout *args)
386 {
387 vn_replace_VkDevice_handle(&args->device);
388 if (args->pCreateInfo)
389 vn_replace_VkDescriptorSetLayoutCreateInfo_handle((VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
390 /* skip args->pAllocator */
391 /* skip args->pSetLayout */
392 }
393
vn_encode_vkCreateDescriptorSetLayout_reply(struct vn_cs_encoder * enc,const struct vn_command_vkCreateDescriptorSetLayout * args)394 static inline void vn_encode_vkCreateDescriptorSetLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateDescriptorSetLayout *args)
395 {
396 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateDescriptorSetLayout_EXT});
397
398 vn_encode_VkResult(enc, &args->ret);
399 /* skip args->device */
400 /* skip args->pCreateInfo */
401 /* skip args->pAllocator */
402 if (vn_encode_simple_pointer(enc, args->pSetLayout))
403 vn_encode_VkDescriptorSetLayout(enc, args->pSetLayout);
404 }
405
vn_decode_vkDestroyDescriptorSetLayout_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkDestroyDescriptorSetLayout * args)406 static inline void vn_decode_vkDestroyDescriptorSetLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyDescriptorSetLayout *args)
407 {
408 vn_decode_VkDevice_lookup(dec, &args->device);
409 vn_decode_VkDescriptorSetLayout_lookup(dec, &args->descriptorSetLayout);
410 if (vn_decode_simple_pointer(dec)) {
411 vn_cs_decoder_set_fatal(dec);
412 } else {
413 args->pAllocator = NULL;
414 }
415 }
416
vn_replace_vkDestroyDescriptorSetLayout_args_handle(struct vn_command_vkDestroyDescriptorSetLayout * args)417 static inline void vn_replace_vkDestroyDescriptorSetLayout_args_handle(struct vn_command_vkDestroyDescriptorSetLayout *args)
418 {
419 vn_replace_VkDevice_handle(&args->device);
420 vn_replace_VkDescriptorSetLayout_handle(&args->descriptorSetLayout);
421 /* skip args->pAllocator */
422 }
423
vn_encode_vkDestroyDescriptorSetLayout_reply(struct vn_cs_encoder * enc,const struct vn_command_vkDestroyDescriptorSetLayout * args)424 static inline void vn_encode_vkDestroyDescriptorSetLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyDescriptorSetLayout *args)
425 {
426 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyDescriptorSetLayout_EXT});
427
428 /* skip args->device */
429 /* skip args->descriptorSetLayout */
430 /* skip args->pAllocator */
431 }
432
vn_decode_vkGetDescriptorSetLayoutSupport_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkGetDescriptorSetLayoutSupport * args)433 static inline void vn_decode_vkGetDescriptorSetLayoutSupport_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDescriptorSetLayoutSupport *args)
434 {
435 vn_decode_VkDevice_lookup(dec, &args->device);
436 if (vn_decode_simple_pointer(dec)) {
437 args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
438 if (!args->pCreateInfo) return;
439 vn_decode_VkDescriptorSetLayoutCreateInfo_temp(dec, (VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
440 } else {
441 args->pCreateInfo = NULL;
442 vn_cs_decoder_set_fatal(dec);
443 }
444 if (vn_decode_simple_pointer(dec)) {
445 args->pSupport = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSupport));
446 if (!args->pSupport) return;
447 vn_decode_VkDescriptorSetLayoutSupport_partial_temp(dec, args->pSupport);
448 } else {
449 args->pSupport = NULL;
450 vn_cs_decoder_set_fatal(dec);
451 }
452 }
453
vn_replace_vkGetDescriptorSetLayoutSupport_args_handle(struct vn_command_vkGetDescriptorSetLayoutSupport * args)454 static inline void vn_replace_vkGetDescriptorSetLayoutSupport_args_handle(struct vn_command_vkGetDescriptorSetLayoutSupport *args)
455 {
456 vn_replace_VkDevice_handle(&args->device);
457 if (args->pCreateInfo)
458 vn_replace_VkDescriptorSetLayoutCreateInfo_handle((VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
459 /* skip args->pSupport */
460 }
461
vn_encode_vkGetDescriptorSetLayoutSupport_reply(struct vn_cs_encoder * enc,const struct vn_command_vkGetDescriptorSetLayoutSupport * args)462 static inline void vn_encode_vkGetDescriptorSetLayoutSupport_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDescriptorSetLayoutSupport *args)
463 {
464 vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDescriptorSetLayoutSupport_EXT});
465
466 /* skip args->device */
467 /* skip args->pCreateInfo */
468 if (vn_encode_simple_pointer(enc, args->pSupport))
469 vn_encode_VkDescriptorSetLayoutSupport(enc, args->pSupport);
470 }
471
vn_dispatch_vkCreateDescriptorSetLayout(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)472 static inline void vn_dispatch_vkCreateDescriptorSetLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
473 {
474 struct vn_command_vkCreateDescriptorSetLayout args;
475
476 if (!ctx->dispatch_vkCreateDescriptorSetLayout) {
477 vn_cs_decoder_set_fatal(ctx->decoder);
478 return;
479 }
480
481 vn_decode_vkCreateDescriptorSetLayout_args_temp(ctx->decoder, &args);
482 if (!args.device) {
483 vn_cs_decoder_set_fatal(ctx->decoder);
484 return;
485 }
486
487 if (!vn_cs_decoder_get_fatal(ctx->decoder))
488 ctx->dispatch_vkCreateDescriptorSetLayout(ctx, &args);
489
490 #ifdef DEBUG
491 if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
492 vn_dispatch_debug_log(ctx, "vkCreateDescriptorSetLayout returned %d", args.ret);
493 #endif
494
495 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
496 vn_encode_vkCreateDescriptorSetLayout_reply(ctx->encoder, &args);
497
498 vn_cs_decoder_reset_temp_pool(ctx->decoder);
499 }
500
vn_dispatch_vkDestroyDescriptorSetLayout(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)501 static inline void vn_dispatch_vkDestroyDescriptorSetLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
502 {
503 struct vn_command_vkDestroyDescriptorSetLayout args;
504
505 if (!ctx->dispatch_vkDestroyDescriptorSetLayout) {
506 vn_cs_decoder_set_fatal(ctx->decoder);
507 return;
508 }
509
510 vn_decode_vkDestroyDescriptorSetLayout_args_temp(ctx->decoder, &args);
511 if (!args.device) {
512 vn_cs_decoder_set_fatal(ctx->decoder);
513 return;
514 }
515
516 if (!vn_cs_decoder_get_fatal(ctx->decoder))
517 ctx->dispatch_vkDestroyDescriptorSetLayout(ctx, &args);
518
519
520 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
521 vn_encode_vkDestroyDescriptorSetLayout_reply(ctx->encoder, &args);
522
523 vn_cs_decoder_reset_temp_pool(ctx->decoder);
524 }
525
vn_dispatch_vkGetDescriptorSetLayoutSupport(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)526 static inline void vn_dispatch_vkGetDescriptorSetLayoutSupport(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
527 {
528 struct vn_command_vkGetDescriptorSetLayoutSupport args;
529
530 if (!ctx->dispatch_vkGetDescriptorSetLayoutSupport) {
531 vn_cs_decoder_set_fatal(ctx->decoder);
532 return;
533 }
534
535 vn_decode_vkGetDescriptorSetLayoutSupport_args_temp(ctx->decoder, &args);
536 if (!args.device) {
537 vn_cs_decoder_set_fatal(ctx->decoder);
538 return;
539 }
540
541 if (!vn_cs_decoder_get_fatal(ctx->decoder))
542 ctx->dispatch_vkGetDescriptorSetLayoutSupport(ctx, &args);
543
544
545 if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
546 vn_encode_vkGetDescriptorSetLayoutSupport_reply(ctx->encoder, &args);
547
548 vn_cs_decoder_reset_temp_pool(ctx->decoder);
549 }
550
551 #pragma GCC diagnostic pop
552
553 #endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_LAYOUT_H */
554