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_H 9#define VN_PROTOCOL_DRIVER_IMAGE_H 10 11#include "vn_instance.h" 12#include "vn_protocol_driver_structs.h" 13 14/* struct VkSparseImageMemoryRequirements */ 15 16static inline size_t 17vn_sizeof_VkSparseImageMemoryRequirements(const VkSparseImageMemoryRequirements *val) 18{ 19 size_t size = 0; 20 size += vn_sizeof_VkSparseImageFormatProperties(&val->formatProperties); 21 size += vn_sizeof_uint32_t(&val->imageMipTailFirstLod); 22 size += vn_sizeof_VkDeviceSize(&val->imageMipTailSize); 23 size += vn_sizeof_VkDeviceSize(&val->imageMipTailOffset); 24 size += vn_sizeof_VkDeviceSize(&val->imageMipTailStride); 25 return size; 26} 27 28static inline void 29vn_decode_VkSparseImageMemoryRequirements(struct vn_cs_decoder *dec, VkSparseImageMemoryRequirements *val) 30{ 31 vn_decode_VkSparseImageFormatProperties(dec, &val->formatProperties); 32 vn_decode_uint32_t(dec, &val->imageMipTailFirstLod); 33 vn_decode_VkDeviceSize(dec, &val->imageMipTailSize); 34 vn_decode_VkDeviceSize(dec, &val->imageMipTailOffset); 35 vn_decode_VkDeviceSize(dec, &val->imageMipTailStride); 36} 37 38static inline size_t 39vn_sizeof_VkSparseImageMemoryRequirements_partial(const VkSparseImageMemoryRequirements *val) 40{ 41 size_t size = 0; 42 size += vn_sizeof_VkSparseImageFormatProperties_partial(&val->formatProperties); 43 /* skip val->imageMipTailFirstLod */ 44 /* skip val->imageMipTailSize */ 45 /* skip val->imageMipTailOffset */ 46 /* skip val->imageMipTailStride */ 47 return size; 48} 49 50static inline void 51vn_encode_VkSparseImageMemoryRequirements_partial(struct vn_cs_encoder *enc, const VkSparseImageMemoryRequirements *val) 52{ 53 vn_encode_VkSparseImageFormatProperties_partial(enc, &val->formatProperties); 54 /* skip val->imageMipTailFirstLod */ 55 /* skip val->imageMipTailSize */ 56 /* skip val->imageMipTailOffset */ 57 /* skip val->imageMipTailStride */ 58} 59 60/* struct VkExternalMemoryImageCreateInfo chain */ 61 62static inline size_t 63vn_sizeof_VkExternalMemoryImageCreateInfo_pnext(const void *val) 64{ 65 /* no known/supported struct */ 66 return vn_sizeof_simple_pointer(NULL); 67} 68 69static inline size_t 70vn_sizeof_VkExternalMemoryImageCreateInfo_self(const VkExternalMemoryImageCreateInfo *val) 71{ 72 size_t size = 0; 73 /* skip val->{sType,pNext} */ 74 size += vn_sizeof_VkFlags(&val->handleTypes); 75 return size; 76} 77 78static inline size_t 79vn_sizeof_VkExternalMemoryImageCreateInfo(const VkExternalMemoryImageCreateInfo *val) 80{ 81 size_t size = 0; 82 83 size += vn_sizeof_VkStructureType(&val->sType); 84 size += vn_sizeof_VkExternalMemoryImageCreateInfo_pnext(val->pNext); 85 size += vn_sizeof_VkExternalMemoryImageCreateInfo_self(val); 86 87 return size; 88} 89 90static inline void 91vn_encode_VkExternalMemoryImageCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) 92{ 93 /* no known/supported struct */ 94 vn_encode_simple_pointer(enc, NULL); 95} 96 97static inline void 98vn_encode_VkExternalMemoryImageCreateInfo_self(struct vn_cs_encoder *enc, const VkExternalMemoryImageCreateInfo *val) 99{ 100 /* skip val->{sType,pNext} */ 101 vn_encode_VkFlags(enc, &val->handleTypes); 102} 103 104static inline void 105vn_encode_VkExternalMemoryImageCreateInfo(struct vn_cs_encoder *enc, const VkExternalMemoryImageCreateInfo *val) 106{ 107 assert(val->sType == VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO); 108 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO }); 109 vn_encode_VkExternalMemoryImageCreateInfo_pnext(enc, val->pNext); 110 vn_encode_VkExternalMemoryImageCreateInfo_self(enc, val); 111} 112 113/* struct VkImageDrmFormatModifierListCreateInfoEXT chain */ 114 115static inline size_t 116vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT_pnext(const void *val) 117{ 118 /* no known/supported struct */ 119 return vn_sizeof_simple_pointer(NULL); 120} 121 122static inline size_t 123vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT_self(const VkImageDrmFormatModifierListCreateInfoEXT *val) 124{ 125 size_t size = 0; 126 /* skip val->{sType,pNext} */ 127 size += vn_sizeof_uint32_t(&val->drmFormatModifierCount); 128 if (val->pDrmFormatModifiers) { 129 size += vn_sizeof_array_size(val->drmFormatModifierCount); 130 size += vn_sizeof_uint64_t_array(val->pDrmFormatModifiers, val->drmFormatModifierCount); 131 } else { 132 size += vn_sizeof_array_size(0); 133 } 134 return size; 135} 136 137static inline size_t 138vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT(const VkImageDrmFormatModifierListCreateInfoEXT *val) 139{ 140 size_t size = 0; 141 142 size += vn_sizeof_VkStructureType(&val->sType); 143 size += vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT_pnext(val->pNext); 144 size += vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT_self(val); 145 146 return size; 147} 148 149static inline void 150vn_encode_VkImageDrmFormatModifierListCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) 151{ 152 /* no known/supported struct */ 153 vn_encode_simple_pointer(enc, NULL); 154} 155 156static inline void 157vn_encode_VkImageDrmFormatModifierListCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierListCreateInfoEXT *val) 158{ 159 /* skip val->{sType,pNext} */ 160 vn_encode_uint32_t(enc, &val->drmFormatModifierCount); 161 if (val->pDrmFormatModifiers) { 162 vn_encode_array_size(enc, val->drmFormatModifierCount); 163 vn_encode_uint64_t_array(enc, val->pDrmFormatModifiers, val->drmFormatModifierCount); 164 } else { 165 vn_encode_array_size(enc, 0); 166 } 167} 168 169static inline void 170vn_encode_VkImageDrmFormatModifierListCreateInfoEXT(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierListCreateInfoEXT *val) 171{ 172 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT); 173 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT }); 174 vn_encode_VkImageDrmFormatModifierListCreateInfoEXT_pnext(enc, val->pNext); 175 vn_encode_VkImageDrmFormatModifierListCreateInfoEXT_self(enc, val); 176} 177 178/* struct VkSubresourceLayout */ 179 180static inline size_t 181vn_sizeof_VkSubresourceLayout(const VkSubresourceLayout *val) 182{ 183 size_t size = 0; 184 size += vn_sizeof_VkDeviceSize(&val->offset); 185 size += vn_sizeof_VkDeviceSize(&val->size); 186 size += vn_sizeof_VkDeviceSize(&val->rowPitch); 187 size += vn_sizeof_VkDeviceSize(&val->arrayPitch); 188 size += vn_sizeof_VkDeviceSize(&val->depthPitch); 189 return size; 190} 191 192static inline void 193vn_encode_VkSubresourceLayout(struct vn_cs_encoder *enc, const VkSubresourceLayout *val) 194{ 195 vn_encode_VkDeviceSize(enc, &val->offset); 196 vn_encode_VkDeviceSize(enc, &val->size); 197 vn_encode_VkDeviceSize(enc, &val->rowPitch); 198 vn_encode_VkDeviceSize(enc, &val->arrayPitch); 199 vn_encode_VkDeviceSize(enc, &val->depthPitch); 200} 201 202static inline void 203vn_decode_VkSubresourceLayout(struct vn_cs_decoder *dec, VkSubresourceLayout *val) 204{ 205 vn_decode_VkDeviceSize(dec, &val->offset); 206 vn_decode_VkDeviceSize(dec, &val->size); 207 vn_decode_VkDeviceSize(dec, &val->rowPitch); 208 vn_decode_VkDeviceSize(dec, &val->arrayPitch); 209 vn_decode_VkDeviceSize(dec, &val->depthPitch); 210} 211 212static inline size_t 213vn_sizeof_VkSubresourceLayout_partial(const VkSubresourceLayout *val) 214{ 215 size_t size = 0; 216 /* skip val->offset */ 217 /* skip val->size */ 218 /* skip val->rowPitch */ 219 /* skip val->arrayPitch */ 220 /* skip val->depthPitch */ 221 return size; 222} 223 224static inline void 225vn_encode_VkSubresourceLayout_partial(struct vn_cs_encoder *enc, const VkSubresourceLayout *val) 226{ 227 /* skip val->offset */ 228 /* skip val->size */ 229 /* skip val->rowPitch */ 230 /* skip val->arrayPitch */ 231 /* skip val->depthPitch */ 232} 233 234/* struct VkImageDrmFormatModifierExplicitCreateInfoEXT chain */ 235 236static inline size_t 237vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT_pnext(const void *val) 238{ 239 /* no known/supported struct */ 240 return vn_sizeof_simple_pointer(NULL); 241} 242 243static inline size_t 244vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT_self(const VkImageDrmFormatModifierExplicitCreateInfoEXT *val) 245{ 246 size_t size = 0; 247 /* skip val->{sType,pNext} */ 248 size += vn_sizeof_uint64_t(&val->drmFormatModifier); 249 size += vn_sizeof_uint32_t(&val->drmFormatModifierPlaneCount); 250 if (val->pPlaneLayouts) { 251 size += vn_sizeof_array_size(val->drmFormatModifierPlaneCount); 252 for (uint32_t i = 0; i < val->drmFormatModifierPlaneCount; i++) 253 size += vn_sizeof_VkSubresourceLayout(&val->pPlaneLayouts[i]); 254 } else { 255 size += vn_sizeof_array_size(0); 256 } 257 return size; 258} 259 260static inline size_t 261vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT(const VkImageDrmFormatModifierExplicitCreateInfoEXT *val) 262{ 263 size_t size = 0; 264 265 size += vn_sizeof_VkStructureType(&val->sType); 266 size += vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT_pnext(val->pNext); 267 size += vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT_self(val); 268 269 return size; 270} 271 272static inline void 273vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) 274{ 275 /* no known/supported struct */ 276 vn_encode_simple_pointer(enc, NULL); 277} 278 279static inline void 280vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierExplicitCreateInfoEXT *val) 281{ 282 /* skip val->{sType,pNext} */ 283 vn_encode_uint64_t(enc, &val->drmFormatModifier); 284 vn_encode_uint32_t(enc, &val->drmFormatModifierPlaneCount); 285 if (val->pPlaneLayouts) { 286 vn_encode_array_size(enc, val->drmFormatModifierPlaneCount); 287 for (uint32_t i = 0; i < val->drmFormatModifierPlaneCount; i++) 288 vn_encode_VkSubresourceLayout(enc, &val->pPlaneLayouts[i]); 289 } else { 290 vn_encode_array_size(enc, 0); 291 } 292} 293 294static inline void 295vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierExplicitCreateInfoEXT *val) 296{ 297 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT); 298 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT }); 299 vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT_pnext(enc, val->pNext); 300 vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT_self(enc, val); 301} 302 303/* struct VkImageCreateInfo chain */ 304 305static inline size_t 306vn_sizeof_VkImageCreateInfo_pnext(const void *val) 307{ 308 const VkBaseInStructure *pnext = val; 309 size_t size = 0; 310 311 while (pnext) { 312 switch ((int32_t)pnext->sType) { 313 case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: 314 size += vn_sizeof_simple_pointer(pnext); 315 size += vn_sizeof_VkStructureType(&pnext->sType); 316 size += vn_sizeof_VkImageCreateInfo_pnext(pnext->pNext); 317 size += vn_sizeof_VkExternalMemoryImageCreateInfo_self((const VkExternalMemoryImageCreateInfo *)pnext); 318 return size; 319 case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: 320 size += vn_sizeof_simple_pointer(pnext); 321 size += vn_sizeof_VkStructureType(&pnext->sType); 322 size += vn_sizeof_VkImageCreateInfo_pnext(pnext->pNext); 323 size += vn_sizeof_VkImageFormatListCreateInfo_self((const VkImageFormatListCreateInfo *)pnext); 324 return size; 325 case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: 326 size += vn_sizeof_simple_pointer(pnext); 327 size += vn_sizeof_VkStructureType(&pnext->sType); 328 size += vn_sizeof_VkImageCreateInfo_pnext(pnext->pNext); 329 size += vn_sizeof_VkImageDrmFormatModifierListCreateInfoEXT_self((const VkImageDrmFormatModifierListCreateInfoEXT *)pnext); 330 return size; 331 case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: 332 size += vn_sizeof_simple_pointer(pnext); 333 size += vn_sizeof_VkStructureType(&pnext->sType); 334 size += vn_sizeof_VkImageCreateInfo_pnext(pnext->pNext); 335 size += vn_sizeof_VkImageDrmFormatModifierExplicitCreateInfoEXT_self((const VkImageDrmFormatModifierExplicitCreateInfoEXT *)pnext); 336 return size; 337 case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: 338 size += vn_sizeof_simple_pointer(pnext); 339 size += vn_sizeof_VkStructureType(&pnext->sType); 340 size += vn_sizeof_VkImageCreateInfo_pnext(pnext->pNext); 341 size += vn_sizeof_VkImageStencilUsageCreateInfo_self((const VkImageStencilUsageCreateInfo *)pnext); 342 return size; 343 default: 344 /* ignore unknown/unsupported struct */ 345 break; 346 } 347 pnext = pnext->pNext; 348 } 349 350 return vn_sizeof_simple_pointer(NULL); 351} 352 353static inline size_t 354vn_sizeof_VkImageCreateInfo_self(const VkImageCreateInfo *val) 355{ 356 size_t size = 0; 357 /* skip val->{sType,pNext} */ 358 size += vn_sizeof_VkFlags(&val->flags); 359 size += vn_sizeof_VkImageType(&val->imageType); 360 size += vn_sizeof_VkFormat(&val->format); 361 size += vn_sizeof_VkExtent3D(&val->extent); 362 size += vn_sizeof_uint32_t(&val->mipLevels); 363 size += vn_sizeof_uint32_t(&val->arrayLayers); 364 size += vn_sizeof_VkSampleCountFlagBits(&val->samples); 365 size += vn_sizeof_VkImageTiling(&val->tiling); 366 size += vn_sizeof_VkFlags(&val->usage); 367 size += vn_sizeof_VkSharingMode(&val->sharingMode); 368 size += vn_sizeof_uint32_t(&val->queueFamilyIndexCount); 369 if (val->pQueueFamilyIndices) { 370 size += vn_sizeof_array_size(val->queueFamilyIndexCount); 371 size += vn_sizeof_uint32_t_array(val->pQueueFamilyIndices, val->queueFamilyIndexCount); 372 } else { 373 size += vn_sizeof_array_size(0); 374 } 375 size += vn_sizeof_VkImageLayout(&val->initialLayout); 376 return size; 377} 378 379static inline size_t 380vn_sizeof_VkImageCreateInfo(const VkImageCreateInfo *val) 381{ 382 size_t size = 0; 383 384 size += vn_sizeof_VkStructureType(&val->sType); 385 size += vn_sizeof_VkImageCreateInfo_pnext(val->pNext); 386 size += vn_sizeof_VkImageCreateInfo_self(val); 387 388 return size; 389} 390 391static inline void 392vn_encode_VkImageCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) 393{ 394 const VkBaseInStructure *pnext = val; 395 396 while (pnext) { 397 switch ((int32_t)pnext->sType) { 398 case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: 399 vn_encode_simple_pointer(enc, pnext); 400 vn_encode_VkStructureType(enc, &pnext->sType); 401 vn_encode_VkImageCreateInfo_pnext(enc, pnext->pNext); 402 vn_encode_VkExternalMemoryImageCreateInfo_self(enc, (const VkExternalMemoryImageCreateInfo *)pnext); 403 return; 404 case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: 405 vn_encode_simple_pointer(enc, pnext); 406 vn_encode_VkStructureType(enc, &pnext->sType); 407 vn_encode_VkImageCreateInfo_pnext(enc, pnext->pNext); 408 vn_encode_VkImageFormatListCreateInfo_self(enc, (const VkImageFormatListCreateInfo *)pnext); 409 return; 410 case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: 411 vn_encode_simple_pointer(enc, pnext); 412 vn_encode_VkStructureType(enc, &pnext->sType); 413 vn_encode_VkImageCreateInfo_pnext(enc, pnext->pNext); 414 vn_encode_VkImageDrmFormatModifierListCreateInfoEXT_self(enc, (const VkImageDrmFormatModifierListCreateInfoEXT *)pnext); 415 return; 416 case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: 417 vn_encode_simple_pointer(enc, pnext); 418 vn_encode_VkStructureType(enc, &pnext->sType); 419 vn_encode_VkImageCreateInfo_pnext(enc, pnext->pNext); 420 vn_encode_VkImageDrmFormatModifierExplicitCreateInfoEXT_self(enc, (const VkImageDrmFormatModifierExplicitCreateInfoEXT *)pnext); 421 return; 422 case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: 423 vn_encode_simple_pointer(enc, pnext); 424 vn_encode_VkStructureType(enc, &pnext->sType); 425 vn_encode_VkImageCreateInfo_pnext(enc, pnext->pNext); 426 vn_encode_VkImageStencilUsageCreateInfo_self(enc, (const VkImageStencilUsageCreateInfo *)pnext); 427 return; 428 default: 429 /* ignore unknown/unsupported struct */ 430 break; 431 } 432 pnext = pnext->pNext; 433 } 434 435 vn_encode_simple_pointer(enc, NULL); 436} 437 438static inline void 439vn_encode_VkImageCreateInfo_self(struct vn_cs_encoder *enc, const VkImageCreateInfo *val) 440{ 441 /* skip val->{sType,pNext} */ 442 vn_encode_VkFlags(enc, &val->flags); 443 vn_encode_VkImageType(enc, &val->imageType); 444 vn_encode_VkFormat(enc, &val->format); 445 vn_encode_VkExtent3D(enc, &val->extent); 446 vn_encode_uint32_t(enc, &val->mipLevels); 447 vn_encode_uint32_t(enc, &val->arrayLayers); 448 vn_encode_VkSampleCountFlagBits(enc, &val->samples); 449 vn_encode_VkImageTiling(enc, &val->tiling); 450 vn_encode_VkFlags(enc, &val->usage); 451 vn_encode_VkSharingMode(enc, &val->sharingMode); 452 vn_encode_uint32_t(enc, &val->queueFamilyIndexCount); 453 if (val->pQueueFamilyIndices) { 454 vn_encode_array_size(enc, val->queueFamilyIndexCount); 455 vn_encode_uint32_t_array(enc, val->pQueueFamilyIndices, val->queueFamilyIndexCount); 456 } else { 457 vn_encode_array_size(enc, 0); 458 } 459 vn_encode_VkImageLayout(enc, &val->initialLayout); 460} 461 462static inline void 463vn_encode_VkImageCreateInfo(struct vn_cs_encoder *enc, const VkImageCreateInfo *val) 464{ 465 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO); 466 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }); 467 vn_encode_VkImageCreateInfo_pnext(enc, val->pNext); 468 vn_encode_VkImageCreateInfo_self(enc, val); 469} 470 471/* struct VkBindImageMemoryDeviceGroupInfo chain */ 472 473static inline size_t 474vn_sizeof_VkBindImageMemoryDeviceGroupInfo_pnext(const void *val) 475{ 476 /* no known/supported struct */ 477 return vn_sizeof_simple_pointer(NULL); 478} 479 480static inline size_t 481vn_sizeof_VkBindImageMemoryDeviceGroupInfo_self(const VkBindImageMemoryDeviceGroupInfo *val) 482{ 483 size_t size = 0; 484 /* skip val->{sType,pNext} */ 485 size += vn_sizeof_uint32_t(&val->deviceIndexCount); 486 if (val->pDeviceIndices) { 487 size += vn_sizeof_array_size(val->deviceIndexCount); 488 size += vn_sizeof_uint32_t_array(val->pDeviceIndices, val->deviceIndexCount); 489 } else { 490 size += vn_sizeof_array_size(0); 491 } 492 size += vn_sizeof_uint32_t(&val->splitInstanceBindRegionCount); 493 if (val->pSplitInstanceBindRegions) { 494 size += vn_sizeof_array_size(val->splitInstanceBindRegionCount); 495 for (uint32_t i = 0; i < val->splitInstanceBindRegionCount; i++) 496 size += vn_sizeof_VkRect2D(&val->pSplitInstanceBindRegions[i]); 497 } else { 498 size += vn_sizeof_array_size(0); 499 } 500 return size; 501} 502 503static inline size_t 504vn_sizeof_VkBindImageMemoryDeviceGroupInfo(const VkBindImageMemoryDeviceGroupInfo *val) 505{ 506 size_t size = 0; 507 508 size += vn_sizeof_VkStructureType(&val->sType); 509 size += vn_sizeof_VkBindImageMemoryDeviceGroupInfo_pnext(val->pNext); 510 size += vn_sizeof_VkBindImageMemoryDeviceGroupInfo_self(val); 511 512 return size; 513} 514 515static inline void 516vn_encode_VkBindImageMemoryDeviceGroupInfo_pnext(struct vn_cs_encoder *enc, const void *val) 517{ 518 /* no known/supported struct */ 519 vn_encode_simple_pointer(enc, NULL); 520} 521 522static inline void 523vn_encode_VkBindImageMemoryDeviceGroupInfo_self(struct vn_cs_encoder *enc, const VkBindImageMemoryDeviceGroupInfo *val) 524{ 525 /* skip val->{sType,pNext} */ 526 vn_encode_uint32_t(enc, &val->deviceIndexCount); 527 if (val->pDeviceIndices) { 528 vn_encode_array_size(enc, val->deviceIndexCount); 529 vn_encode_uint32_t_array(enc, val->pDeviceIndices, val->deviceIndexCount); 530 } else { 531 vn_encode_array_size(enc, 0); 532 } 533 vn_encode_uint32_t(enc, &val->splitInstanceBindRegionCount); 534 if (val->pSplitInstanceBindRegions) { 535 vn_encode_array_size(enc, val->splitInstanceBindRegionCount); 536 for (uint32_t i = 0; i < val->splitInstanceBindRegionCount; i++) 537 vn_encode_VkRect2D(enc, &val->pSplitInstanceBindRegions[i]); 538 } else { 539 vn_encode_array_size(enc, 0); 540 } 541} 542 543static inline void 544vn_encode_VkBindImageMemoryDeviceGroupInfo(struct vn_cs_encoder *enc, const VkBindImageMemoryDeviceGroupInfo *val) 545{ 546 assert(val->sType == VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO); 547 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO }); 548 vn_encode_VkBindImageMemoryDeviceGroupInfo_pnext(enc, val->pNext); 549 vn_encode_VkBindImageMemoryDeviceGroupInfo_self(enc, val); 550} 551 552static inline void 553vn_decode_VkBindImageMemoryDeviceGroupInfo_pnext(struct vn_cs_decoder *dec, const void *val) 554{ 555 /* no known/supported struct */ 556 if (vn_decode_simple_pointer(dec)) 557 assert(false); 558} 559 560static inline void 561vn_decode_VkBindImageMemoryDeviceGroupInfo_self(struct vn_cs_decoder *dec, VkBindImageMemoryDeviceGroupInfo *val) 562{ 563 /* skip val->{sType,pNext} */ 564 vn_decode_uint32_t(dec, &val->deviceIndexCount); 565 if (vn_peek_array_size(dec)) { 566 const size_t array_size = vn_decode_array_size(dec, val->deviceIndexCount); 567 vn_decode_uint32_t_array(dec, (uint32_t *)val->pDeviceIndices, array_size); 568 } else { 569 vn_decode_array_size_unchecked(dec); 570 val->pDeviceIndices = NULL; 571 } 572 vn_decode_uint32_t(dec, &val->splitInstanceBindRegionCount); 573 if (vn_peek_array_size(dec)) { 574 const uint32_t iter_count = vn_decode_array_size(dec, val->splitInstanceBindRegionCount); 575 for (uint32_t i = 0; i < iter_count; i++) 576 vn_decode_VkRect2D(dec, &((VkRect2D *)val->pSplitInstanceBindRegions)[i]); 577 } else { 578 vn_decode_array_size_unchecked(dec); 579 val->pSplitInstanceBindRegions = NULL; 580 } 581} 582 583static inline void 584vn_decode_VkBindImageMemoryDeviceGroupInfo(struct vn_cs_decoder *dec, VkBindImageMemoryDeviceGroupInfo *val) 585{ 586 VkStructureType stype; 587 vn_decode_VkStructureType(dec, &stype); 588 assert(stype == VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO); 589 590 assert(val->sType == stype); 591 vn_decode_VkBindImageMemoryDeviceGroupInfo_pnext(dec, val->pNext); 592 vn_decode_VkBindImageMemoryDeviceGroupInfo_self(dec, val); 593} 594 595/* struct VkBindImagePlaneMemoryInfo chain */ 596 597static inline size_t 598vn_sizeof_VkBindImagePlaneMemoryInfo_pnext(const void *val) 599{ 600 /* no known/supported struct */ 601 return vn_sizeof_simple_pointer(NULL); 602} 603 604static inline size_t 605vn_sizeof_VkBindImagePlaneMemoryInfo_self(const VkBindImagePlaneMemoryInfo *val) 606{ 607 size_t size = 0; 608 /* skip val->{sType,pNext} */ 609 size += vn_sizeof_VkImageAspectFlagBits(&val->planeAspect); 610 return size; 611} 612 613static inline size_t 614vn_sizeof_VkBindImagePlaneMemoryInfo(const VkBindImagePlaneMemoryInfo *val) 615{ 616 size_t size = 0; 617 618 size += vn_sizeof_VkStructureType(&val->sType); 619 size += vn_sizeof_VkBindImagePlaneMemoryInfo_pnext(val->pNext); 620 size += vn_sizeof_VkBindImagePlaneMemoryInfo_self(val); 621 622 return size; 623} 624 625static inline void 626vn_encode_VkBindImagePlaneMemoryInfo_pnext(struct vn_cs_encoder *enc, const void *val) 627{ 628 /* no known/supported struct */ 629 vn_encode_simple_pointer(enc, NULL); 630} 631 632static inline void 633vn_encode_VkBindImagePlaneMemoryInfo_self(struct vn_cs_encoder *enc, const VkBindImagePlaneMemoryInfo *val) 634{ 635 /* skip val->{sType,pNext} */ 636 vn_encode_VkImageAspectFlagBits(enc, &val->planeAspect); 637} 638 639static inline void 640vn_encode_VkBindImagePlaneMemoryInfo(struct vn_cs_encoder *enc, const VkBindImagePlaneMemoryInfo *val) 641{ 642 assert(val->sType == VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO); 643 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO }); 644 vn_encode_VkBindImagePlaneMemoryInfo_pnext(enc, val->pNext); 645 vn_encode_VkBindImagePlaneMemoryInfo_self(enc, val); 646} 647 648static inline void 649vn_decode_VkBindImagePlaneMemoryInfo_pnext(struct vn_cs_decoder *dec, const void *val) 650{ 651 /* no known/supported struct */ 652 if (vn_decode_simple_pointer(dec)) 653 assert(false); 654} 655 656static inline void 657vn_decode_VkBindImagePlaneMemoryInfo_self(struct vn_cs_decoder *dec, VkBindImagePlaneMemoryInfo *val) 658{ 659 /* skip val->{sType,pNext} */ 660 vn_decode_VkImageAspectFlagBits(dec, &val->planeAspect); 661} 662 663static inline void 664vn_decode_VkBindImagePlaneMemoryInfo(struct vn_cs_decoder *dec, VkBindImagePlaneMemoryInfo *val) 665{ 666 VkStructureType stype; 667 vn_decode_VkStructureType(dec, &stype); 668 assert(stype == VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO); 669 670 assert(val->sType == stype); 671 vn_decode_VkBindImagePlaneMemoryInfo_pnext(dec, val->pNext); 672 vn_decode_VkBindImagePlaneMemoryInfo_self(dec, val); 673} 674 675/* struct VkBindImageMemoryInfo chain */ 676 677static inline size_t 678vn_sizeof_VkBindImageMemoryInfo_pnext(const void *val) 679{ 680 const VkBaseInStructure *pnext = val; 681 size_t size = 0; 682 683 while (pnext) { 684 switch ((int32_t)pnext->sType) { 685 case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: 686 size += vn_sizeof_simple_pointer(pnext); 687 size += vn_sizeof_VkStructureType(&pnext->sType); 688 size += vn_sizeof_VkBindImageMemoryInfo_pnext(pnext->pNext); 689 size += vn_sizeof_VkBindImageMemoryDeviceGroupInfo_self((const VkBindImageMemoryDeviceGroupInfo *)pnext); 690 return size; 691 case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: 692 size += vn_sizeof_simple_pointer(pnext); 693 size += vn_sizeof_VkStructureType(&pnext->sType); 694 size += vn_sizeof_VkBindImageMemoryInfo_pnext(pnext->pNext); 695 size += vn_sizeof_VkBindImagePlaneMemoryInfo_self((const VkBindImagePlaneMemoryInfo *)pnext); 696 return size; 697 default: 698 /* ignore unknown/unsupported struct */ 699 break; 700 } 701 pnext = pnext->pNext; 702 } 703 704 return vn_sizeof_simple_pointer(NULL); 705} 706 707static inline size_t 708vn_sizeof_VkBindImageMemoryInfo_self(const VkBindImageMemoryInfo *val) 709{ 710 size_t size = 0; 711 /* skip val->{sType,pNext} */ 712 size += vn_sizeof_VkImage(&val->image); 713 size += vn_sizeof_VkDeviceMemory(&val->memory); 714 size += vn_sizeof_VkDeviceSize(&val->memoryOffset); 715 return size; 716} 717 718static inline size_t 719vn_sizeof_VkBindImageMemoryInfo(const VkBindImageMemoryInfo *val) 720{ 721 size_t size = 0; 722 723 size += vn_sizeof_VkStructureType(&val->sType); 724 size += vn_sizeof_VkBindImageMemoryInfo_pnext(val->pNext); 725 size += vn_sizeof_VkBindImageMemoryInfo_self(val); 726 727 return size; 728} 729 730static inline void 731vn_encode_VkBindImageMemoryInfo_pnext(struct vn_cs_encoder *enc, const void *val) 732{ 733 const VkBaseInStructure *pnext = val; 734 735 while (pnext) { 736 switch ((int32_t)pnext->sType) { 737 case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: 738 vn_encode_simple_pointer(enc, pnext); 739 vn_encode_VkStructureType(enc, &pnext->sType); 740 vn_encode_VkBindImageMemoryInfo_pnext(enc, pnext->pNext); 741 vn_encode_VkBindImageMemoryDeviceGroupInfo_self(enc, (const VkBindImageMemoryDeviceGroupInfo *)pnext); 742 return; 743 case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: 744 vn_encode_simple_pointer(enc, pnext); 745 vn_encode_VkStructureType(enc, &pnext->sType); 746 vn_encode_VkBindImageMemoryInfo_pnext(enc, pnext->pNext); 747 vn_encode_VkBindImagePlaneMemoryInfo_self(enc, (const VkBindImagePlaneMemoryInfo *)pnext); 748 return; 749 default: 750 /* ignore unknown/unsupported struct */ 751 break; 752 } 753 pnext = pnext->pNext; 754 } 755 756 vn_encode_simple_pointer(enc, NULL); 757} 758 759static inline void 760vn_encode_VkBindImageMemoryInfo_self(struct vn_cs_encoder *enc, const VkBindImageMemoryInfo *val) 761{ 762 /* skip val->{sType,pNext} */ 763 vn_encode_VkImage(enc, &val->image); 764 vn_encode_VkDeviceMemory(enc, &val->memory); 765 vn_encode_VkDeviceSize(enc, &val->memoryOffset); 766} 767 768static inline void 769vn_encode_VkBindImageMemoryInfo(struct vn_cs_encoder *enc, const VkBindImageMemoryInfo *val) 770{ 771 assert(val->sType == VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO); 772 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO }); 773 vn_encode_VkBindImageMemoryInfo_pnext(enc, val->pNext); 774 vn_encode_VkBindImageMemoryInfo_self(enc, val); 775} 776 777static inline void 778vn_decode_VkBindImageMemoryInfo_pnext(struct vn_cs_decoder *dec, const void *val) 779{ 780 VkBaseOutStructure *pnext = (VkBaseOutStructure *)val; 781 VkStructureType stype; 782 783 if (!vn_decode_simple_pointer(dec)) 784 return; 785 786 vn_decode_VkStructureType(dec, &stype); 787 while (true) { 788 assert(pnext); 789 if (pnext->sType == stype) 790 break; 791 } 792 793 switch ((int32_t)pnext->sType) { 794 case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: 795 vn_decode_VkBindImageMemoryInfo_pnext(dec, pnext->pNext); 796 vn_decode_VkBindImageMemoryDeviceGroupInfo_self(dec, (VkBindImageMemoryDeviceGroupInfo *)pnext); 797 break; 798 case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: 799 vn_decode_VkBindImageMemoryInfo_pnext(dec, pnext->pNext); 800 vn_decode_VkBindImagePlaneMemoryInfo_self(dec, (VkBindImagePlaneMemoryInfo *)pnext); 801 break; 802 default: 803 assert(false); 804 break; 805 } 806} 807 808static inline void 809vn_decode_VkBindImageMemoryInfo_self(struct vn_cs_decoder *dec, VkBindImageMemoryInfo *val) 810{ 811 /* skip val->{sType,pNext} */ 812 vn_decode_VkImage(dec, &val->image); 813 vn_decode_VkDeviceMemory(dec, &val->memory); 814 vn_decode_VkDeviceSize(dec, &val->memoryOffset); 815} 816 817static inline void 818vn_decode_VkBindImageMemoryInfo(struct vn_cs_decoder *dec, VkBindImageMemoryInfo *val) 819{ 820 VkStructureType stype; 821 vn_decode_VkStructureType(dec, &stype); 822 assert(stype == VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO); 823 824 assert(val->sType == stype); 825 vn_decode_VkBindImageMemoryInfo_pnext(dec, val->pNext); 826 vn_decode_VkBindImageMemoryInfo_self(dec, val); 827} 828 829/* struct VkImagePlaneMemoryRequirementsInfo chain */ 830 831static inline size_t 832vn_sizeof_VkImagePlaneMemoryRequirementsInfo_pnext(const void *val) 833{ 834 /* no known/supported struct */ 835 return vn_sizeof_simple_pointer(NULL); 836} 837 838static inline size_t 839vn_sizeof_VkImagePlaneMemoryRequirementsInfo_self(const VkImagePlaneMemoryRequirementsInfo *val) 840{ 841 size_t size = 0; 842 /* skip val->{sType,pNext} */ 843 size += vn_sizeof_VkImageAspectFlagBits(&val->planeAspect); 844 return size; 845} 846 847static inline size_t 848vn_sizeof_VkImagePlaneMemoryRequirementsInfo(const VkImagePlaneMemoryRequirementsInfo *val) 849{ 850 size_t size = 0; 851 852 size += vn_sizeof_VkStructureType(&val->sType); 853 size += vn_sizeof_VkImagePlaneMemoryRequirementsInfo_pnext(val->pNext); 854 size += vn_sizeof_VkImagePlaneMemoryRequirementsInfo_self(val); 855 856 return size; 857} 858 859static inline void 860vn_encode_VkImagePlaneMemoryRequirementsInfo_pnext(struct vn_cs_encoder *enc, const void *val) 861{ 862 /* no known/supported struct */ 863 vn_encode_simple_pointer(enc, NULL); 864} 865 866static inline void 867vn_encode_VkImagePlaneMemoryRequirementsInfo_self(struct vn_cs_encoder *enc, const VkImagePlaneMemoryRequirementsInfo *val) 868{ 869 /* skip val->{sType,pNext} */ 870 vn_encode_VkImageAspectFlagBits(enc, &val->planeAspect); 871} 872 873static inline void 874vn_encode_VkImagePlaneMemoryRequirementsInfo(struct vn_cs_encoder *enc, const VkImagePlaneMemoryRequirementsInfo *val) 875{ 876 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO); 877 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO }); 878 vn_encode_VkImagePlaneMemoryRequirementsInfo_pnext(enc, val->pNext); 879 vn_encode_VkImagePlaneMemoryRequirementsInfo_self(enc, val); 880} 881 882/* struct VkImageMemoryRequirementsInfo2 chain */ 883 884static inline size_t 885vn_sizeof_VkImageMemoryRequirementsInfo2_pnext(const void *val) 886{ 887 const VkBaseInStructure *pnext = val; 888 size_t size = 0; 889 890 while (pnext) { 891 switch ((int32_t)pnext->sType) { 892 case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: 893 size += vn_sizeof_simple_pointer(pnext); 894 size += vn_sizeof_VkStructureType(&pnext->sType); 895 size += vn_sizeof_VkImageMemoryRequirementsInfo2_pnext(pnext->pNext); 896 size += vn_sizeof_VkImagePlaneMemoryRequirementsInfo_self((const VkImagePlaneMemoryRequirementsInfo *)pnext); 897 return size; 898 default: 899 /* ignore unknown/unsupported struct */ 900 break; 901 } 902 pnext = pnext->pNext; 903 } 904 905 return vn_sizeof_simple_pointer(NULL); 906} 907 908static inline size_t 909vn_sizeof_VkImageMemoryRequirementsInfo2_self(const VkImageMemoryRequirementsInfo2 *val) 910{ 911 size_t size = 0; 912 /* skip val->{sType,pNext} */ 913 size += vn_sizeof_VkImage(&val->image); 914 return size; 915} 916 917static inline size_t 918vn_sizeof_VkImageMemoryRequirementsInfo2(const VkImageMemoryRequirementsInfo2 *val) 919{ 920 size_t size = 0; 921 922 size += vn_sizeof_VkStructureType(&val->sType); 923 size += vn_sizeof_VkImageMemoryRequirementsInfo2_pnext(val->pNext); 924 size += vn_sizeof_VkImageMemoryRequirementsInfo2_self(val); 925 926 return size; 927} 928 929static inline void 930vn_encode_VkImageMemoryRequirementsInfo2_pnext(struct vn_cs_encoder *enc, const void *val) 931{ 932 const VkBaseInStructure *pnext = val; 933 934 while (pnext) { 935 switch ((int32_t)pnext->sType) { 936 case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: 937 vn_encode_simple_pointer(enc, pnext); 938 vn_encode_VkStructureType(enc, &pnext->sType); 939 vn_encode_VkImageMemoryRequirementsInfo2_pnext(enc, pnext->pNext); 940 vn_encode_VkImagePlaneMemoryRequirementsInfo_self(enc, (const VkImagePlaneMemoryRequirementsInfo *)pnext); 941 return; 942 default: 943 /* ignore unknown/unsupported struct */ 944 break; 945 } 946 pnext = pnext->pNext; 947 } 948 949 vn_encode_simple_pointer(enc, NULL); 950} 951 952static inline void 953vn_encode_VkImageMemoryRequirementsInfo2_self(struct vn_cs_encoder *enc, const VkImageMemoryRequirementsInfo2 *val) 954{ 955 /* skip val->{sType,pNext} */ 956 vn_encode_VkImage(enc, &val->image); 957} 958 959static inline void 960vn_encode_VkImageMemoryRequirementsInfo2(struct vn_cs_encoder *enc, const VkImageMemoryRequirementsInfo2 *val) 961{ 962 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2); 963 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 }); 964 vn_encode_VkImageMemoryRequirementsInfo2_pnext(enc, val->pNext); 965 vn_encode_VkImageMemoryRequirementsInfo2_self(enc, val); 966} 967 968/* struct VkImageSparseMemoryRequirementsInfo2 chain */ 969 970static inline size_t 971vn_sizeof_VkImageSparseMemoryRequirementsInfo2_pnext(const void *val) 972{ 973 /* no known/supported struct */ 974 return vn_sizeof_simple_pointer(NULL); 975} 976 977static inline size_t 978vn_sizeof_VkImageSparseMemoryRequirementsInfo2_self(const VkImageSparseMemoryRequirementsInfo2 *val) 979{ 980 size_t size = 0; 981 /* skip val->{sType,pNext} */ 982 size += vn_sizeof_VkImage(&val->image); 983 return size; 984} 985 986static inline size_t 987vn_sizeof_VkImageSparseMemoryRequirementsInfo2(const VkImageSparseMemoryRequirementsInfo2 *val) 988{ 989 size_t size = 0; 990 991 size += vn_sizeof_VkStructureType(&val->sType); 992 size += vn_sizeof_VkImageSparseMemoryRequirementsInfo2_pnext(val->pNext); 993 size += vn_sizeof_VkImageSparseMemoryRequirementsInfo2_self(val); 994 995 return size; 996} 997 998static inline void 999vn_encode_VkImageSparseMemoryRequirementsInfo2_pnext(struct vn_cs_encoder *enc, const void *val) 1000{ 1001 /* no known/supported struct */ 1002 vn_encode_simple_pointer(enc, NULL); 1003} 1004 1005static inline void 1006vn_encode_VkImageSparseMemoryRequirementsInfo2_self(struct vn_cs_encoder *enc, const VkImageSparseMemoryRequirementsInfo2 *val) 1007{ 1008 /* skip val->{sType,pNext} */ 1009 vn_encode_VkImage(enc, &val->image); 1010} 1011 1012static inline void 1013vn_encode_VkImageSparseMemoryRequirementsInfo2(struct vn_cs_encoder *enc, const VkImageSparseMemoryRequirementsInfo2 *val) 1014{ 1015 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2); 1016 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 }); 1017 vn_encode_VkImageSparseMemoryRequirementsInfo2_pnext(enc, val->pNext); 1018 vn_encode_VkImageSparseMemoryRequirementsInfo2_self(enc, val); 1019} 1020 1021/* struct VkSparseImageMemoryRequirements2 chain */ 1022 1023static inline size_t 1024vn_sizeof_VkSparseImageMemoryRequirements2_pnext(const void *val) 1025{ 1026 /* no known/supported struct */ 1027 return vn_sizeof_simple_pointer(NULL); 1028} 1029 1030static inline size_t 1031vn_sizeof_VkSparseImageMemoryRequirements2_self(const VkSparseImageMemoryRequirements2 *val) 1032{ 1033 size_t size = 0; 1034 /* skip val->{sType,pNext} */ 1035 size += vn_sizeof_VkSparseImageMemoryRequirements(&val->memoryRequirements); 1036 return size; 1037} 1038 1039static inline size_t 1040vn_sizeof_VkSparseImageMemoryRequirements2(const VkSparseImageMemoryRequirements2 *val) 1041{ 1042 size_t size = 0; 1043 1044 size += vn_sizeof_VkStructureType(&val->sType); 1045 size += vn_sizeof_VkSparseImageMemoryRequirements2_pnext(val->pNext); 1046 size += vn_sizeof_VkSparseImageMemoryRequirements2_self(val); 1047 1048 return size; 1049} 1050 1051static inline void 1052vn_decode_VkSparseImageMemoryRequirements2_pnext(struct vn_cs_decoder *dec, const void *val) 1053{ 1054 /* no known/supported struct */ 1055 if (vn_decode_simple_pointer(dec)) 1056 assert(false); 1057} 1058 1059static inline void 1060vn_decode_VkSparseImageMemoryRequirements2_self(struct vn_cs_decoder *dec, VkSparseImageMemoryRequirements2 *val) 1061{ 1062 /* skip val->{sType,pNext} */ 1063 vn_decode_VkSparseImageMemoryRequirements(dec, &val->memoryRequirements); 1064} 1065 1066static inline void 1067vn_decode_VkSparseImageMemoryRequirements2(struct vn_cs_decoder *dec, VkSparseImageMemoryRequirements2 *val) 1068{ 1069 VkStructureType stype; 1070 vn_decode_VkStructureType(dec, &stype); 1071 assert(stype == VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2); 1072 1073 assert(val->sType == stype); 1074 vn_decode_VkSparseImageMemoryRequirements2_pnext(dec, val->pNext); 1075 vn_decode_VkSparseImageMemoryRequirements2_self(dec, val); 1076} 1077 1078static inline size_t 1079vn_sizeof_VkSparseImageMemoryRequirements2_pnext_partial(const void *val) 1080{ 1081 /* no known/supported struct */ 1082 return vn_sizeof_simple_pointer(NULL); 1083} 1084 1085static inline size_t 1086vn_sizeof_VkSparseImageMemoryRequirements2_self_partial(const VkSparseImageMemoryRequirements2 *val) 1087{ 1088 size_t size = 0; 1089 /* skip val->{sType,pNext} */ 1090 size += vn_sizeof_VkSparseImageMemoryRequirements_partial(&val->memoryRequirements); 1091 return size; 1092} 1093 1094static inline size_t 1095vn_sizeof_VkSparseImageMemoryRequirements2_partial(const VkSparseImageMemoryRequirements2 *val) 1096{ 1097 size_t size = 0; 1098 1099 size += vn_sizeof_VkStructureType(&val->sType); 1100 size += vn_sizeof_VkSparseImageMemoryRequirements2_pnext_partial(val->pNext); 1101 size += vn_sizeof_VkSparseImageMemoryRequirements2_self_partial(val); 1102 1103 return size; 1104} 1105 1106static inline void 1107vn_encode_VkSparseImageMemoryRequirements2_pnext_partial(struct vn_cs_encoder *enc, const void *val) 1108{ 1109 /* no known/supported struct */ 1110 vn_encode_simple_pointer(enc, NULL); 1111} 1112 1113static inline void 1114vn_encode_VkSparseImageMemoryRequirements2_self_partial(struct vn_cs_encoder *enc, const VkSparseImageMemoryRequirements2 *val) 1115{ 1116 /* skip val->{sType,pNext} */ 1117 vn_encode_VkSparseImageMemoryRequirements_partial(enc, &val->memoryRequirements); 1118} 1119 1120static inline void 1121vn_encode_VkSparseImageMemoryRequirements2_partial(struct vn_cs_encoder *enc, const VkSparseImageMemoryRequirements2 *val) 1122{ 1123 assert(val->sType == VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2); 1124 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 }); 1125 vn_encode_VkSparseImageMemoryRequirements2_pnext_partial(enc, val->pNext); 1126 vn_encode_VkSparseImageMemoryRequirements2_self_partial(enc, val); 1127} 1128 1129/* struct VkImageDrmFormatModifierPropertiesEXT chain */ 1130 1131static inline size_t 1132vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_pnext(const void *val) 1133{ 1134 /* no known/supported struct */ 1135 return vn_sizeof_simple_pointer(NULL); 1136} 1137 1138static inline size_t 1139vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_self(const VkImageDrmFormatModifierPropertiesEXT *val) 1140{ 1141 size_t size = 0; 1142 /* skip val->{sType,pNext} */ 1143 size += vn_sizeof_uint64_t(&val->drmFormatModifier); 1144 return size; 1145} 1146 1147static inline size_t 1148vn_sizeof_VkImageDrmFormatModifierPropertiesEXT(const VkImageDrmFormatModifierPropertiesEXT *val) 1149{ 1150 size_t size = 0; 1151 1152 size += vn_sizeof_VkStructureType(&val->sType); 1153 size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_pnext(val->pNext); 1154 size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_self(val); 1155 1156 return size; 1157} 1158 1159static inline void 1160vn_decode_VkImageDrmFormatModifierPropertiesEXT_pnext(struct vn_cs_decoder *dec, const void *val) 1161{ 1162 /* no known/supported struct */ 1163 if (vn_decode_simple_pointer(dec)) 1164 assert(false); 1165} 1166 1167static inline void 1168vn_decode_VkImageDrmFormatModifierPropertiesEXT_self(struct vn_cs_decoder *dec, VkImageDrmFormatModifierPropertiesEXT *val) 1169{ 1170 /* skip val->{sType,pNext} */ 1171 vn_decode_uint64_t(dec, &val->drmFormatModifier); 1172} 1173 1174static inline void 1175vn_decode_VkImageDrmFormatModifierPropertiesEXT(struct vn_cs_decoder *dec, VkImageDrmFormatModifierPropertiesEXT *val) 1176{ 1177 VkStructureType stype; 1178 vn_decode_VkStructureType(dec, &stype); 1179 assert(stype == VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT); 1180 1181 assert(val->sType == stype); 1182 vn_decode_VkImageDrmFormatModifierPropertiesEXT_pnext(dec, val->pNext); 1183 vn_decode_VkImageDrmFormatModifierPropertiesEXT_self(dec, val); 1184} 1185 1186static inline size_t 1187vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_pnext_partial(const void *val) 1188{ 1189 /* no known/supported struct */ 1190 return vn_sizeof_simple_pointer(NULL); 1191} 1192 1193static inline size_t 1194vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_self_partial(const VkImageDrmFormatModifierPropertiesEXT *val) 1195{ 1196 size_t size = 0; 1197 /* skip val->{sType,pNext} */ 1198 /* skip val->drmFormatModifier */ 1199 return size; 1200} 1201 1202static inline size_t 1203vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_partial(const VkImageDrmFormatModifierPropertiesEXT *val) 1204{ 1205 size_t size = 0; 1206 1207 size += vn_sizeof_VkStructureType(&val->sType); 1208 size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_pnext_partial(val->pNext); 1209 size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_self_partial(val); 1210 1211 return size; 1212} 1213 1214static inline void 1215vn_encode_VkImageDrmFormatModifierPropertiesEXT_pnext_partial(struct vn_cs_encoder *enc, const void *val) 1216{ 1217 /* no known/supported struct */ 1218 vn_encode_simple_pointer(enc, NULL); 1219} 1220 1221static inline void 1222vn_encode_VkImageDrmFormatModifierPropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierPropertiesEXT *val) 1223{ 1224 /* skip val->{sType,pNext} */ 1225 /* skip val->drmFormatModifier */ 1226} 1227 1228static inline void 1229vn_encode_VkImageDrmFormatModifierPropertiesEXT_partial(struct vn_cs_encoder *enc, const VkImageDrmFormatModifierPropertiesEXT *val) 1230{ 1231 assert(val->sType == VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT); 1232 vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT }); 1233 vn_encode_VkImageDrmFormatModifierPropertiesEXT_pnext_partial(enc, val->pNext); 1234 vn_encode_VkImageDrmFormatModifierPropertiesEXT_self_partial(enc, val); 1235} 1236 1237static inline size_t vn_sizeof_vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 1238{ 1239 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements_EXT; 1240 const VkFlags cmd_flags = 0; 1241 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1242 1243 cmd_size += vn_sizeof_VkDevice(&device); 1244 cmd_size += vn_sizeof_VkImage(&image); 1245 cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements); 1246 if (pMemoryRequirements) 1247 cmd_size += vn_sizeof_VkMemoryRequirements_partial(pMemoryRequirements); 1248 1249 return cmd_size; 1250} 1251 1252static inline void vn_encode_vkGetImageMemoryRequirements(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 1253{ 1254 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements_EXT; 1255 1256 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1257 vn_encode_VkFlags(enc, &cmd_flags); 1258 1259 vn_encode_VkDevice(enc, &device); 1260 vn_encode_VkImage(enc, &image); 1261 if (vn_encode_simple_pointer(enc, pMemoryRequirements)) 1262 vn_encode_VkMemoryRequirements_partial(enc, pMemoryRequirements); 1263} 1264 1265static inline size_t vn_sizeof_vkGetImageMemoryRequirements_reply(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 1266{ 1267 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements_EXT; 1268 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1269 1270 /* skip device */ 1271 /* skip image */ 1272 cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements); 1273 if (pMemoryRequirements) 1274 cmd_size += vn_sizeof_VkMemoryRequirements(pMemoryRequirements); 1275 1276 return cmd_size; 1277} 1278 1279static inline void vn_decode_vkGetImageMemoryRequirements_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 1280{ 1281 VkCommandTypeEXT command_type; 1282 vn_decode_VkCommandTypeEXT(dec, &command_type); 1283 assert(command_type == VK_COMMAND_TYPE_vkGetImageMemoryRequirements_EXT); 1284 1285 /* skip device */ 1286 /* skip image */ 1287 if (vn_decode_simple_pointer(dec)) { 1288 vn_decode_VkMemoryRequirements(dec, pMemoryRequirements); 1289 } else { 1290 pMemoryRequirements = NULL; 1291 } 1292} 1293 1294static inline size_t vn_sizeof_vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 1295{ 1296 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory_EXT; 1297 const VkFlags cmd_flags = 0; 1298 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1299 1300 cmd_size += vn_sizeof_VkDevice(&device); 1301 cmd_size += vn_sizeof_VkImage(&image); 1302 cmd_size += vn_sizeof_VkDeviceMemory(&memory); 1303 cmd_size += vn_sizeof_VkDeviceSize(&memoryOffset); 1304 1305 return cmd_size; 1306} 1307 1308static inline void vn_encode_vkBindImageMemory(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 1309{ 1310 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory_EXT; 1311 1312 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1313 vn_encode_VkFlags(enc, &cmd_flags); 1314 1315 vn_encode_VkDevice(enc, &device); 1316 vn_encode_VkImage(enc, &image); 1317 vn_encode_VkDeviceMemory(enc, &memory); 1318 vn_encode_VkDeviceSize(enc, &memoryOffset); 1319} 1320 1321static inline size_t vn_sizeof_vkBindImageMemory_reply(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 1322{ 1323 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory_EXT; 1324 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1325 1326 VkResult ret; 1327 cmd_size += vn_sizeof_VkResult(&ret); 1328 /* skip device */ 1329 /* skip image */ 1330 /* skip memory */ 1331 /* skip memoryOffset */ 1332 1333 return cmd_size; 1334} 1335 1336static inline VkResult vn_decode_vkBindImageMemory_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 1337{ 1338 VkCommandTypeEXT command_type; 1339 vn_decode_VkCommandTypeEXT(dec, &command_type); 1340 assert(command_type == VK_COMMAND_TYPE_vkBindImageMemory_EXT); 1341 1342 VkResult ret; 1343 vn_decode_VkResult(dec, &ret); 1344 /* skip device */ 1345 /* skip image */ 1346 /* skip memory */ 1347 /* skip memoryOffset */ 1348 1349 return ret; 1350} 1351 1352static inline size_t vn_sizeof_vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 1353{ 1354 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements_EXT; 1355 const VkFlags cmd_flags = 0; 1356 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1357 1358 cmd_size += vn_sizeof_VkDevice(&device); 1359 cmd_size += vn_sizeof_VkImage(&image); 1360 cmd_size += vn_sizeof_simple_pointer(pSparseMemoryRequirementCount); 1361 if (pSparseMemoryRequirementCount) 1362 cmd_size += vn_sizeof_uint32_t(pSparseMemoryRequirementCount); 1363 if (pSparseMemoryRequirements) { 1364 cmd_size += vn_sizeof_array_size((pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1365 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1366 cmd_size += vn_sizeof_VkSparseImageMemoryRequirements_partial(&pSparseMemoryRequirements[i]); 1367 } else { 1368 cmd_size += vn_sizeof_array_size(0); 1369 } 1370 1371 return cmd_size; 1372} 1373 1374static inline void vn_encode_vkGetImageSparseMemoryRequirements(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 1375{ 1376 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements_EXT; 1377 1378 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1379 vn_encode_VkFlags(enc, &cmd_flags); 1380 1381 vn_encode_VkDevice(enc, &device); 1382 vn_encode_VkImage(enc, &image); 1383 if (vn_encode_simple_pointer(enc, pSparseMemoryRequirementCount)) 1384 vn_encode_uint32_t(enc, pSparseMemoryRequirementCount); 1385 if (pSparseMemoryRequirements) { 1386 vn_encode_array_size(enc, (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1387 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1388 vn_encode_VkSparseImageMemoryRequirements_partial(enc, &pSparseMemoryRequirements[i]); 1389 } else { 1390 vn_encode_array_size(enc, 0); 1391 } 1392} 1393 1394static inline size_t vn_sizeof_vkGetImageSparseMemoryRequirements_reply(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 1395{ 1396 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements_EXT; 1397 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1398 1399 /* skip device */ 1400 /* skip image */ 1401 cmd_size += vn_sizeof_simple_pointer(pSparseMemoryRequirementCount); 1402 if (pSparseMemoryRequirementCount) 1403 cmd_size += vn_sizeof_uint32_t(pSparseMemoryRequirementCount); 1404 if (pSparseMemoryRequirements) { 1405 cmd_size += vn_sizeof_array_size((pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1406 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1407 cmd_size += vn_sizeof_VkSparseImageMemoryRequirements(&pSparseMemoryRequirements[i]); 1408 } else { 1409 cmd_size += vn_sizeof_array_size(0); 1410 } 1411 1412 return cmd_size; 1413} 1414 1415static inline void vn_decode_vkGetImageSparseMemoryRequirements_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 1416{ 1417 VkCommandTypeEXT command_type; 1418 vn_decode_VkCommandTypeEXT(dec, &command_type); 1419 assert(command_type == VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements_EXT); 1420 1421 /* skip device */ 1422 /* skip image */ 1423 if (vn_decode_simple_pointer(dec)) { 1424 vn_decode_uint32_t(dec, pSparseMemoryRequirementCount); 1425 } else { 1426 pSparseMemoryRequirementCount = NULL; 1427 } 1428 if (vn_peek_array_size(dec)) { 1429 const uint32_t iter_count = vn_decode_array_size(dec, (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1430 for (uint32_t i = 0; i < iter_count; i++) 1431 vn_decode_VkSparseImageMemoryRequirements(dec, &pSparseMemoryRequirements[i]); 1432 } else { 1433 vn_decode_array_size_unchecked(dec); 1434 pSparseMemoryRequirements = NULL; 1435 } 1436} 1437 1438static inline size_t vn_sizeof_vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 1439{ 1440 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImage_EXT; 1441 const VkFlags cmd_flags = 0; 1442 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1443 1444 cmd_size += vn_sizeof_VkDevice(&device); 1445 cmd_size += vn_sizeof_simple_pointer(pCreateInfo); 1446 if (pCreateInfo) 1447 cmd_size += vn_sizeof_VkImageCreateInfo(pCreateInfo); 1448 cmd_size += vn_sizeof_simple_pointer(pAllocator); 1449 if (pAllocator) 1450 assert(false); 1451 cmd_size += vn_sizeof_simple_pointer(pImage); 1452 if (pImage) 1453 cmd_size += vn_sizeof_VkImage(pImage); 1454 1455 return cmd_size; 1456} 1457 1458static inline void vn_encode_vkCreateImage(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 1459{ 1460 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImage_EXT; 1461 1462 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1463 vn_encode_VkFlags(enc, &cmd_flags); 1464 1465 vn_encode_VkDevice(enc, &device); 1466 if (vn_encode_simple_pointer(enc, pCreateInfo)) 1467 vn_encode_VkImageCreateInfo(enc, pCreateInfo); 1468 if (vn_encode_simple_pointer(enc, pAllocator)) 1469 assert(false); 1470 if (vn_encode_simple_pointer(enc, pImage)) 1471 vn_encode_VkImage(enc, pImage); 1472} 1473 1474static inline size_t vn_sizeof_vkCreateImage_reply(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 1475{ 1476 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCreateImage_EXT; 1477 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1478 1479 VkResult ret; 1480 cmd_size += vn_sizeof_VkResult(&ret); 1481 /* skip device */ 1482 /* skip pCreateInfo */ 1483 /* skip pAllocator */ 1484 cmd_size += vn_sizeof_simple_pointer(pImage); 1485 if (pImage) 1486 cmd_size += vn_sizeof_VkImage(pImage); 1487 1488 return cmd_size; 1489} 1490 1491static inline VkResult vn_decode_vkCreateImage_reply(struct vn_cs_decoder *dec, VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 1492{ 1493 VkCommandTypeEXT command_type; 1494 vn_decode_VkCommandTypeEXT(dec, &command_type); 1495 assert(command_type == VK_COMMAND_TYPE_vkCreateImage_EXT); 1496 1497 VkResult ret; 1498 vn_decode_VkResult(dec, &ret); 1499 /* skip device */ 1500 /* skip pCreateInfo */ 1501 /* skip pAllocator */ 1502 if (vn_decode_simple_pointer(dec)) { 1503 vn_decode_VkImage(dec, pImage); 1504 } else { 1505 pImage = NULL; 1506 } 1507 1508 return ret; 1509} 1510 1511static inline size_t vn_sizeof_vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 1512{ 1513 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImage_EXT; 1514 const VkFlags cmd_flags = 0; 1515 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1516 1517 cmd_size += vn_sizeof_VkDevice(&device); 1518 cmd_size += vn_sizeof_VkImage(&image); 1519 cmd_size += vn_sizeof_simple_pointer(pAllocator); 1520 if (pAllocator) 1521 assert(false); 1522 1523 return cmd_size; 1524} 1525 1526static inline void vn_encode_vkDestroyImage(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 1527{ 1528 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImage_EXT; 1529 1530 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1531 vn_encode_VkFlags(enc, &cmd_flags); 1532 1533 vn_encode_VkDevice(enc, &device); 1534 vn_encode_VkImage(enc, &image); 1535 if (vn_encode_simple_pointer(enc, pAllocator)) 1536 assert(false); 1537} 1538 1539static inline size_t vn_sizeof_vkDestroyImage_reply(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 1540{ 1541 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkDestroyImage_EXT; 1542 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1543 1544 /* skip device */ 1545 /* skip image */ 1546 /* skip pAllocator */ 1547 1548 return cmd_size; 1549} 1550 1551static inline void vn_decode_vkDestroyImage_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 1552{ 1553 VkCommandTypeEXT command_type; 1554 vn_decode_VkCommandTypeEXT(dec, &command_type); 1555 assert(command_type == VK_COMMAND_TYPE_vkDestroyImage_EXT); 1556 1557 /* skip device */ 1558 /* skip image */ 1559 /* skip pAllocator */ 1560} 1561 1562static inline size_t vn_sizeof_vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 1563{ 1564 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSubresourceLayout_EXT; 1565 const VkFlags cmd_flags = 0; 1566 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1567 1568 cmd_size += vn_sizeof_VkDevice(&device); 1569 cmd_size += vn_sizeof_VkImage(&image); 1570 cmd_size += vn_sizeof_simple_pointer(pSubresource); 1571 if (pSubresource) 1572 cmd_size += vn_sizeof_VkImageSubresource(pSubresource); 1573 cmd_size += vn_sizeof_simple_pointer(pLayout); 1574 if (pLayout) 1575 cmd_size += vn_sizeof_VkSubresourceLayout_partial(pLayout); 1576 1577 return cmd_size; 1578} 1579 1580static inline void vn_encode_vkGetImageSubresourceLayout(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 1581{ 1582 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSubresourceLayout_EXT; 1583 1584 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1585 vn_encode_VkFlags(enc, &cmd_flags); 1586 1587 vn_encode_VkDevice(enc, &device); 1588 vn_encode_VkImage(enc, &image); 1589 if (vn_encode_simple_pointer(enc, pSubresource)) 1590 vn_encode_VkImageSubresource(enc, pSubresource); 1591 if (vn_encode_simple_pointer(enc, pLayout)) 1592 vn_encode_VkSubresourceLayout_partial(enc, pLayout); 1593} 1594 1595static inline size_t vn_sizeof_vkGetImageSubresourceLayout_reply(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 1596{ 1597 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSubresourceLayout_EXT; 1598 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1599 1600 /* skip device */ 1601 /* skip image */ 1602 /* skip pSubresource */ 1603 cmd_size += vn_sizeof_simple_pointer(pLayout); 1604 if (pLayout) 1605 cmd_size += vn_sizeof_VkSubresourceLayout(pLayout); 1606 1607 return cmd_size; 1608} 1609 1610static inline void vn_decode_vkGetImageSubresourceLayout_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 1611{ 1612 VkCommandTypeEXT command_type; 1613 vn_decode_VkCommandTypeEXT(dec, &command_type); 1614 assert(command_type == VK_COMMAND_TYPE_vkGetImageSubresourceLayout_EXT); 1615 1616 /* skip device */ 1617 /* skip image */ 1618 /* skip pSubresource */ 1619 if (vn_decode_simple_pointer(dec)) { 1620 vn_decode_VkSubresourceLayout(dec, pLayout); 1621 } else { 1622 pLayout = NULL; 1623 } 1624} 1625 1626static inline size_t vn_sizeof_vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 1627{ 1628 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory2_EXT; 1629 const VkFlags cmd_flags = 0; 1630 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1631 1632 cmd_size += vn_sizeof_VkDevice(&device); 1633 cmd_size += vn_sizeof_uint32_t(&bindInfoCount); 1634 if (pBindInfos) { 1635 cmd_size += vn_sizeof_array_size(bindInfoCount); 1636 for (uint32_t i = 0; i < bindInfoCount; i++) 1637 cmd_size += vn_sizeof_VkBindImageMemoryInfo(&pBindInfos[i]); 1638 } else { 1639 cmd_size += vn_sizeof_array_size(0); 1640 } 1641 1642 return cmd_size; 1643} 1644 1645static inline void vn_encode_vkBindImageMemory2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 1646{ 1647 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory2_EXT; 1648 1649 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1650 vn_encode_VkFlags(enc, &cmd_flags); 1651 1652 vn_encode_VkDevice(enc, &device); 1653 vn_encode_uint32_t(enc, &bindInfoCount); 1654 if (pBindInfos) { 1655 vn_encode_array_size(enc, bindInfoCount); 1656 for (uint32_t i = 0; i < bindInfoCount; i++) 1657 vn_encode_VkBindImageMemoryInfo(enc, &pBindInfos[i]); 1658 } else { 1659 vn_encode_array_size(enc, 0); 1660 } 1661} 1662 1663static inline size_t vn_sizeof_vkBindImageMemory2_reply(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 1664{ 1665 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkBindImageMemory2_EXT; 1666 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1667 1668 VkResult ret; 1669 cmd_size += vn_sizeof_VkResult(&ret); 1670 /* skip device */ 1671 /* skip bindInfoCount */ 1672 /* skip pBindInfos */ 1673 1674 return cmd_size; 1675} 1676 1677static inline VkResult vn_decode_vkBindImageMemory2_reply(struct vn_cs_decoder *dec, VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 1678{ 1679 VkCommandTypeEXT command_type; 1680 vn_decode_VkCommandTypeEXT(dec, &command_type); 1681 assert(command_type == VK_COMMAND_TYPE_vkBindImageMemory2_EXT); 1682 1683 VkResult ret; 1684 vn_decode_VkResult(dec, &ret); 1685 /* skip device */ 1686 /* skip bindInfoCount */ 1687 /* skip pBindInfos */ 1688 1689 return ret; 1690} 1691 1692static inline size_t vn_sizeof_vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 1693{ 1694 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements2_EXT; 1695 const VkFlags cmd_flags = 0; 1696 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1697 1698 cmd_size += vn_sizeof_VkDevice(&device); 1699 cmd_size += vn_sizeof_simple_pointer(pInfo); 1700 if (pInfo) 1701 cmd_size += vn_sizeof_VkImageMemoryRequirementsInfo2(pInfo); 1702 cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements); 1703 if (pMemoryRequirements) 1704 cmd_size += vn_sizeof_VkMemoryRequirements2_partial(pMemoryRequirements); 1705 1706 return cmd_size; 1707} 1708 1709static inline void vn_encode_vkGetImageMemoryRequirements2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 1710{ 1711 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements2_EXT; 1712 1713 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1714 vn_encode_VkFlags(enc, &cmd_flags); 1715 1716 vn_encode_VkDevice(enc, &device); 1717 if (vn_encode_simple_pointer(enc, pInfo)) 1718 vn_encode_VkImageMemoryRequirementsInfo2(enc, pInfo); 1719 if (vn_encode_simple_pointer(enc, pMemoryRequirements)) 1720 vn_encode_VkMemoryRequirements2_partial(enc, pMemoryRequirements); 1721} 1722 1723static inline size_t vn_sizeof_vkGetImageMemoryRequirements2_reply(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 1724{ 1725 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageMemoryRequirements2_EXT; 1726 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1727 1728 /* skip device */ 1729 /* skip pInfo */ 1730 cmd_size += vn_sizeof_simple_pointer(pMemoryRequirements); 1731 if (pMemoryRequirements) 1732 cmd_size += vn_sizeof_VkMemoryRequirements2(pMemoryRequirements); 1733 1734 return cmd_size; 1735} 1736 1737static inline void vn_decode_vkGetImageMemoryRequirements2_reply(struct vn_cs_decoder *dec, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 1738{ 1739 VkCommandTypeEXT command_type; 1740 vn_decode_VkCommandTypeEXT(dec, &command_type); 1741 assert(command_type == VK_COMMAND_TYPE_vkGetImageMemoryRequirements2_EXT); 1742 1743 /* skip device */ 1744 /* skip pInfo */ 1745 if (vn_decode_simple_pointer(dec)) { 1746 vn_decode_VkMemoryRequirements2(dec, pMemoryRequirements); 1747 } else { 1748 pMemoryRequirements = NULL; 1749 } 1750} 1751 1752static inline size_t vn_sizeof_vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 1753{ 1754 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements2_EXT; 1755 const VkFlags cmd_flags = 0; 1756 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1757 1758 cmd_size += vn_sizeof_VkDevice(&device); 1759 cmd_size += vn_sizeof_simple_pointer(pInfo); 1760 if (pInfo) 1761 cmd_size += vn_sizeof_VkImageSparseMemoryRequirementsInfo2(pInfo); 1762 cmd_size += vn_sizeof_simple_pointer(pSparseMemoryRequirementCount); 1763 if (pSparseMemoryRequirementCount) 1764 cmd_size += vn_sizeof_uint32_t(pSparseMemoryRequirementCount); 1765 if (pSparseMemoryRequirements) { 1766 cmd_size += vn_sizeof_array_size((pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1767 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1768 cmd_size += vn_sizeof_VkSparseImageMemoryRequirements2_partial(&pSparseMemoryRequirements[i]); 1769 } else { 1770 cmd_size += vn_sizeof_array_size(0); 1771 } 1772 1773 return cmd_size; 1774} 1775 1776static inline void vn_encode_vkGetImageSparseMemoryRequirements2(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 1777{ 1778 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements2_EXT; 1779 1780 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1781 vn_encode_VkFlags(enc, &cmd_flags); 1782 1783 vn_encode_VkDevice(enc, &device); 1784 if (vn_encode_simple_pointer(enc, pInfo)) 1785 vn_encode_VkImageSparseMemoryRequirementsInfo2(enc, pInfo); 1786 if (vn_encode_simple_pointer(enc, pSparseMemoryRequirementCount)) 1787 vn_encode_uint32_t(enc, pSparseMemoryRequirementCount); 1788 if (pSparseMemoryRequirements) { 1789 vn_encode_array_size(enc, (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1790 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1791 vn_encode_VkSparseImageMemoryRequirements2_partial(enc, &pSparseMemoryRequirements[i]); 1792 } else { 1793 vn_encode_array_size(enc, 0); 1794 } 1795} 1796 1797static inline size_t vn_sizeof_vkGetImageSparseMemoryRequirements2_reply(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 1798{ 1799 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements2_EXT; 1800 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1801 1802 /* skip device */ 1803 /* skip pInfo */ 1804 cmd_size += vn_sizeof_simple_pointer(pSparseMemoryRequirementCount); 1805 if (pSparseMemoryRequirementCount) 1806 cmd_size += vn_sizeof_uint32_t(pSparseMemoryRequirementCount); 1807 if (pSparseMemoryRequirements) { 1808 cmd_size += vn_sizeof_array_size((pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1809 for (uint32_t i = 0; i < (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0); i++) 1810 cmd_size += vn_sizeof_VkSparseImageMemoryRequirements2(&pSparseMemoryRequirements[i]); 1811 } else { 1812 cmd_size += vn_sizeof_array_size(0); 1813 } 1814 1815 return cmd_size; 1816} 1817 1818static inline void vn_decode_vkGetImageSparseMemoryRequirements2_reply(struct vn_cs_decoder *dec, VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 1819{ 1820 VkCommandTypeEXT command_type; 1821 vn_decode_VkCommandTypeEXT(dec, &command_type); 1822 assert(command_type == VK_COMMAND_TYPE_vkGetImageSparseMemoryRequirements2_EXT); 1823 1824 /* skip device */ 1825 /* skip pInfo */ 1826 if (vn_decode_simple_pointer(dec)) { 1827 vn_decode_uint32_t(dec, pSparseMemoryRequirementCount); 1828 } else { 1829 pSparseMemoryRequirementCount = NULL; 1830 } 1831 if (vn_peek_array_size(dec)) { 1832 const uint32_t iter_count = vn_decode_array_size(dec, (pSparseMemoryRequirementCount ? *pSparseMemoryRequirementCount : 0)); 1833 for (uint32_t i = 0; i < iter_count; i++) 1834 vn_decode_VkSparseImageMemoryRequirements2(dec, &pSparseMemoryRequirements[i]); 1835 } else { 1836 vn_decode_array_size_unchecked(dec); 1837 pSparseMemoryRequirements = NULL; 1838 } 1839} 1840 1841static inline size_t vn_sizeof_vkGetImageDrmFormatModifierPropertiesEXT(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 1842{ 1843 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT; 1844 const VkFlags cmd_flags = 0; 1845 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); 1846 1847 cmd_size += vn_sizeof_VkDevice(&device); 1848 cmd_size += vn_sizeof_VkImage(&image); 1849 cmd_size += vn_sizeof_simple_pointer(pProperties); 1850 if (pProperties) 1851 cmd_size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT_partial(pProperties); 1852 1853 return cmd_size; 1854} 1855 1856static inline void vn_encode_vkGetImageDrmFormatModifierPropertiesEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 1857{ 1858 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT; 1859 1860 vn_encode_VkCommandTypeEXT(enc, &cmd_type); 1861 vn_encode_VkFlags(enc, &cmd_flags); 1862 1863 vn_encode_VkDevice(enc, &device); 1864 vn_encode_VkImage(enc, &image); 1865 if (vn_encode_simple_pointer(enc, pProperties)) 1866 vn_encode_VkImageDrmFormatModifierPropertiesEXT_partial(enc, pProperties); 1867} 1868 1869static inline size_t vn_sizeof_vkGetImageDrmFormatModifierPropertiesEXT_reply(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 1870{ 1871 const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT; 1872 size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); 1873 1874 VkResult ret; 1875 cmd_size += vn_sizeof_VkResult(&ret); 1876 /* skip device */ 1877 /* skip image */ 1878 cmd_size += vn_sizeof_simple_pointer(pProperties); 1879 if (pProperties) 1880 cmd_size += vn_sizeof_VkImageDrmFormatModifierPropertiesEXT(pProperties); 1881 1882 return cmd_size; 1883} 1884 1885static inline VkResult vn_decode_vkGetImageDrmFormatModifierPropertiesEXT_reply(struct vn_cs_decoder *dec, VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 1886{ 1887 VkCommandTypeEXT command_type; 1888 vn_decode_VkCommandTypeEXT(dec, &command_type); 1889 assert(command_type == VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT); 1890 1891 VkResult ret; 1892 vn_decode_VkResult(dec, &ret); 1893 /* skip device */ 1894 /* skip image */ 1895 if (vn_decode_simple_pointer(dec)) { 1896 vn_decode_VkImageDrmFormatModifierPropertiesEXT(dec, pProperties); 1897 } else { 1898 pProperties = NULL; 1899 } 1900 1901 return ret; 1902} 1903 1904static inline void vn_submit_vkGetImageMemoryRequirements(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements, struct vn_instance_submit_command *submit) 1905{ 1906 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 1907 void *cmd_data = local_cmd_data; 1908 size_t cmd_size = vn_sizeof_vkGetImageMemoryRequirements(device, image, pMemoryRequirements); 1909 if (cmd_size > sizeof(local_cmd_data)) { 1910 cmd_data = malloc(cmd_size); 1911 if (!cmd_data) 1912 cmd_size = 0; 1913 } 1914 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageMemoryRequirements_reply(device, image, pMemoryRequirements) : 0; 1915 1916 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 1917 if (cmd_size) { 1918 vn_encode_vkGetImageMemoryRequirements(enc, cmd_flags, device, image, pMemoryRequirements); 1919 vn_instance_submit_command(vn_instance, submit); 1920 if (cmd_data != local_cmd_data) 1921 free(cmd_data); 1922 } 1923} 1924 1925static inline void vn_submit_vkBindImageMemory(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset, struct vn_instance_submit_command *submit) 1926{ 1927 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 1928 void *cmd_data = local_cmd_data; 1929 size_t cmd_size = vn_sizeof_vkBindImageMemory(device, image, memory, memoryOffset); 1930 if (cmd_size > sizeof(local_cmd_data)) { 1931 cmd_data = malloc(cmd_size); 1932 if (!cmd_data) 1933 cmd_size = 0; 1934 } 1935 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkBindImageMemory_reply(device, image, memory, memoryOffset) : 0; 1936 1937 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 1938 if (cmd_size) { 1939 vn_encode_vkBindImageMemory(enc, cmd_flags, device, image, memory, memoryOffset); 1940 vn_instance_submit_command(vn_instance, submit); 1941 if (cmd_data != local_cmd_data) 1942 free(cmd_data); 1943 } 1944} 1945 1946static inline void vn_submit_vkGetImageSparseMemoryRequirements(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, struct vn_instance_submit_command *submit) 1947{ 1948 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 1949 void *cmd_data = local_cmd_data; 1950 size_t cmd_size = vn_sizeof_vkGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 1951 if (cmd_size > sizeof(local_cmd_data)) { 1952 cmd_data = malloc(cmd_size); 1953 if (!cmd_data) 1954 cmd_size = 0; 1955 } 1956 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageSparseMemoryRequirements_reply(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements) : 0; 1957 1958 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 1959 if (cmd_size) { 1960 vn_encode_vkGetImageSparseMemoryRequirements(enc, cmd_flags, device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 1961 vn_instance_submit_command(vn_instance, submit); 1962 if (cmd_data != local_cmd_data) 1963 free(cmd_data); 1964 } 1965} 1966 1967static inline void vn_submit_vkCreateImage(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage, struct vn_instance_submit_command *submit) 1968{ 1969 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 1970 void *cmd_data = local_cmd_data; 1971 size_t cmd_size = vn_sizeof_vkCreateImage(device, pCreateInfo, pAllocator, pImage); 1972 if (cmd_size > sizeof(local_cmd_data)) { 1973 cmd_data = malloc(cmd_size); 1974 if (!cmd_data) 1975 cmd_size = 0; 1976 } 1977 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCreateImage_reply(device, pCreateInfo, pAllocator, pImage) : 0; 1978 1979 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 1980 if (cmd_size) { 1981 vn_encode_vkCreateImage(enc, cmd_flags, device, pCreateInfo, pAllocator, pImage); 1982 vn_instance_submit_command(vn_instance, submit); 1983 if (cmd_data != local_cmd_data) 1984 free(cmd_data); 1985 } 1986} 1987 1988static inline void vn_submit_vkDestroyImage(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator, struct vn_instance_submit_command *submit) 1989{ 1990 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 1991 void *cmd_data = local_cmd_data; 1992 size_t cmd_size = vn_sizeof_vkDestroyImage(device, image, pAllocator); 1993 if (cmd_size > sizeof(local_cmd_data)) { 1994 cmd_data = malloc(cmd_size); 1995 if (!cmd_data) 1996 cmd_size = 0; 1997 } 1998 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkDestroyImage_reply(device, image, pAllocator) : 0; 1999 2000 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2001 if (cmd_size) { 2002 vn_encode_vkDestroyImage(enc, cmd_flags, device, image, pAllocator); 2003 vn_instance_submit_command(vn_instance, submit); 2004 if (cmd_data != local_cmd_data) 2005 free(cmd_data); 2006 } 2007} 2008 2009static inline void vn_submit_vkGetImageSubresourceLayout(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout, struct vn_instance_submit_command *submit) 2010{ 2011 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 2012 void *cmd_data = local_cmd_data; 2013 size_t cmd_size = vn_sizeof_vkGetImageSubresourceLayout(device, image, pSubresource, pLayout); 2014 if (cmd_size > sizeof(local_cmd_data)) { 2015 cmd_data = malloc(cmd_size); 2016 if (!cmd_data) 2017 cmd_size = 0; 2018 } 2019 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageSubresourceLayout_reply(device, image, pSubresource, pLayout) : 0; 2020 2021 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2022 if (cmd_size) { 2023 vn_encode_vkGetImageSubresourceLayout(enc, cmd_flags, device, image, pSubresource, pLayout); 2024 vn_instance_submit_command(vn_instance, submit); 2025 if (cmd_data != local_cmd_data) 2026 free(cmd_data); 2027 } 2028} 2029 2030static inline void vn_submit_vkBindImageMemory2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos, struct vn_instance_submit_command *submit) 2031{ 2032 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 2033 void *cmd_data = local_cmd_data; 2034 size_t cmd_size = vn_sizeof_vkBindImageMemory2(device, bindInfoCount, pBindInfos); 2035 if (cmd_size > sizeof(local_cmd_data)) { 2036 cmd_data = malloc(cmd_size); 2037 if (!cmd_data) 2038 cmd_size = 0; 2039 } 2040 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkBindImageMemory2_reply(device, bindInfoCount, pBindInfos) : 0; 2041 2042 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2043 if (cmd_size) { 2044 vn_encode_vkBindImageMemory2(enc, cmd_flags, device, bindInfoCount, pBindInfos); 2045 vn_instance_submit_command(vn_instance, submit); 2046 if (cmd_data != local_cmd_data) 2047 free(cmd_data); 2048 } 2049} 2050 2051static inline void vn_submit_vkGetImageMemoryRequirements2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements, struct vn_instance_submit_command *submit) 2052{ 2053 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 2054 void *cmd_data = local_cmd_data; 2055 size_t cmd_size = vn_sizeof_vkGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements); 2056 if (cmd_size > sizeof(local_cmd_data)) { 2057 cmd_data = malloc(cmd_size); 2058 if (!cmd_data) 2059 cmd_size = 0; 2060 } 2061 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageMemoryRequirements2_reply(device, pInfo, pMemoryRequirements) : 0; 2062 2063 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2064 if (cmd_size) { 2065 vn_encode_vkGetImageMemoryRequirements2(enc, cmd_flags, device, pInfo, pMemoryRequirements); 2066 vn_instance_submit_command(vn_instance, submit); 2067 if (cmd_data != local_cmd_data) 2068 free(cmd_data); 2069 } 2070} 2071 2072static inline void vn_submit_vkGetImageSparseMemoryRequirements2(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, struct vn_instance_submit_command *submit) 2073{ 2074 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 2075 void *cmd_data = local_cmd_data; 2076 size_t cmd_size = vn_sizeof_vkGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 2077 if (cmd_size > sizeof(local_cmd_data)) { 2078 cmd_data = malloc(cmd_size); 2079 if (!cmd_data) 2080 cmd_size = 0; 2081 } 2082 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageSparseMemoryRequirements2_reply(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements) : 0; 2083 2084 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2085 if (cmd_size) { 2086 vn_encode_vkGetImageSparseMemoryRequirements2(enc, cmd_flags, device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 2087 vn_instance_submit_command(vn_instance, submit); 2088 if (cmd_data != local_cmd_data) 2089 free(cmd_data); 2090 } 2091} 2092 2093static inline void vn_submit_vkGetImageDrmFormatModifierPropertiesEXT(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties, struct vn_instance_submit_command *submit) 2094{ 2095 uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; 2096 void *cmd_data = local_cmd_data; 2097 size_t cmd_size = vn_sizeof_vkGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties); 2098 if (cmd_size > sizeof(local_cmd_data)) { 2099 cmd_data = malloc(cmd_size); 2100 if (!cmd_data) 2101 cmd_size = 0; 2102 } 2103 const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetImageDrmFormatModifierPropertiesEXT_reply(device, image, pProperties) : 0; 2104 2105 struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); 2106 if (cmd_size) { 2107 vn_encode_vkGetImageDrmFormatModifierPropertiesEXT(enc, cmd_flags, device, image, pProperties); 2108 vn_instance_submit_command(vn_instance, submit); 2109 if (cmd_data != local_cmd_data) 2110 free(cmd_data); 2111 } 2112} 2113 2114static inline void vn_call_vkGetImageMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 2115{ 2116 VN_TRACE_FUNC(); 2117 2118 struct vn_instance_submit_command submit; 2119 vn_submit_vkGetImageMemoryRequirements(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, pMemoryRequirements, &submit); 2120 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2121 if (dec) { 2122 vn_decode_vkGetImageMemoryRequirements_reply(dec, device, image, pMemoryRequirements); 2123 vn_instance_free_command_reply(vn_instance, &submit); 2124 } 2125} 2126 2127static inline void vn_async_vkGetImageMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) 2128{ 2129 struct vn_instance_submit_command submit; 2130 vn_submit_vkGetImageMemoryRequirements(vn_instance, 0, device, image, pMemoryRequirements, &submit); 2131} 2132 2133static inline VkResult vn_call_vkBindImageMemory(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 2134{ 2135 VN_TRACE_FUNC(); 2136 2137 struct vn_instance_submit_command submit; 2138 vn_submit_vkBindImageMemory(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, memory, memoryOffset, &submit); 2139 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2140 if (dec) { 2141 const VkResult ret = vn_decode_vkBindImageMemory_reply(dec, device, image, memory, memoryOffset); 2142 vn_instance_free_command_reply(vn_instance, &submit); 2143 return ret; 2144 } else { 2145 return VK_ERROR_OUT_OF_HOST_MEMORY; 2146 } 2147} 2148 2149static inline void vn_async_vkBindImageMemory(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) 2150{ 2151 struct vn_instance_submit_command submit; 2152 vn_submit_vkBindImageMemory(vn_instance, 0, device, image, memory, memoryOffset, &submit); 2153} 2154 2155static inline void vn_call_vkGetImageSparseMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 2156{ 2157 VN_TRACE_FUNC(); 2158 2159 struct vn_instance_submit_command submit; 2160 vn_submit_vkGetImageSparseMemoryRequirements(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements, &submit); 2161 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2162 if (dec) { 2163 vn_decode_vkGetImageSparseMemoryRequirements_reply(dec, device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 2164 vn_instance_free_command_reply(vn_instance, &submit); 2165 } 2166} 2167 2168static inline void vn_async_vkGetImageSparseMemoryRequirements(struct vn_instance *vn_instance, VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) 2169{ 2170 struct vn_instance_submit_command submit; 2171 vn_submit_vkGetImageSparseMemoryRequirements(vn_instance, 0, device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements, &submit); 2172} 2173 2174static inline VkResult vn_call_vkCreateImage(struct vn_instance *vn_instance, VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 2175{ 2176 VN_TRACE_FUNC(); 2177 2178 struct vn_instance_submit_command submit; 2179 vn_submit_vkCreateImage(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pCreateInfo, pAllocator, pImage, &submit); 2180 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2181 if (dec) { 2182 const VkResult ret = vn_decode_vkCreateImage_reply(dec, device, pCreateInfo, pAllocator, pImage); 2183 vn_instance_free_command_reply(vn_instance, &submit); 2184 return ret; 2185 } else { 2186 return VK_ERROR_OUT_OF_HOST_MEMORY; 2187 } 2188} 2189 2190static inline void vn_async_vkCreateImage(struct vn_instance *vn_instance, VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) 2191{ 2192 struct vn_instance_submit_command submit; 2193 vn_submit_vkCreateImage(vn_instance, 0, device, pCreateInfo, pAllocator, pImage, &submit); 2194} 2195 2196static inline void vn_call_vkDestroyImage(struct vn_instance *vn_instance, VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 2197{ 2198 VN_TRACE_FUNC(); 2199 2200 struct vn_instance_submit_command submit; 2201 vn_submit_vkDestroyImage(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, pAllocator, &submit); 2202 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2203 if (dec) { 2204 vn_decode_vkDestroyImage_reply(dec, device, image, pAllocator); 2205 vn_instance_free_command_reply(vn_instance, &submit); 2206 } 2207} 2208 2209static inline void vn_async_vkDestroyImage(struct vn_instance *vn_instance, VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) 2210{ 2211 struct vn_instance_submit_command submit; 2212 vn_submit_vkDestroyImage(vn_instance, 0, device, image, pAllocator, &submit); 2213} 2214 2215static inline void vn_call_vkGetImageSubresourceLayout(struct vn_instance *vn_instance, VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 2216{ 2217 VN_TRACE_FUNC(); 2218 2219 struct vn_instance_submit_command submit; 2220 vn_submit_vkGetImageSubresourceLayout(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, pSubresource, pLayout, &submit); 2221 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2222 if (dec) { 2223 vn_decode_vkGetImageSubresourceLayout_reply(dec, device, image, pSubresource, pLayout); 2224 vn_instance_free_command_reply(vn_instance, &submit); 2225 } 2226} 2227 2228static inline void vn_async_vkGetImageSubresourceLayout(struct vn_instance *vn_instance, VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) 2229{ 2230 struct vn_instance_submit_command submit; 2231 vn_submit_vkGetImageSubresourceLayout(vn_instance, 0, device, image, pSubresource, pLayout, &submit); 2232} 2233 2234static inline VkResult vn_call_vkBindImageMemory2(struct vn_instance *vn_instance, VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 2235{ 2236 VN_TRACE_FUNC(); 2237 2238 struct vn_instance_submit_command submit; 2239 vn_submit_vkBindImageMemory2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, bindInfoCount, pBindInfos, &submit); 2240 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2241 if (dec) { 2242 const VkResult ret = vn_decode_vkBindImageMemory2_reply(dec, device, bindInfoCount, pBindInfos); 2243 vn_instance_free_command_reply(vn_instance, &submit); 2244 return ret; 2245 } else { 2246 return VK_ERROR_OUT_OF_HOST_MEMORY; 2247 } 2248} 2249 2250static inline void vn_async_vkBindImageMemory2(struct vn_instance *vn_instance, VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) 2251{ 2252 struct vn_instance_submit_command submit; 2253 vn_submit_vkBindImageMemory2(vn_instance, 0, device, bindInfoCount, pBindInfos, &submit); 2254} 2255 2256static inline void vn_call_vkGetImageMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 2257{ 2258 VN_TRACE_FUNC(); 2259 2260 struct vn_instance_submit_command submit; 2261 vn_submit_vkGetImageMemoryRequirements2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, pMemoryRequirements, &submit); 2262 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2263 if (dec) { 2264 vn_decode_vkGetImageMemoryRequirements2_reply(dec, device, pInfo, pMemoryRequirements); 2265 vn_instance_free_command_reply(vn_instance, &submit); 2266 } 2267} 2268 2269static inline void vn_async_vkGetImageMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) 2270{ 2271 struct vn_instance_submit_command submit; 2272 vn_submit_vkGetImageMemoryRequirements2(vn_instance, 0, device, pInfo, pMemoryRequirements, &submit); 2273} 2274 2275static inline void vn_call_vkGetImageSparseMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 2276{ 2277 VN_TRACE_FUNC(); 2278 2279 struct vn_instance_submit_command submit; 2280 vn_submit_vkGetImageSparseMemoryRequirements2(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements, &submit); 2281 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2282 if (dec) { 2283 vn_decode_vkGetImageSparseMemoryRequirements2_reply(dec, device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); 2284 vn_instance_free_command_reply(vn_instance, &submit); 2285 } 2286} 2287 2288static inline void vn_async_vkGetImageSparseMemoryRequirements2(struct vn_instance *vn_instance, VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) 2289{ 2290 struct vn_instance_submit_command submit; 2291 vn_submit_vkGetImageSparseMemoryRequirements2(vn_instance, 0, device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements, &submit); 2292} 2293 2294static inline VkResult vn_call_vkGetImageDrmFormatModifierPropertiesEXT(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 2295{ 2296 VN_TRACE_FUNC(); 2297 2298 struct vn_instance_submit_command submit; 2299 vn_submit_vkGetImageDrmFormatModifierPropertiesEXT(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, image, pProperties, &submit); 2300 struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); 2301 if (dec) { 2302 const VkResult ret = vn_decode_vkGetImageDrmFormatModifierPropertiesEXT_reply(dec, device, image, pProperties); 2303 vn_instance_free_command_reply(vn_instance, &submit); 2304 return ret; 2305 } else { 2306 return VK_ERROR_OUT_OF_HOST_MEMORY; 2307 } 2308} 2309 2310static inline void vn_async_vkGetImageDrmFormatModifierPropertiesEXT(struct vn_instance *vn_instance, VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) 2311{ 2312 struct vn_instance_submit_command submit; 2313 vn_submit_vkGetImageDrmFormatModifierPropertiesEXT(vn_instance, 0, device, image, pProperties, &submit); 2314} 2315 2316#endif /* VN_PROTOCOL_DRIVER_IMAGE_H */ 2317