1 /* This file is generated by venus-protocol. See vn_protocol_driver.h. */
2
3 /*
4 * Copyright 2020 Google LLC
5 * SPDX-License-Identifier: MIT
6 */
7
8 #ifndef VN_PROTOCOL_DRIVER_IMAGE_VIEW_H
9 #define VN_PROTOCOL_DRIVER_IMAGE_VIEW_H
10
11 #include "vn_instance.h"
12 #include "vn_protocol_driver_structs.h"
13
14 /* struct VkImageViewUsageCreateInfo chain */
15
16 static inline size_t
vn_sizeof_VkImageViewUsageCreateInfo_pnext(const void * val)17 vn_sizeof_VkImageViewUsageCreateInfo_pnext(const void *val)
18 {
19 /* no known/supported struct */
20 return vn_sizeof_simple_pointer(NULL);
21 }
22
23 static inline size_t
vn_sizeof_VkImageViewUsageCreateInfo_self(const VkImageViewUsageCreateInfo * val)24 vn_sizeof_VkImageViewUsageCreateInfo_self(const VkImageViewUsageCreateInfo *val)
25 {
26 size_t size = 0;
27 /* skip val->{sType,pNext} */
28 size += vn_sizeof_VkFlags(&val->usage);
29 return size;
30 }
31
32 static inline size_t
vn_sizeof_VkImageViewUsageCreateInfo(const VkImageViewUsageCreateInfo * val)33 vn_sizeof_VkImageViewUsageCreateInfo(const VkImageViewUsageCreateInfo *val)
34 {
35 size_t size = 0;
36
37 size += vn_sizeof_VkStructureType(&val->sType);
38 size += vn_sizeof_VkImageViewUsageCreateInfo_pnext(val->pNext);
39 size += vn_sizeof_VkImageViewUsageCreateInfo_self(val);
40
41 return size;
42 }
43
44 static inline void
vn_encode_VkImageViewUsageCreateInfo_pnext(struct vn_cs_encoder * enc,const void * val)45 vn_encode_VkImageViewUsageCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
46 {
47 /* no known/supported struct */
48 vn_encode_simple_pointer(enc, NULL);
49 }
50
51 static inline void
vn_encode_VkImageViewUsageCreateInfo_self(struct vn_cs_encoder * enc,const VkImageViewUsageCreateInfo * val)52 vn_encode_VkImageViewUsageCreateInfo_self(struct vn_cs_encoder *enc, const VkImageViewUsageCreateInfo *val)
53 {
54 /* skip val->{sType,pNext} */
55 vn_encode_VkFlags(enc, &val->usage);
56 }
57
58 static inline void
vn_encode_VkImageViewUsageCreateInfo(struct vn_cs_encoder * enc,const VkImageViewUsageCreateInfo * val)59 vn_encode_VkImageViewUsageCreateInfo(struct vn_cs_encoder *enc, const VkImageViewUsageCreateInfo *val)
60 {
61 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO);
62 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO });
63 vn_encode_VkImageViewUsageCreateInfo_pnext(enc, val->pNext);
64 vn_encode_VkImageViewUsageCreateInfo_self(enc, val);
65 }
66
67 /* struct VkImageViewMinLodCreateInfoEXT chain */
68
69 static inline size_t
vn_sizeof_VkImageViewMinLodCreateInfoEXT_pnext(const void * val)70 vn_sizeof_VkImageViewMinLodCreateInfoEXT_pnext(const void *val)
71 {
72 /* no known/supported struct */
73 return vn_sizeof_simple_pointer(NULL);
74 }
75
76 static inline size_t
vn_sizeof_VkImageViewMinLodCreateInfoEXT_self(const VkImageViewMinLodCreateInfoEXT * val)77 vn_sizeof_VkImageViewMinLodCreateInfoEXT_self(const VkImageViewMinLodCreateInfoEXT *val)
78 {
79 size_t size = 0;
80 /* skip val->{sType,pNext} */
81 size += vn_sizeof_float(&val->minLod);
82 return size;
83 }
84
85 static inline size_t
vn_sizeof_VkImageViewMinLodCreateInfoEXT(const VkImageViewMinLodCreateInfoEXT * val)86 vn_sizeof_VkImageViewMinLodCreateInfoEXT(const VkImageViewMinLodCreateInfoEXT *val)
87 {
88 size_t size = 0;
89
90 size += vn_sizeof_VkStructureType(&val->sType);
91 size += vn_sizeof_VkImageViewMinLodCreateInfoEXT_pnext(val->pNext);
92 size += vn_sizeof_VkImageViewMinLodCreateInfoEXT_self(val);
93
94 return size;
95 }
96
97 static inline void
vn_encode_VkImageViewMinLodCreateInfoEXT_pnext(struct vn_cs_encoder * enc,const void * val)98 vn_encode_VkImageViewMinLodCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val)
99 {
100 /* no known/supported struct */
101 vn_encode_simple_pointer(enc, NULL);
102 }
103
104 static inline void
vn_encode_VkImageViewMinLodCreateInfoEXT_self(struct vn_cs_encoder * enc,const VkImageViewMinLodCreateInfoEXT * val)105 vn_encode_VkImageViewMinLodCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkImageViewMinLodCreateInfoEXT *val)
106 {
107 /* skip val->{sType,pNext} */
108 vn_encode_float(enc, &val->minLod);
109 }
110
111 static inline void
vn_encode_VkImageViewMinLodCreateInfoEXT(struct vn_cs_encoder * enc,const VkImageViewMinLodCreateInfoEXT * val)112 vn_encode_VkImageViewMinLodCreateInfoEXT(struct vn_cs_encoder *enc, const VkImageViewMinLodCreateInfoEXT *val)
113 {
114 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT);
115 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT });
116 vn_encode_VkImageViewMinLodCreateInfoEXT_pnext(enc, val->pNext);
117 vn_encode_VkImageViewMinLodCreateInfoEXT_self(enc, val);
118 }
119
120 /* struct VkImageViewCreateInfo chain */
121
122 static inline size_t
vn_sizeof_VkImageViewCreateInfo_pnext(const void * val)123 vn_sizeof_VkImageViewCreateInfo_pnext(const void *val)
124 {
125 const VkBaseInStructure *pnext = val;
126 size_t size = 0;
127
128 while (pnext) {
129 switch ((int32_t)pnext->sType) {
130 case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
131 size += vn_sizeof_simple_pointer(pnext);
132 size += vn_sizeof_VkStructureType(&pnext->sType);
133 size += vn_sizeof_VkImageViewCreateInfo_pnext(pnext->pNext);
134 size += vn_sizeof_VkImageViewUsageCreateInfo_self((const VkImageViewUsageCreateInfo *)pnext);
135 return size;
136 case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
137 size += vn_sizeof_simple_pointer(pnext);
138 size += vn_sizeof_VkStructureType(&pnext->sType);
139 size += vn_sizeof_VkImageViewCreateInfo_pnext(pnext->pNext);
140 size += vn_sizeof_VkSamplerYcbcrConversionInfo_self((const VkSamplerYcbcrConversionInfo *)pnext);
141 return size;
142 case VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT:
143 if (!vn_cs_renderer_protocol_has_extension(392 /* VK_EXT_image_view_min_lod */))
144 break;
145 size += vn_sizeof_simple_pointer(pnext);
146 size += vn_sizeof_VkStructureType(&pnext->sType);
147 size += vn_sizeof_VkImageViewCreateInfo_pnext(pnext->pNext);
148 size += vn_sizeof_VkImageViewMinLodCreateInfoEXT_self((const VkImageViewMinLodCreateInfoEXT *)pnext);
149 return size;
150 default:
151 /* ignore unknown/unsupported struct */
152 break;
153 }
154 pnext = pnext->pNext;
155 }
156
157 return vn_sizeof_simple_pointer(NULL);
158 }
159
160 static inline size_t
vn_sizeof_VkImageViewCreateInfo_self(const VkImageViewCreateInfo * val)161 vn_sizeof_VkImageViewCreateInfo_self(const VkImageViewCreateInfo *val)
162 {
163 size_t size = 0;
164 /* skip val->{sType,pNext} */
165 size += vn_sizeof_VkFlags(&val->flags);
166 size += vn_sizeof_VkImage(&val->image);
167 size += vn_sizeof_VkImageViewType(&val->viewType);
168 size += vn_sizeof_VkFormat(&val->format);
169 size += vn_sizeof_VkComponentMapping(&val->components);
170 size += vn_sizeof_VkImageSubresourceRange(&val->subresourceRange);
171 return size;
172 }
173
174 static inline size_t
vn_sizeof_VkImageViewCreateInfo(const VkImageViewCreateInfo * val)175 vn_sizeof_VkImageViewCreateInfo(const VkImageViewCreateInfo *val)
176 {
177 size_t size = 0;
178
179 size += vn_sizeof_VkStructureType(&val->sType);
180 size += vn_sizeof_VkImageViewCreateInfo_pnext(val->pNext);
181 size += vn_sizeof_VkImageViewCreateInfo_self(val);
182
183 return size;
184 }
185
186 static inline void
vn_encode_VkImageViewCreateInfo_pnext(struct vn_cs_encoder * enc,const void * val)187 vn_encode_VkImageViewCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val)
188 {
189 const VkBaseInStructure *pnext = val;
190
191 while (pnext) {
192 switch ((int32_t)pnext->sType) {
193 case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
194 vn_encode_simple_pointer(enc, pnext);
195 vn_encode_VkStructureType(enc, &pnext->sType);
196 vn_encode_VkImageViewCreateInfo_pnext(enc, pnext->pNext);
197 vn_encode_VkImageViewUsageCreateInfo_self(enc, (const VkImageViewUsageCreateInfo *)pnext);
198 return;
199 case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
200 vn_encode_simple_pointer(enc, pnext);
201 vn_encode_VkStructureType(enc, &pnext->sType);
202 vn_encode_VkImageViewCreateInfo_pnext(enc, pnext->pNext);
203 vn_encode_VkSamplerYcbcrConversionInfo_self(enc, (const VkSamplerYcbcrConversionInfo *)pnext);
204 return;
205 case VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT:
206 if (!vn_cs_renderer_protocol_has_extension(392 /* VK_EXT_image_view_min_lod */))
207 break;
208 vn_encode_simple_pointer(enc, pnext);
209 vn_encode_VkStructureType(enc, &pnext->sType);
210 vn_encode_VkImageViewCreateInfo_pnext(enc, pnext->pNext);
211 vn_encode_VkImageViewMinLodCreateInfoEXT_self(enc, (const VkImageViewMinLodCreateInfoEXT *)pnext);
212 return;
213 default:
214 /* ignore unknown/unsupported struct */
215 break;
216 }
217 pnext = pnext->pNext;
218 }
219
220 vn_encode_simple_pointer(enc, NULL);
221 }
222
223 static inline void
vn_encode_VkImageViewCreateInfo_self(struct vn_cs_encoder * enc,const VkImageViewCreateInfo * val)224 vn_encode_VkImageViewCreateInfo_self(struct vn_cs_encoder *enc, const VkImageViewCreateInfo *val)
225 {
226 /* skip val->{sType,pNext} */
227 vn_encode_VkFlags(enc, &val->flags);
228 vn_encode_VkImage(enc, &val->image);
229 vn_encode_VkImageViewType(enc, &val->viewType);
230 vn_encode_VkFormat(enc, &val->format);
231 vn_encode_VkComponentMapping(enc, &val->components);
232 vn_encode_VkImageSubresourceRange(enc, &val->subresourceRange);
233 }
234
235 static inline void
vn_encode_VkImageViewCreateInfo(struct vn_cs_encoder * enc,const VkImageViewCreateInfo * val)236 vn_encode_VkImageViewCreateInfo(struct vn_cs_encoder *enc, const VkImageViewCreateInfo *val)
237 {
238 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO);
239 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO });
240 vn_encode_VkImageViewCreateInfo_pnext(enc, val->pNext);
241 vn_encode_VkImageViewCreateInfo_self(enc, val);
242 }
243
vn_sizeof_vkCreateImageView(VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)244 static inline size_t vn_sizeof_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
245 {
246 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImageView_EXT;
247 const VkFlags cmd_flags = 0;
248 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
249
250 cmd_size += vn_sizeof_VkDevice(&device);
251 cmd_size += vn_sizeof_simple_pointer(pCreateInfo);
252 if (pCreateInfo)
253 cmd_size += vn_sizeof_VkImageViewCreateInfo(pCreateInfo);
254 cmd_size += vn_sizeof_simple_pointer(pAllocator);
255 if (pAllocator)
256 assert(false);
257 cmd_size += vn_sizeof_simple_pointer(pView);
258 if (pView)
259 cmd_size += vn_sizeof_VkImageView(pView);
260
261 return cmd_size;
262 }
263
vn_encode_vkCreateImageView(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)264 static inline void vn_encode_vkCreateImageView(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
265 {
266 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImageView_EXT;
267
268 vn_encode_VkCommandTypeEXT(enc, &cmd_type);
269 vn_encode_VkFlags(enc, &cmd_flags);
270
271 vn_encode_VkDevice(enc, &device);
272 if (vn_encode_simple_pointer(enc, pCreateInfo))
273 vn_encode_VkImageViewCreateInfo(enc, pCreateInfo);
274 if (vn_encode_simple_pointer(enc, pAllocator))
275 assert(false);
276 if (vn_encode_simple_pointer(enc, pView))
277 vn_encode_VkImageView(enc, pView);
278 }
279
vn_sizeof_vkCreateImageView_reply(VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)280 static inline size_t vn_sizeof_vkCreateImageView_reply(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
281 {
282 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImageView_EXT;
283 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
284
285 VkResult ret;
286 cmd_size += vn_sizeof_VkResult(&ret);
287 /* skip device */
288 /* skip pCreateInfo */
289 /* skip pAllocator */
290 cmd_size += vn_sizeof_simple_pointer(pView);
291 if (pView)
292 cmd_size += vn_sizeof_VkImageView(pView);
293
294 return cmd_size;
295 }
296
vn_decode_vkCreateImageView_reply(struct vn_cs_decoder * dec,VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)297 static inline VkResult vn_decode_vkCreateImageView_reply(struct vn_cs_decoder *dec, VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
298 {
299 VkCommandTypeEXT command_type;
300 vn_decode_VkCommandTypeEXT(dec, &command_type);
301 assert(command_type == VK_COMMAND_TYPE_vkCreateImageView_EXT);
302
303 VkResult ret;
304 vn_decode_VkResult(dec, &ret);
305 /* skip device */
306 /* skip pCreateInfo */
307 /* skip pAllocator */
308 if (vn_decode_simple_pointer(dec)) {
309 vn_decode_VkImageView(dec, pView);
310 } else {
311 pView = NULL;
312 }
313
314 return ret;
315 }
316
vn_sizeof_vkDestroyImageView(VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)317 static inline size_t vn_sizeof_vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
318 {
319 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImageView_EXT;
320 const VkFlags cmd_flags = 0;
321 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags);
322
323 cmd_size += vn_sizeof_VkDevice(&device);
324 cmd_size += vn_sizeof_VkImageView(&imageView);
325 cmd_size += vn_sizeof_simple_pointer(pAllocator);
326 if (pAllocator)
327 assert(false);
328
329 return cmd_size;
330 }
331
vn_encode_vkDestroyImageView(struct vn_cs_encoder * enc,VkCommandFlagsEXT cmd_flags,VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)332 static inline void vn_encode_vkDestroyImageView(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
333 {
334 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImageView_EXT;
335
336 vn_encode_VkCommandTypeEXT(enc, &cmd_type);
337 vn_encode_VkFlags(enc, &cmd_flags);
338
339 vn_encode_VkDevice(enc, &device);
340 vn_encode_VkImageView(enc, &imageView);
341 if (vn_encode_simple_pointer(enc, pAllocator))
342 assert(false);
343 }
344
vn_sizeof_vkDestroyImageView_reply(VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)345 static inline size_t vn_sizeof_vkDestroyImageView_reply(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
346 {
347 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImageView_EXT;
348 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type);
349
350 /* skip device */
351 /* skip imageView */
352 /* skip pAllocator */
353
354 return cmd_size;
355 }
356
vn_decode_vkDestroyImageView_reply(struct vn_cs_decoder * dec,VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)357 static inline void vn_decode_vkDestroyImageView_reply(struct vn_cs_decoder *dec, VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
358 {
359 VkCommandTypeEXT command_type;
360 vn_decode_VkCommandTypeEXT(dec, &command_type);
361 assert(command_type == VK_COMMAND_TYPE_vkDestroyImageView_EXT);
362
363 /* skip device */
364 /* skip imageView */
365 /* skip pAllocator */
366 }
367
vn_submit_vkCreateImageView(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView,struct vn_instance_submit_command * submit)368 static inline void vn_submit_vkCreateImageView(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView, struct vn_instance_submit_command *submit)
369 {
370 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
371 void *cmd_data = local_cmd_data;
372 size_t cmd_size = vn_sizeof_vkCreateImageView(device, pCreateInfo, pAllocator, pView);
373 if (cmd_size > sizeof(local_cmd_data)) {
374 cmd_data = malloc(cmd_size);
375 if (!cmd_data)
376 cmd_size = 0;
377 }
378 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateImageView_reply(device, pCreateInfo, pAllocator, pView) : 0;
379
380 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
381 if (cmd_size) {
382 vn_encode_vkCreateImageView(enc, cmd_flags, device, pCreateInfo, pAllocator, pView);
383 vn_instance_submit_command(vn_instance, submit);
384 if (cmd_data != local_cmd_data)
385 free(cmd_data);
386 }
387 }
388
vn_submit_vkDestroyImageView(struct vn_instance * vn_instance,VkCommandFlagsEXT cmd_flags,VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator,struct vn_instance_submit_command * submit)389 static inline void vn_submit_vkDestroyImageView(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator, struct vn_instance_submit_command *submit)
390 {
391 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE];
392 void *cmd_data = local_cmd_data;
393 size_t cmd_size = vn_sizeof_vkDestroyImageView(device, imageView, pAllocator);
394 if (cmd_size > sizeof(local_cmd_data)) {
395 cmd_data = malloc(cmd_size);
396 if (!cmd_data)
397 cmd_size = 0;
398 }
399 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkDestroyImageView_reply(device, imageView, pAllocator) : 0;
400
401 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size);
402 if (cmd_size) {
403 vn_encode_vkDestroyImageView(enc, cmd_flags, device, imageView, pAllocator);
404 vn_instance_submit_command(vn_instance, submit);
405 if (cmd_data != local_cmd_data)
406 free(cmd_data);
407 }
408 }
409
vn_call_vkCreateImageView(struct vn_instance * vn_instance,VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)410 static inline VkResult vn_call_vkCreateImageView(struct vn_instance *vn_instance, VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
411 {
412 VN_TRACE_FUNC();
413
414 struct vn_instance_submit_command submit;
415 vn_submit_vkCreateImageView(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pCreateInfo, pAllocator, pView, &submit);
416 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
417 if (dec) {
418 const VkResult ret = vn_decode_vkCreateImageView_reply(dec, device, pCreateInfo, pAllocator, pView);
419 vn_instance_free_command_reply(vn_instance, &submit);
420 return ret;
421 } else {
422 return VK_ERROR_OUT_OF_HOST_MEMORY;
423 }
424 }
425
vn_async_vkCreateImageView(struct vn_instance * vn_instance,VkDevice device,const VkImageViewCreateInfo * pCreateInfo,const VkAllocationCallbacks * pAllocator,VkImageView * pView)426 static inline void vn_async_vkCreateImageView(struct vn_instance *vn_instance, VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
427 {
428 struct vn_instance_submit_command submit;
429 vn_submit_vkCreateImageView(vn_instance, 0, device, pCreateInfo, pAllocator, pView, &submit);
430 }
431
vn_call_vkDestroyImageView(struct vn_instance * vn_instance,VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)432 static inline void vn_call_vkDestroyImageView(struct vn_instance *vn_instance, VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
433 {
434 VN_TRACE_FUNC();
435
436 struct vn_instance_submit_command submit;
437 vn_submit_vkDestroyImageView(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, imageView, pAllocator, &submit);
438 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit);
439 if (dec) {
440 vn_decode_vkDestroyImageView_reply(dec, device, imageView, pAllocator);
441 vn_instance_free_command_reply(vn_instance, &submit);
442 }
443 }
444
vn_async_vkDestroyImageView(struct vn_instance * vn_instance,VkDevice device,VkImageView imageView,const VkAllocationCallbacks * pAllocator)445 static inline void vn_async_vkDestroyImageView(struct vn_instance *vn_instance, VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
446 {
447 struct vn_instance_submit_command submit;
448 vn_submit_vkDestroyImageView(vn_instance, 0, device, imageView, pAllocator, &submit);
449 }
450
451 #endif /* VN_PROTOCOL_DRIVER_IMAGE_VIEW_H */
452