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_H
9 #define VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_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  *   vkUpdateDescriptorSetWithTemplate
21  */
22 
23 /* struct VkDescriptorSetVariableDescriptorCountAllocateInfo chain */
24 
25 static inline void *
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)26 vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
27 {
28     /* no known/supported struct */
29     if (vn_decode_simple_pointer(dec))
30         vn_cs_decoder_set_fatal(dec);
31     return NULL;
32 }
33 
34 static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkDescriptorSetVariableDescriptorCountAllocateInfo * val)35 vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
36 {
37     /* skip val->{sType,pNext} */
38     vn_decode_uint32_t(dec, &val->descriptorSetCount);
39     if (vn_peek_array_size(dec)) {
40         const size_t array_size = vn_decode_array_size(dec, val->descriptorSetCount);
41         val->pDescriptorCounts = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pDescriptorCounts) * array_size);
42         if (!val->pDescriptorCounts) return;
43         vn_decode_uint32_t_array(dec, (uint32_t *)val->pDescriptorCounts, array_size);
44     } else {
45         vn_decode_array_size(dec, val->descriptorSetCount);
46         val->pDescriptorCounts = NULL;
47     }
48 }
49 
50 static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_temp(struct vn_cs_decoder * dec,VkDescriptorSetVariableDescriptorCountAllocateInfo * val)51 vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
52 {
53     VkStructureType stype;
54     vn_decode_VkStructureType(dec, &stype);
55     if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO)
56         vn_cs_decoder_set_fatal(dec);
57 
58     val->sType = stype;
59     val->pNext = vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext_temp(dec);
60     vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(dec, val);
61 }
62 
63 static inline void
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self(VkDescriptorSetVariableDescriptorCountAllocateInfo * val)64 vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self(VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
65 {
66     /* skip val->sType */
67     /* skip val->pNext */
68     /* skip val->descriptorSetCount */
69     /* skip val->pDescriptorCounts */
70 }
71 
72 static inline void
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle(VkDescriptorSetVariableDescriptorCountAllocateInfo * val)73 vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle(VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
74 {
75     struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
76 
77     do {
78         switch ((int32_t)pnext->sType) {
79         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
80             vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self((VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
81             break;
82         default:
83             /* ignore unknown/unsupported struct */
84             break;
85         }
86         pnext = pnext->pNext;
87     } while (pnext);
88 }
89 
90 /* struct VkDescriptorSetAllocateInfo chain */
91 
92 static inline void *
vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(struct vn_cs_decoder * dec)93 vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
94 {
95     VkBaseOutStructure *pnext;
96     VkStructureType stype;
97 
98     if (!vn_decode_simple_pointer(dec))
99         return NULL;
100 
101     vn_decode_VkStructureType(dec, &stype);
102     switch ((int32_t)stype) {
103     case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
104         pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetVariableDescriptorCountAllocateInfo));
105         if (pnext) {
106             pnext->sType = stype;
107             pnext->pNext = vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(dec);
108             vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(dec, (VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
109         }
110         break;
111     default:
112         /* unexpected struct */
113         pnext = NULL;
114         vn_cs_decoder_set_fatal(dec);
115         break;
116     }
117 
118     return pnext;
119 }
120 
121 static inline void
vn_decode_VkDescriptorSetAllocateInfo_self_temp(struct vn_cs_decoder * dec,VkDescriptorSetAllocateInfo * val)122 vn_decode_VkDescriptorSetAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetAllocateInfo *val)
123 {
124     /* skip val->{sType,pNext} */
125     vn_decode_VkDescriptorPool_lookup(dec, &val->descriptorPool);
126     vn_decode_uint32_t(dec, &val->descriptorSetCount);
127     if (vn_peek_array_size(dec)) {
128         const uint32_t iter_count = vn_decode_array_size(dec, val->descriptorSetCount);
129         val->pSetLayouts = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSetLayouts) * iter_count);
130         if (!val->pSetLayouts) return;
131         for (uint32_t i = 0; i < iter_count; i++)
132             vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
133     } else {
134         vn_decode_array_size(dec, val->descriptorSetCount);
135         val->pSetLayouts = NULL;
136     }
137 }
138 
139 static inline void
vn_decode_VkDescriptorSetAllocateInfo_temp(struct vn_cs_decoder * dec,VkDescriptorSetAllocateInfo * val)140 vn_decode_VkDescriptorSetAllocateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetAllocateInfo *val)
141 {
142     VkStructureType stype;
143     vn_decode_VkStructureType(dec, &stype);
144     if (stype != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO)
145         vn_cs_decoder_set_fatal(dec);
146 
147     val->sType = stype;
148     val->pNext = vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(dec);
149     vn_decode_VkDescriptorSetAllocateInfo_self_temp(dec, val);
150 }
151 
152 static inline void
vn_replace_VkDescriptorSetAllocateInfo_handle_self(VkDescriptorSetAllocateInfo * val)153 vn_replace_VkDescriptorSetAllocateInfo_handle_self(VkDescriptorSetAllocateInfo *val)
154 {
155     /* skip val->sType */
156     /* skip val->pNext */
157     vn_replace_VkDescriptorPool_handle(&val->descriptorPool);
158     /* skip val->descriptorSetCount */
159     if (val->pSetLayouts) {
160        for (uint32_t i = 0; i < val->descriptorSetCount; i++)
161             vn_replace_VkDescriptorSetLayout_handle(&((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
162     }
163 }
164 
165 static inline void
vn_replace_VkDescriptorSetAllocateInfo_handle(VkDescriptorSetAllocateInfo * val)166 vn_replace_VkDescriptorSetAllocateInfo_handle(VkDescriptorSetAllocateInfo *val)
167 {
168     struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
169 
170     do {
171         switch ((int32_t)pnext->sType) {
172         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO:
173             vn_replace_VkDescriptorSetAllocateInfo_handle_self((VkDescriptorSetAllocateInfo *)pnext);
174             break;
175         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
176             vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self((VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
177             break;
178         default:
179             /* ignore unknown/unsupported struct */
180             break;
181         }
182         pnext = pnext->pNext;
183     } while (pnext);
184 }
185 
186 /* struct VkCopyDescriptorSet chain */
187 
188 static inline void *
vn_decode_VkCopyDescriptorSet_pnext_temp(struct vn_cs_decoder * dec)189 vn_decode_VkCopyDescriptorSet_pnext_temp(struct vn_cs_decoder *dec)
190 {
191     /* no known/supported struct */
192     if (vn_decode_simple_pointer(dec))
193         vn_cs_decoder_set_fatal(dec);
194     return NULL;
195 }
196 
197 static inline void
vn_decode_VkCopyDescriptorSet_self_temp(struct vn_cs_decoder * dec,VkCopyDescriptorSet * val)198 vn_decode_VkCopyDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkCopyDescriptorSet *val)
199 {
200     /* skip val->{sType,pNext} */
201     vn_decode_VkDescriptorSet_lookup(dec, &val->srcSet);
202     vn_decode_uint32_t(dec, &val->srcBinding);
203     vn_decode_uint32_t(dec, &val->srcArrayElement);
204     vn_decode_VkDescriptorSet_lookup(dec, &val->dstSet);
205     vn_decode_uint32_t(dec, &val->dstBinding);
206     vn_decode_uint32_t(dec, &val->dstArrayElement);
207     vn_decode_uint32_t(dec, &val->descriptorCount);
208 }
209 
210 static inline void
vn_decode_VkCopyDescriptorSet_temp(struct vn_cs_decoder * dec,VkCopyDescriptorSet * val)211 vn_decode_VkCopyDescriptorSet_temp(struct vn_cs_decoder *dec, VkCopyDescriptorSet *val)
212 {
213     VkStructureType stype;
214     vn_decode_VkStructureType(dec, &stype);
215     if (stype != VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET)
216         vn_cs_decoder_set_fatal(dec);
217 
218     val->sType = stype;
219     val->pNext = vn_decode_VkCopyDescriptorSet_pnext_temp(dec);
220     vn_decode_VkCopyDescriptorSet_self_temp(dec, val);
221 }
222 
223 static inline void
vn_replace_VkCopyDescriptorSet_handle_self(VkCopyDescriptorSet * val)224 vn_replace_VkCopyDescriptorSet_handle_self(VkCopyDescriptorSet *val)
225 {
226     /* skip val->sType */
227     /* skip val->pNext */
228     vn_replace_VkDescriptorSet_handle(&val->srcSet);
229     /* skip val->srcBinding */
230     /* skip val->srcArrayElement */
231     vn_replace_VkDescriptorSet_handle(&val->dstSet);
232     /* skip val->dstBinding */
233     /* skip val->dstArrayElement */
234     /* skip val->descriptorCount */
235 }
236 
237 static inline void
vn_replace_VkCopyDescriptorSet_handle(VkCopyDescriptorSet * val)238 vn_replace_VkCopyDescriptorSet_handle(VkCopyDescriptorSet *val)
239 {
240     struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
241 
242     do {
243         switch ((int32_t)pnext->sType) {
244         case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
245             vn_replace_VkCopyDescriptorSet_handle_self((VkCopyDescriptorSet *)pnext);
246             break;
247         default:
248             /* ignore unknown/unsupported struct */
249             break;
250         }
251         pnext = pnext->pNext;
252     } while (pnext);
253 }
254 
vn_decode_vkAllocateDescriptorSets_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkAllocateDescriptorSets * args)255 static inline void vn_decode_vkAllocateDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkAllocateDescriptorSets *args)
256 {
257     vn_decode_VkDevice_lookup(dec, &args->device);
258     if (vn_decode_simple_pointer(dec)) {
259         args->pAllocateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pAllocateInfo));
260         if (!args->pAllocateInfo) return;
261         vn_decode_VkDescriptorSetAllocateInfo_temp(dec, (VkDescriptorSetAllocateInfo *)args->pAllocateInfo);
262     } else {
263         args->pAllocateInfo = NULL;
264         vn_cs_decoder_set_fatal(dec);
265     }
266     if (vn_peek_array_size(dec)) {
267         const uint32_t iter_count = vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
268         args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * iter_count);
269         if (!args->pDescriptorSets) return;
270         for (uint32_t i = 0; i < iter_count; i++)
271             vn_decode_VkDescriptorSet(dec, &args->pDescriptorSets[i]);
272     } else {
273         vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
274         args->pDescriptorSets = NULL;
275     }
276 }
277 
vn_replace_vkAllocateDescriptorSets_args_handle(struct vn_command_vkAllocateDescriptorSets * args)278 static inline void vn_replace_vkAllocateDescriptorSets_args_handle(struct vn_command_vkAllocateDescriptorSets *args)
279 {
280     vn_replace_VkDevice_handle(&args->device);
281     if (args->pAllocateInfo)
282         vn_replace_VkDescriptorSetAllocateInfo_handle((VkDescriptorSetAllocateInfo *)args->pAllocateInfo);
283     /* skip args->pDescriptorSets */
284 }
285 
vn_encode_vkAllocateDescriptorSets_reply(struct vn_cs_encoder * enc,const struct vn_command_vkAllocateDescriptorSets * args)286 static inline void vn_encode_vkAllocateDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkAllocateDescriptorSets *args)
287 {
288     vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT});
289 
290     vn_encode_VkResult(enc, &args->ret);
291     /* skip args->device */
292     /* skip args->pAllocateInfo */
293     if (args->pDescriptorSets) {
294         vn_encode_array_size(enc, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
295         for (uint32_t i = 0; i < (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0); i++)
296             vn_encode_VkDescriptorSet(enc, &args->pDescriptorSets[i]);
297     } else {
298         vn_encode_array_size(enc, 0);
299     }
300 }
301 
vn_decode_vkFreeDescriptorSets_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkFreeDescriptorSets * args)302 static inline void vn_decode_vkFreeDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFreeDescriptorSets *args)
303 {
304     vn_decode_VkDevice_lookup(dec, &args->device);
305     vn_decode_VkDescriptorPool_lookup(dec, &args->descriptorPool);
306     vn_decode_uint32_t(dec, &args->descriptorSetCount);
307     if (vn_peek_array_size(dec)) {
308         const uint32_t iter_count = vn_decode_array_size(dec, args->descriptorSetCount);
309         args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * iter_count);
310         if (!args->pDescriptorSets) return;
311         for (uint32_t i = 0; i < iter_count; i++)
312             vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]);
313     } else {
314         vn_decode_array_size_unchecked(dec);
315         args->pDescriptorSets = NULL;
316     }
317 }
318 
vn_replace_vkFreeDescriptorSets_args_handle(struct vn_command_vkFreeDescriptorSets * args)319 static inline void vn_replace_vkFreeDescriptorSets_args_handle(struct vn_command_vkFreeDescriptorSets *args)
320 {
321     vn_replace_VkDevice_handle(&args->device);
322     vn_replace_VkDescriptorPool_handle(&args->descriptorPool);
323     /* skip args->descriptorSetCount */
324     if (args->pDescriptorSets) {
325        for (uint32_t i = 0; i < args->descriptorSetCount; i++)
326             vn_replace_VkDescriptorSet_handle(&((VkDescriptorSet *)args->pDescriptorSets)[i]);
327     }
328 }
329 
vn_encode_vkFreeDescriptorSets_reply(struct vn_cs_encoder * enc,const struct vn_command_vkFreeDescriptorSets * args)330 static inline void vn_encode_vkFreeDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFreeDescriptorSets *args)
331 {
332     vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT});
333 
334     vn_encode_VkResult(enc, &args->ret);
335     /* skip args->device */
336     /* skip args->descriptorPool */
337     /* skip args->descriptorSetCount */
338     /* skip args->pDescriptorSets */
339 }
340 
vn_decode_vkUpdateDescriptorSets_args_temp(struct vn_cs_decoder * dec,struct vn_command_vkUpdateDescriptorSets * args)341 static inline void vn_decode_vkUpdateDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkUpdateDescriptorSets *args)
342 {
343     vn_decode_VkDevice_lookup(dec, &args->device);
344     vn_decode_uint32_t(dec, &args->descriptorWriteCount);
345     if (vn_peek_array_size(dec)) {
346         const uint32_t iter_count = vn_decode_array_size(dec, args->descriptorWriteCount);
347         args->pDescriptorWrites = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorWrites) * iter_count);
348         if (!args->pDescriptorWrites) return;
349         for (uint32_t i = 0; i < iter_count; i++)
350             vn_decode_VkWriteDescriptorSet_temp(dec, &((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]);
351     } else {
352         vn_decode_array_size(dec, args->descriptorWriteCount);
353         args->pDescriptorWrites = NULL;
354     }
355     vn_decode_uint32_t(dec, &args->descriptorCopyCount);
356     if (vn_peek_array_size(dec)) {
357         const uint32_t iter_count = vn_decode_array_size(dec, args->descriptorCopyCount);
358         args->pDescriptorCopies = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorCopies) * iter_count);
359         if (!args->pDescriptorCopies) return;
360         for (uint32_t i = 0; i < iter_count; i++)
361             vn_decode_VkCopyDescriptorSet_temp(dec, &((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]);
362     } else {
363         vn_decode_array_size(dec, args->descriptorCopyCount);
364         args->pDescriptorCopies = NULL;
365     }
366 }
367 
vn_replace_vkUpdateDescriptorSets_args_handle(struct vn_command_vkUpdateDescriptorSets * args)368 static inline void vn_replace_vkUpdateDescriptorSets_args_handle(struct vn_command_vkUpdateDescriptorSets *args)
369 {
370     vn_replace_VkDevice_handle(&args->device);
371     /* skip args->descriptorWriteCount */
372     if (args->pDescriptorWrites) {
373        for (uint32_t i = 0; i < args->descriptorWriteCount; i++)
374             vn_replace_VkWriteDescriptorSet_handle(&((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]);
375     }
376     /* skip args->descriptorCopyCount */
377     if (args->pDescriptorCopies) {
378        for (uint32_t i = 0; i < args->descriptorCopyCount; i++)
379             vn_replace_VkCopyDescriptorSet_handle(&((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]);
380     }
381 }
382 
vn_encode_vkUpdateDescriptorSets_reply(struct vn_cs_encoder * enc,const struct vn_command_vkUpdateDescriptorSets * args)383 static inline void vn_encode_vkUpdateDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkUpdateDescriptorSets *args)
384 {
385     vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT});
386 
387     /* skip args->device */
388     /* skip args->descriptorWriteCount */
389     /* skip args->pDescriptorWrites */
390     /* skip args->descriptorCopyCount */
391     /* skip args->pDescriptorCopies */
392 }
393 
vn_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)394 static inline void vn_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
395 {
396     struct vn_command_vkAllocateDescriptorSets args;
397 
398     if (!ctx->dispatch_vkAllocateDescriptorSets) {
399         vn_cs_decoder_set_fatal(ctx->decoder);
400         return;
401     }
402 
403     vn_decode_vkAllocateDescriptorSets_args_temp(ctx->decoder, &args);
404     if (!args.device) {
405         vn_cs_decoder_set_fatal(ctx->decoder);
406         return;
407     }
408 
409     if (!vn_cs_decoder_get_fatal(ctx->decoder))
410         ctx->dispatch_vkAllocateDescriptorSets(ctx, &args);
411 
412 #ifdef DEBUG
413     if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
414         vn_dispatch_debug_log(ctx, "vkAllocateDescriptorSets returned %d", args.ret);
415 #endif
416 
417     if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
418        vn_encode_vkAllocateDescriptorSets_reply(ctx->encoder, &args);
419 
420     vn_cs_decoder_reset_temp_pool(ctx->decoder);
421 }
422 
vn_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)423 static inline void vn_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
424 {
425     struct vn_command_vkFreeDescriptorSets args;
426 
427     if (!ctx->dispatch_vkFreeDescriptorSets) {
428         vn_cs_decoder_set_fatal(ctx->decoder);
429         return;
430     }
431 
432     vn_decode_vkFreeDescriptorSets_args_temp(ctx->decoder, &args);
433     if (!args.device) {
434         vn_cs_decoder_set_fatal(ctx->decoder);
435         return;
436     }
437 
438     if (!vn_cs_decoder_get_fatal(ctx->decoder))
439         ctx->dispatch_vkFreeDescriptorSets(ctx, &args);
440 
441 #ifdef DEBUG
442     if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret))
443         vn_dispatch_debug_log(ctx, "vkFreeDescriptorSets returned %d", args.ret);
444 #endif
445 
446     if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
447        vn_encode_vkFreeDescriptorSets_reply(ctx->encoder, &args);
448 
449     vn_cs_decoder_reset_temp_pool(ctx->decoder);
450 }
451 
vn_dispatch_vkUpdateDescriptorSets(struct vn_dispatch_context * ctx,VkCommandFlagsEXT flags)452 static inline void vn_dispatch_vkUpdateDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
453 {
454     struct vn_command_vkUpdateDescriptorSets args;
455 
456     if (!ctx->dispatch_vkUpdateDescriptorSets) {
457         vn_cs_decoder_set_fatal(ctx->decoder);
458         return;
459     }
460 
461     vn_decode_vkUpdateDescriptorSets_args_temp(ctx->decoder, &args);
462     if (!args.device) {
463         vn_cs_decoder_set_fatal(ctx->decoder);
464         return;
465     }
466 
467     if (!vn_cs_decoder_get_fatal(ctx->decoder))
468         ctx->dispatch_vkUpdateDescriptorSets(ctx, &args);
469 
470 
471     if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
472        vn_encode_vkUpdateDescriptorSets_reply(ctx->encoder, &args);
473 
474     vn_cs_decoder_reset_temp_pool(ctx->decoder);
475 }
476 
477 #pragma GCC diagnostic pop
478 
479 #endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_H */
480