• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2018 The Android Open Source Project
2 // Copyright (C) 2018 Google Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 // Autogenerated module goldfish_vk_deepcopy_guest
17 //
18 // (impl) generated by scripts/genvk.py -registry ../../vulkan/registry/vk.xml -registryGfxstream
19 // xml/vk_gfxstream.xml cereal -o /tmp/
20 //
21 // Please do not modify directly;
22 // re-run mesa3d/src/gfxstream/codegen/generate-gfxstream-vulkan.sh,
23 // or directly from Python by defining:
24 // VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
25 // VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
26 // CEREAL_OUTPUT_DIR: Where to put the generated sources.
27 //
28 // python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
29 // $CEREAL_OUTPUT_DIR
30 //
31 
32 #include "goldfish_vk_deepcopy_guest.h"
33 
34 #include <cstring>
35 
36 #include "goldfish_vk_extension_structs_guest.h"
37 #include "goldfish_vk_private_defs.h"
38 #include "vk_util.h"
39 
40 namespace gfxstream {
41 namespace vk {
42 
43 void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
44                                const void* structExtension, void* structExtension_out);
45 
46 #ifdef VK_VERSION_1_0
deepcopy_VkExtent2D(Allocator * alloc,VkStructureType rootType,const VkExtent2D * from,VkExtent2D * to)47 void deepcopy_VkExtent2D(Allocator* alloc, VkStructureType rootType, const VkExtent2D* from,
48                          VkExtent2D* to) {
49     (void)alloc;
50     (void)rootType;
51     *to = *from;
52 }
53 
deepcopy_VkExtent3D(Allocator * alloc,VkStructureType rootType,const VkExtent3D * from,VkExtent3D * to)54 void deepcopy_VkExtent3D(Allocator* alloc, VkStructureType rootType, const VkExtent3D* from,
55                          VkExtent3D* to) {
56     (void)alloc;
57     (void)rootType;
58     *to = *from;
59 }
60 
deepcopy_VkOffset2D(Allocator * alloc,VkStructureType rootType,const VkOffset2D * from,VkOffset2D * to)61 void deepcopy_VkOffset2D(Allocator* alloc, VkStructureType rootType, const VkOffset2D* from,
62                          VkOffset2D* to) {
63     (void)alloc;
64     (void)rootType;
65     *to = *from;
66 }
67 
deepcopy_VkOffset3D(Allocator * alloc,VkStructureType rootType,const VkOffset3D * from,VkOffset3D * to)68 void deepcopy_VkOffset3D(Allocator* alloc, VkStructureType rootType, const VkOffset3D* from,
69                          VkOffset3D* to) {
70     (void)alloc;
71     (void)rootType;
72     *to = *from;
73 }
74 
deepcopy_VkRect2D(Allocator * alloc,VkStructureType rootType,const VkRect2D * from,VkRect2D * to)75 void deepcopy_VkRect2D(Allocator* alloc, VkStructureType rootType, const VkRect2D* from,
76                        VkRect2D* to) {
77     (void)alloc;
78     (void)rootType;
79     *to = *from;
80     deepcopy_VkOffset2D(alloc, rootType, &from->offset, (VkOffset2D*)(&to->offset));
81     deepcopy_VkExtent2D(alloc, rootType, &from->extent, (VkExtent2D*)(&to->extent));
82 }
83 
deepcopy_VkBaseInStructure(Allocator * alloc,VkStructureType rootType,const VkBaseInStructure * from,VkBaseInStructure * to)84 void deepcopy_VkBaseInStructure(Allocator* alloc, VkStructureType rootType,
85                                 const VkBaseInStructure* from, VkBaseInStructure* to) {
86     (void)alloc;
87     (void)rootType;
88     *to = *from;
89     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
90         rootType = from->sType;
91     }
92     const void* from_pNext = from;
93     size_t pNext_size = 0u;
94     while (!pNext_size && from_pNext) {
95         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
96         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
97     }
98     to->pNext = nullptr;
99     if (pNext_size) {
100         to->pNext = (VkBaseInStructure*)alloc->alloc(pNext_size);
101         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
102     }
103 }
104 
deepcopy_VkBaseOutStructure(Allocator * alloc,VkStructureType rootType,const VkBaseOutStructure * from,VkBaseOutStructure * to)105 void deepcopy_VkBaseOutStructure(Allocator* alloc, VkStructureType rootType,
106                                  const VkBaseOutStructure* from, VkBaseOutStructure* to) {
107     (void)alloc;
108     (void)rootType;
109     *to = *from;
110     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
111         rootType = from->sType;
112     }
113     const void* from_pNext = from;
114     size_t pNext_size = 0u;
115     while (!pNext_size && from_pNext) {
116         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
117         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
118     }
119     to->pNext = nullptr;
120     if (pNext_size) {
121         to->pNext = (VkBaseOutStructure*)alloc->alloc(pNext_size);
122         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
123     }
124 }
125 
deepcopy_VkBufferMemoryBarrier(Allocator * alloc,VkStructureType rootType,const VkBufferMemoryBarrier * from,VkBufferMemoryBarrier * to)126 void deepcopy_VkBufferMemoryBarrier(Allocator* alloc, VkStructureType rootType,
127                                     const VkBufferMemoryBarrier* from, VkBufferMemoryBarrier* to) {
128     (void)alloc;
129     (void)rootType;
130     *to = *from;
131     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
132         rootType = from->sType;
133     }
134     const void* from_pNext = from;
135     size_t pNext_size = 0u;
136     while (!pNext_size && from_pNext) {
137         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
138         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
139     }
140     to->pNext = nullptr;
141     if (pNext_size) {
142         to->pNext = (void*)alloc->alloc(pNext_size);
143         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
144     }
145 }
146 
deepcopy_VkDispatchIndirectCommand(Allocator * alloc,VkStructureType rootType,const VkDispatchIndirectCommand * from,VkDispatchIndirectCommand * to)147 void deepcopy_VkDispatchIndirectCommand(Allocator* alloc, VkStructureType rootType,
148                                         const VkDispatchIndirectCommand* from,
149                                         VkDispatchIndirectCommand* to) {
150     (void)alloc;
151     (void)rootType;
152     *to = *from;
153 }
154 
deepcopy_VkDrawIndexedIndirectCommand(Allocator * alloc,VkStructureType rootType,const VkDrawIndexedIndirectCommand * from,VkDrawIndexedIndirectCommand * to)155 void deepcopy_VkDrawIndexedIndirectCommand(Allocator* alloc, VkStructureType rootType,
156                                            const VkDrawIndexedIndirectCommand* from,
157                                            VkDrawIndexedIndirectCommand* to) {
158     (void)alloc;
159     (void)rootType;
160     *to = *from;
161 }
162 
deepcopy_VkDrawIndirectCommand(Allocator * alloc,VkStructureType rootType,const VkDrawIndirectCommand * from,VkDrawIndirectCommand * to)163 void deepcopy_VkDrawIndirectCommand(Allocator* alloc, VkStructureType rootType,
164                                     const VkDrawIndirectCommand* from, VkDrawIndirectCommand* to) {
165     (void)alloc;
166     (void)rootType;
167     *to = *from;
168 }
169 
deepcopy_VkImageSubresourceRange(Allocator * alloc,VkStructureType rootType,const VkImageSubresourceRange * from,VkImageSubresourceRange * to)170 void deepcopy_VkImageSubresourceRange(Allocator* alloc, VkStructureType rootType,
171                                       const VkImageSubresourceRange* from,
172                                       VkImageSubresourceRange* to) {
173     (void)alloc;
174     (void)rootType;
175     *to = *from;
176 }
177 
deepcopy_VkImageMemoryBarrier(Allocator * alloc,VkStructureType rootType,const VkImageMemoryBarrier * from,VkImageMemoryBarrier * to)178 void deepcopy_VkImageMemoryBarrier(Allocator* alloc, VkStructureType rootType,
179                                    const VkImageMemoryBarrier* from, VkImageMemoryBarrier* to) {
180     (void)alloc;
181     (void)rootType;
182     *to = *from;
183     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
184         rootType = from->sType;
185     }
186     const void* from_pNext = from;
187     size_t pNext_size = 0u;
188     while (!pNext_size && from_pNext) {
189         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
190         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
191     }
192     to->pNext = nullptr;
193     if (pNext_size) {
194         to->pNext = (void*)alloc->alloc(pNext_size);
195         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
196     }
197     deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
198                                      (VkImageSubresourceRange*)(&to->subresourceRange));
199 }
200 
deepcopy_VkMemoryBarrier(Allocator * alloc,VkStructureType rootType,const VkMemoryBarrier * from,VkMemoryBarrier * to)201 void deepcopy_VkMemoryBarrier(Allocator* alloc, VkStructureType rootType,
202                               const VkMemoryBarrier* from, VkMemoryBarrier* to) {
203     (void)alloc;
204     (void)rootType;
205     *to = *from;
206     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
207         rootType = from->sType;
208     }
209     const void* from_pNext = from;
210     size_t pNext_size = 0u;
211     while (!pNext_size && from_pNext) {
212         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
213         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
214     }
215     to->pNext = nullptr;
216     if (pNext_size) {
217         to->pNext = (void*)alloc->alloc(pNext_size);
218         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
219     }
220 }
221 
deepcopy_VkPipelineCacheHeaderVersionOne(Allocator * alloc,VkStructureType rootType,const VkPipelineCacheHeaderVersionOne * from,VkPipelineCacheHeaderVersionOne * to)222 void deepcopy_VkPipelineCacheHeaderVersionOne(Allocator* alloc, VkStructureType rootType,
223                                               const VkPipelineCacheHeaderVersionOne* from,
224                                               VkPipelineCacheHeaderVersionOne* to) {
225     (void)alloc;
226     (void)rootType;
227     *to = *from;
228     memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
229 }
230 
deepcopy_VkAllocationCallbacks(Allocator * alloc,VkStructureType rootType,const VkAllocationCallbacks * from,VkAllocationCallbacks * to)231 void deepcopy_VkAllocationCallbacks(Allocator* alloc, VkStructureType rootType,
232                                     const VkAllocationCallbacks* from, VkAllocationCallbacks* to) {
233     (void)alloc;
234     (void)rootType;
235     *to = *from;
236     to->pUserData = nullptr;
237     if (from->pUserData) {
238         to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
239     }
240 }
241 
deepcopy_VkApplicationInfo(Allocator * alloc,VkStructureType rootType,const VkApplicationInfo * from,VkApplicationInfo * to)242 void deepcopy_VkApplicationInfo(Allocator* alloc, VkStructureType rootType,
243                                 const VkApplicationInfo* from, VkApplicationInfo* to) {
244     (void)alloc;
245     (void)rootType;
246     *to = *from;
247     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
248         rootType = from->sType;
249     }
250     const void* from_pNext = from;
251     size_t pNext_size = 0u;
252     while (!pNext_size && from_pNext) {
253         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
254         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
255     }
256     to->pNext = nullptr;
257     if (pNext_size) {
258         to->pNext = (void*)alloc->alloc(pNext_size);
259         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
260     }
261     to->pApplicationName = nullptr;
262     if (from->pApplicationName) {
263         to->pApplicationName = alloc->strDup(from->pApplicationName);
264     }
265     to->pEngineName = nullptr;
266     if (from->pEngineName) {
267         to->pEngineName = alloc->strDup(from->pEngineName);
268     }
269 }
270 
deepcopy_VkFormatProperties(Allocator * alloc,VkStructureType rootType,const VkFormatProperties * from,VkFormatProperties * to)271 void deepcopy_VkFormatProperties(Allocator* alloc, VkStructureType rootType,
272                                  const VkFormatProperties* from, VkFormatProperties* to) {
273     (void)alloc;
274     (void)rootType;
275     *to = *from;
276 }
277 
deepcopy_VkImageFormatProperties(Allocator * alloc,VkStructureType rootType,const VkImageFormatProperties * from,VkImageFormatProperties * to)278 void deepcopy_VkImageFormatProperties(Allocator* alloc, VkStructureType rootType,
279                                       const VkImageFormatProperties* from,
280                                       VkImageFormatProperties* to) {
281     (void)alloc;
282     (void)rootType;
283     *to = *from;
284     deepcopy_VkExtent3D(alloc, rootType, &from->maxExtent, (VkExtent3D*)(&to->maxExtent));
285 }
286 
deepcopy_VkInstanceCreateInfo(Allocator * alloc,VkStructureType rootType,const VkInstanceCreateInfo * from,VkInstanceCreateInfo * to)287 void deepcopy_VkInstanceCreateInfo(Allocator* alloc, VkStructureType rootType,
288                                    const VkInstanceCreateInfo* from, VkInstanceCreateInfo* to) {
289     (void)alloc;
290     (void)rootType;
291     *to = *from;
292     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
293         rootType = from->sType;
294     }
295     const void* from_pNext = from;
296     size_t pNext_size = 0u;
297     while (!pNext_size && from_pNext) {
298         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
299         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
300     }
301     to->pNext = nullptr;
302     if (pNext_size) {
303         to->pNext = (void*)alloc->alloc(pNext_size);
304         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
305     }
306     to->pApplicationInfo = nullptr;
307     if (from->pApplicationInfo) {
308         to->pApplicationInfo = (VkApplicationInfo*)alloc->alloc(sizeof(const VkApplicationInfo));
309         deepcopy_VkApplicationInfo(alloc, rootType, from->pApplicationInfo,
310                                    (VkApplicationInfo*)(to->pApplicationInfo));
311     }
312     to->ppEnabledLayerNames = nullptr;
313     if (from->ppEnabledLayerNames && from->enabledLayerCount) {
314         to->ppEnabledLayerNames =
315             alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
316     }
317     to->ppEnabledExtensionNames = nullptr;
318     if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
319         to->ppEnabledExtensionNames =
320             alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
321     }
322 }
323 
deepcopy_VkMemoryHeap(Allocator * alloc,VkStructureType rootType,const VkMemoryHeap * from,VkMemoryHeap * to)324 void deepcopy_VkMemoryHeap(Allocator* alloc, VkStructureType rootType, const VkMemoryHeap* from,
325                            VkMemoryHeap* to) {
326     (void)alloc;
327     (void)rootType;
328     *to = *from;
329 }
330 
deepcopy_VkMemoryType(Allocator * alloc,VkStructureType rootType,const VkMemoryType * from,VkMemoryType * to)331 void deepcopy_VkMemoryType(Allocator* alloc, VkStructureType rootType, const VkMemoryType* from,
332                            VkMemoryType* to) {
333     (void)alloc;
334     (void)rootType;
335     *to = *from;
336 }
337 
deepcopy_VkPhysicalDeviceFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceFeatures * from,VkPhysicalDeviceFeatures * to)338 void deepcopy_VkPhysicalDeviceFeatures(Allocator* alloc, VkStructureType rootType,
339                                        const VkPhysicalDeviceFeatures* from,
340                                        VkPhysicalDeviceFeatures* to) {
341     (void)alloc;
342     (void)rootType;
343     *to = *from;
344 }
345 
deepcopy_VkPhysicalDeviceLimits(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceLimits * from,VkPhysicalDeviceLimits * to)346 void deepcopy_VkPhysicalDeviceLimits(Allocator* alloc, VkStructureType rootType,
347                                      const VkPhysicalDeviceLimits* from,
348                                      VkPhysicalDeviceLimits* to) {
349     (void)alloc;
350     (void)rootType;
351     *to = *from;
352     memcpy(to->maxComputeWorkGroupCount, from->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
353     memcpy(to->maxComputeWorkGroupSize, from->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
354     memcpy(to->maxViewportDimensions, from->maxViewportDimensions, 2 * sizeof(uint32_t));
355     memcpy(to->viewportBoundsRange, from->viewportBoundsRange, 2 * sizeof(float));
356     memcpy(to->pointSizeRange, from->pointSizeRange, 2 * sizeof(float));
357     memcpy(to->lineWidthRange, from->lineWidthRange, 2 * sizeof(float));
358 }
359 
deepcopy_VkPhysicalDeviceMemoryProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMemoryProperties * from,VkPhysicalDeviceMemoryProperties * to)360 void deepcopy_VkPhysicalDeviceMemoryProperties(Allocator* alloc, VkStructureType rootType,
361                                                const VkPhysicalDeviceMemoryProperties* from,
362                                                VkPhysicalDeviceMemoryProperties* to) {
363     (void)alloc;
364     (void)rootType;
365     *to = *from;
366     for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
367         deepcopy_VkMemoryType(alloc, rootType, from->memoryTypes + i,
368                               (VkMemoryType*)(to->memoryTypes + i));
369     }
370     for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
371         deepcopy_VkMemoryHeap(alloc, rootType, from->memoryHeaps + i,
372                               (VkMemoryHeap*)(to->memoryHeaps + i));
373     }
374 }
375 
deepcopy_VkPhysicalDeviceSparseProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSparseProperties * from,VkPhysicalDeviceSparseProperties * to)376 void deepcopy_VkPhysicalDeviceSparseProperties(Allocator* alloc, VkStructureType rootType,
377                                                const VkPhysicalDeviceSparseProperties* from,
378                                                VkPhysicalDeviceSparseProperties* to) {
379     (void)alloc;
380     (void)rootType;
381     *to = *from;
382 }
383 
deepcopy_VkPhysicalDeviceProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProperties * from,VkPhysicalDeviceProperties * to)384 void deepcopy_VkPhysicalDeviceProperties(Allocator* alloc, VkStructureType rootType,
385                                          const VkPhysicalDeviceProperties* from,
386                                          VkPhysicalDeviceProperties* to) {
387     (void)alloc;
388     (void)rootType;
389     *to = *from;
390     memcpy(to->deviceName, from->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
391     memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
392     deepcopy_VkPhysicalDeviceLimits(alloc, rootType, &from->limits,
393                                     (VkPhysicalDeviceLimits*)(&to->limits));
394     deepcopy_VkPhysicalDeviceSparseProperties(
395         alloc, rootType, &from->sparseProperties,
396         (VkPhysicalDeviceSparseProperties*)(&to->sparseProperties));
397 }
398 
deepcopy_VkQueueFamilyProperties(Allocator * alloc,VkStructureType rootType,const VkQueueFamilyProperties * from,VkQueueFamilyProperties * to)399 void deepcopy_VkQueueFamilyProperties(Allocator* alloc, VkStructureType rootType,
400                                       const VkQueueFamilyProperties* from,
401                                       VkQueueFamilyProperties* to) {
402     (void)alloc;
403     (void)rootType;
404     *to = *from;
405     deepcopy_VkExtent3D(alloc, rootType, &from->minImageTransferGranularity,
406                         (VkExtent3D*)(&to->minImageTransferGranularity));
407 }
408 
deepcopy_VkDeviceQueueCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceQueueCreateInfo * from,VkDeviceQueueCreateInfo * to)409 void deepcopy_VkDeviceQueueCreateInfo(Allocator* alloc, VkStructureType rootType,
410                                       const VkDeviceQueueCreateInfo* from,
411                                       VkDeviceQueueCreateInfo* to) {
412     (void)alloc;
413     (void)rootType;
414     *to = *from;
415     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
416         rootType = from->sType;
417     }
418     const void* from_pNext = from;
419     size_t pNext_size = 0u;
420     while (!pNext_size && from_pNext) {
421         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
422         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
423     }
424     to->pNext = nullptr;
425     if (pNext_size) {
426         to->pNext = (void*)alloc->alloc(pNext_size);
427         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
428     }
429     to->pQueuePriorities = nullptr;
430     if (from->pQueuePriorities) {
431         to->pQueuePriorities =
432             (float*)alloc->dupArray(from->pQueuePriorities, from->queueCount * sizeof(const float));
433     }
434 }
435 
deepcopy_VkDeviceCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceCreateInfo * from,VkDeviceCreateInfo * to)436 void deepcopy_VkDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
437                                  const VkDeviceCreateInfo* from, VkDeviceCreateInfo* to) {
438     (void)alloc;
439     (void)rootType;
440     *to = *from;
441     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
442         rootType = from->sType;
443     }
444     const void* from_pNext = from;
445     size_t pNext_size = 0u;
446     while (!pNext_size && from_pNext) {
447         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
448         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
449     }
450     to->pNext = nullptr;
451     if (pNext_size) {
452         to->pNext = (void*)alloc->alloc(pNext_size);
453         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
454     }
455     if (from) {
456         to->pQueueCreateInfos = nullptr;
457         if (from->pQueueCreateInfos) {
458             to->pQueueCreateInfos = (VkDeviceQueueCreateInfo*)alloc->alloc(
459                 from->queueCreateInfoCount * sizeof(const VkDeviceQueueCreateInfo));
460             to->queueCreateInfoCount = from->queueCreateInfoCount;
461             for (uint32_t i = 0; i < (uint32_t)from->queueCreateInfoCount; ++i) {
462                 deepcopy_VkDeviceQueueCreateInfo(
463                     alloc, rootType, from->pQueueCreateInfos + i,
464                     (VkDeviceQueueCreateInfo*)(to->pQueueCreateInfos + i));
465             }
466         }
467     }
468     to->ppEnabledLayerNames = nullptr;
469     if (from->ppEnabledLayerNames && from->enabledLayerCount) {
470         to->ppEnabledLayerNames =
471             alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
472     }
473     to->ppEnabledExtensionNames = nullptr;
474     if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
475         to->ppEnabledExtensionNames =
476             alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
477     }
478     to->pEnabledFeatures = nullptr;
479     if (from->pEnabledFeatures) {
480         to->pEnabledFeatures =
481             (VkPhysicalDeviceFeatures*)alloc->alloc(sizeof(const VkPhysicalDeviceFeatures));
482         deepcopy_VkPhysicalDeviceFeatures(alloc, rootType, from->pEnabledFeatures,
483                                           (VkPhysicalDeviceFeatures*)(to->pEnabledFeatures));
484     }
485 }
486 
deepcopy_VkExtensionProperties(Allocator * alloc,VkStructureType rootType,const VkExtensionProperties * from,VkExtensionProperties * to)487 void deepcopy_VkExtensionProperties(Allocator* alloc, VkStructureType rootType,
488                                     const VkExtensionProperties* from, VkExtensionProperties* to) {
489     (void)alloc;
490     (void)rootType;
491     *to = *from;
492     memcpy(to->extensionName, from->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
493 }
494 
deepcopy_VkLayerProperties(Allocator * alloc,VkStructureType rootType,const VkLayerProperties * from,VkLayerProperties * to)495 void deepcopy_VkLayerProperties(Allocator* alloc, VkStructureType rootType,
496                                 const VkLayerProperties* from, VkLayerProperties* to) {
497     (void)alloc;
498     (void)rootType;
499     *to = *from;
500     memcpy(to->layerName, from->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
501     memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
502 }
503 
deepcopy_VkSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkSubmitInfo * from,VkSubmitInfo * to)504 void deepcopy_VkSubmitInfo(Allocator* alloc, VkStructureType rootType, const VkSubmitInfo* from,
505                            VkSubmitInfo* to) {
506     (void)alloc;
507     (void)rootType;
508     *to = *from;
509     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
510         rootType = from->sType;
511     }
512     const void* from_pNext = from;
513     size_t pNext_size = 0u;
514     while (!pNext_size && from_pNext) {
515         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
516         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
517     }
518     to->pNext = nullptr;
519     if (pNext_size) {
520         to->pNext = (void*)alloc->alloc(pNext_size);
521         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
522     }
523     to->pWaitSemaphores = nullptr;
524     if (from->pWaitSemaphores) {
525         to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
526             from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
527     }
528     to->pWaitDstStageMask = nullptr;
529     if (from->pWaitDstStageMask) {
530         to->pWaitDstStageMask = (VkPipelineStageFlags*)alloc->dupArray(
531             from->pWaitDstStageMask, from->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
532     }
533     to->pCommandBuffers = nullptr;
534     if (from->pCommandBuffers) {
535         to->pCommandBuffers = (VkCommandBuffer*)alloc->dupArray(
536             from->pCommandBuffers, from->commandBufferCount * sizeof(const VkCommandBuffer));
537     }
538     to->pSignalSemaphores = nullptr;
539     if (from->pSignalSemaphores) {
540         to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
541             from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
542     }
543 }
544 
deepcopy_VkMappedMemoryRange(Allocator * alloc,VkStructureType rootType,const VkMappedMemoryRange * from,VkMappedMemoryRange * to)545 void deepcopy_VkMappedMemoryRange(Allocator* alloc, VkStructureType rootType,
546                                   const VkMappedMemoryRange* from, VkMappedMemoryRange* to) {
547     (void)alloc;
548     (void)rootType;
549     *to = *from;
550     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
551         rootType = from->sType;
552     }
553     const void* from_pNext = from;
554     size_t pNext_size = 0u;
555     while (!pNext_size && from_pNext) {
556         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
557         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
558     }
559     to->pNext = nullptr;
560     if (pNext_size) {
561         to->pNext = (void*)alloc->alloc(pNext_size);
562         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
563     }
564 }
565 
deepcopy_VkMemoryAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryAllocateInfo * from,VkMemoryAllocateInfo * to)566 void deepcopy_VkMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
567                                    const VkMemoryAllocateInfo* from, VkMemoryAllocateInfo* to) {
568     (void)alloc;
569     (void)rootType;
570     *to = *from;
571     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
572         rootType = from->sType;
573     }
574     const void* from_pNext = from;
575     size_t pNext_size = 0u;
576     while (!pNext_size && from_pNext) {
577         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
578         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
579     }
580     to->pNext = nullptr;
581     if (pNext_size) {
582         to->pNext = (void*)alloc->alloc(pNext_size);
583         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
584     }
585 }
586 
deepcopy_VkMemoryRequirements(Allocator * alloc,VkStructureType rootType,const VkMemoryRequirements * from,VkMemoryRequirements * to)587 void deepcopy_VkMemoryRequirements(Allocator* alloc, VkStructureType rootType,
588                                    const VkMemoryRequirements* from, VkMemoryRequirements* to) {
589     (void)alloc;
590     (void)rootType;
591     *to = *from;
592 }
593 
deepcopy_VkSparseMemoryBind(Allocator * alloc,VkStructureType rootType,const VkSparseMemoryBind * from,VkSparseMemoryBind * to)594 void deepcopy_VkSparseMemoryBind(Allocator* alloc, VkStructureType rootType,
595                                  const VkSparseMemoryBind* from, VkSparseMemoryBind* to) {
596     (void)alloc;
597     (void)rootType;
598     *to = *from;
599 }
600 
deepcopy_VkSparseBufferMemoryBindInfo(Allocator * alloc,VkStructureType rootType,const VkSparseBufferMemoryBindInfo * from,VkSparseBufferMemoryBindInfo * to)601 void deepcopy_VkSparseBufferMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
602                                            const VkSparseBufferMemoryBindInfo* from,
603                                            VkSparseBufferMemoryBindInfo* to) {
604     (void)alloc;
605     (void)rootType;
606     *to = *from;
607     if (from) {
608         to->pBinds = nullptr;
609         if (from->pBinds) {
610             to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
611                                                            sizeof(const VkSparseMemoryBind));
612             to->bindCount = from->bindCount;
613             for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
614                 deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
615                                             (VkSparseMemoryBind*)(to->pBinds + i));
616             }
617         }
618     }
619 }
620 
deepcopy_VkSparseImageOpaqueMemoryBindInfo(Allocator * alloc,VkStructureType rootType,const VkSparseImageOpaqueMemoryBindInfo * from,VkSparseImageOpaqueMemoryBindInfo * to)621 void deepcopy_VkSparseImageOpaqueMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
622                                                 const VkSparseImageOpaqueMemoryBindInfo* from,
623                                                 VkSparseImageOpaqueMemoryBindInfo* to) {
624     (void)alloc;
625     (void)rootType;
626     *to = *from;
627     if (from) {
628         to->pBinds = nullptr;
629         if (from->pBinds) {
630             to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
631                                                            sizeof(const VkSparseMemoryBind));
632             to->bindCount = from->bindCount;
633             for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
634                 deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
635                                             (VkSparseMemoryBind*)(to->pBinds + i));
636             }
637         }
638     }
639 }
640 
deepcopy_VkImageSubresource(Allocator * alloc,VkStructureType rootType,const VkImageSubresource * from,VkImageSubresource * to)641 void deepcopy_VkImageSubresource(Allocator* alloc, VkStructureType rootType,
642                                  const VkImageSubresource* from, VkImageSubresource* to) {
643     (void)alloc;
644     (void)rootType;
645     *to = *from;
646 }
647 
deepcopy_VkSparseImageMemoryBind(Allocator * alloc,VkStructureType rootType,const VkSparseImageMemoryBind * from,VkSparseImageMemoryBind * to)648 void deepcopy_VkSparseImageMemoryBind(Allocator* alloc, VkStructureType rootType,
649                                       const VkSparseImageMemoryBind* from,
650                                       VkSparseImageMemoryBind* to) {
651     (void)alloc;
652     (void)rootType;
653     *to = *from;
654     deepcopy_VkImageSubresource(alloc, rootType, &from->subresource,
655                                 (VkImageSubresource*)(&to->subresource));
656     deepcopy_VkOffset3D(alloc, rootType, &from->offset, (VkOffset3D*)(&to->offset));
657     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
658 }
659 
deepcopy_VkSparseImageMemoryBindInfo(Allocator * alloc,VkStructureType rootType,const VkSparseImageMemoryBindInfo * from,VkSparseImageMemoryBindInfo * to)660 void deepcopy_VkSparseImageMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
661                                           const VkSparseImageMemoryBindInfo* from,
662                                           VkSparseImageMemoryBindInfo* to) {
663     (void)alloc;
664     (void)rootType;
665     *to = *from;
666     if (from) {
667         to->pBinds = nullptr;
668         if (from->pBinds) {
669             to->pBinds = (VkSparseImageMemoryBind*)alloc->alloc(
670                 from->bindCount * sizeof(const VkSparseImageMemoryBind));
671             to->bindCount = from->bindCount;
672             for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
673                 deepcopy_VkSparseImageMemoryBind(alloc, rootType, from->pBinds + i,
674                                                  (VkSparseImageMemoryBind*)(to->pBinds + i));
675             }
676         }
677     }
678 }
679 
deepcopy_VkBindSparseInfo(Allocator * alloc,VkStructureType rootType,const VkBindSparseInfo * from,VkBindSparseInfo * to)680 void deepcopy_VkBindSparseInfo(Allocator* alloc, VkStructureType rootType,
681                                const VkBindSparseInfo* from, VkBindSparseInfo* to) {
682     (void)alloc;
683     (void)rootType;
684     *to = *from;
685     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
686         rootType = from->sType;
687     }
688     const void* from_pNext = from;
689     size_t pNext_size = 0u;
690     while (!pNext_size && from_pNext) {
691         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
692         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
693     }
694     to->pNext = nullptr;
695     if (pNext_size) {
696         to->pNext = (void*)alloc->alloc(pNext_size);
697         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
698     }
699     to->pWaitSemaphores = nullptr;
700     if (from->pWaitSemaphores) {
701         to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
702             from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
703     }
704     if (from) {
705         to->pBufferBinds = nullptr;
706         if (from->pBufferBinds) {
707             to->pBufferBinds = (VkSparseBufferMemoryBindInfo*)alloc->alloc(
708                 from->bufferBindCount * sizeof(const VkSparseBufferMemoryBindInfo));
709             to->bufferBindCount = from->bufferBindCount;
710             for (uint32_t i = 0; i < (uint32_t)from->bufferBindCount; ++i) {
711                 deepcopy_VkSparseBufferMemoryBindInfo(
712                     alloc, rootType, from->pBufferBinds + i,
713                     (VkSparseBufferMemoryBindInfo*)(to->pBufferBinds + i));
714             }
715         }
716     }
717     if (from) {
718         to->pImageOpaqueBinds = nullptr;
719         if (from->pImageOpaqueBinds) {
720             to->pImageOpaqueBinds = (VkSparseImageOpaqueMemoryBindInfo*)alloc->alloc(
721                 from->imageOpaqueBindCount * sizeof(const VkSparseImageOpaqueMemoryBindInfo));
722             to->imageOpaqueBindCount = from->imageOpaqueBindCount;
723             for (uint32_t i = 0; i < (uint32_t)from->imageOpaqueBindCount; ++i) {
724                 deepcopy_VkSparseImageOpaqueMemoryBindInfo(
725                     alloc, rootType, from->pImageOpaqueBinds + i,
726                     (VkSparseImageOpaqueMemoryBindInfo*)(to->pImageOpaqueBinds + i));
727             }
728         }
729     }
730     if (from) {
731         to->pImageBinds = nullptr;
732         if (from->pImageBinds) {
733             to->pImageBinds = (VkSparseImageMemoryBindInfo*)alloc->alloc(
734                 from->imageBindCount * sizeof(const VkSparseImageMemoryBindInfo));
735             to->imageBindCount = from->imageBindCount;
736             for (uint32_t i = 0; i < (uint32_t)from->imageBindCount; ++i) {
737                 deepcopy_VkSparseImageMemoryBindInfo(
738                     alloc, rootType, from->pImageBinds + i,
739                     (VkSparseImageMemoryBindInfo*)(to->pImageBinds + i));
740             }
741         }
742     }
743     to->pSignalSemaphores = nullptr;
744     if (from->pSignalSemaphores) {
745         to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
746             from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
747     }
748 }
749 
deepcopy_VkSparseImageFormatProperties(Allocator * alloc,VkStructureType rootType,const VkSparseImageFormatProperties * from,VkSparseImageFormatProperties * to)750 void deepcopy_VkSparseImageFormatProperties(Allocator* alloc, VkStructureType rootType,
751                                             const VkSparseImageFormatProperties* from,
752                                             VkSparseImageFormatProperties* to) {
753     (void)alloc;
754     (void)rootType;
755     *to = *from;
756     deepcopy_VkExtent3D(alloc, rootType, &from->imageGranularity,
757                         (VkExtent3D*)(&to->imageGranularity));
758 }
759 
deepcopy_VkSparseImageMemoryRequirements(Allocator * alloc,VkStructureType rootType,const VkSparseImageMemoryRequirements * from,VkSparseImageMemoryRequirements * to)760 void deepcopy_VkSparseImageMemoryRequirements(Allocator* alloc, VkStructureType rootType,
761                                               const VkSparseImageMemoryRequirements* from,
762                                               VkSparseImageMemoryRequirements* to) {
763     (void)alloc;
764     (void)rootType;
765     *to = *from;
766     deepcopy_VkSparseImageFormatProperties(alloc, rootType, &from->formatProperties,
767                                            (VkSparseImageFormatProperties*)(&to->formatProperties));
768 }
769 
deepcopy_VkFenceCreateInfo(Allocator * alloc,VkStructureType rootType,const VkFenceCreateInfo * from,VkFenceCreateInfo * to)770 void deepcopy_VkFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
771                                 const VkFenceCreateInfo* from, VkFenceCreateInfo* to) {
772     (void)alloc;
773     (void)rootType;
774     *to = *from;
775     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
776         rootType = from->sType;
777     }
778     const void* from_pNext = from;
779     size_t pNext_size = 0u;
780     while (!pNext_size && from_pNext) {
781         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
782         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
783     }
784     to->pNext = nullptr;
785     if (pNext_size) {
786         to->pNext = (void*)alloc->alloc(pNext_size);
787         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
788     }
789 }
790 
deepcopy_VkSemaphoreCreateInfo(Allocator * alloc,VkStructureType rootType,const VkSemaphoreCreateInfo * from,VkSemaphoreCreateInfo * to)791 void deepcopy_VkSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
792                                     const VkSemaphoreCreateInfo* from, VkSemaphoreCreateInfo* to) {
793     (void)alloc;
794     (void)rootType;
795     *to = *from;
796     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
797         rootType = from->sType;
798     }
799     const void* from_pNext = from;
800     size_t pNext_size = 0u;
801     while (!pNext_size && from_pNext) {
802         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
803         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
804     }
805     to->pNext = nullptr;
806     if (pNext_size) {
807         to->pNext = (void*)alloc->alloc(pNext_size);
808         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
809     }
810 }
811 
deepcopy_VkEventCreateInfo(Allocator * alloc,VkStructureType rootType,const VkEventCreateInfo * from,VkEventCreateInfo * to)812 void deepcopy_VkEventCreateInfo(Allocator* alloc, VkStructureType rootType,
813                                 const VkEventCreateInfo* from, VkEventCreateInfo* to) {
814     (void)alloc;
815     (void)rootType;
816     *to = *from;
817     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
818         rootType = from->sType;
819     }
820     const void* from_pNext = from;
821     size_t pNext_size = 0u;
822     while (!pNext_size && from_pNext) {
823         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
824         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
825     }
826     to->pNext = nullptr;
827     if (pNext_size) {
828         to->pNext = (void*)alloc->alloc(pNext_size);
829         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
830     }
831 }
832 
deepcopy_VkQueryPoolCreateInfo(Allocator * alloc,VkStructureType rootType,const VkQueryPoolCreateInfo * from,VkQueryPoolCreateInfo * to)833 void deepcopy_VkQueryPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
834                                     const VkQueryPoolCreateInfo* from, VkQueryPoolCreateInfo* to) {
835     (void)alloc;
836     (void)rootType;
837     *to = *from;
838     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
839         rootType = from->sType;
840     }
841     const void* from_pNext = from;
842     size_t pNext_size = 0u;
843     while (!pNext_size && from_pNext) {
844         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
845         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
846     }
847     to->pNext = nullptr;
848     if (pNext_size) {
849         to->pNext = (void*)alloc->alloc(pNext_size);
850         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
851     }
852 }
853 
deepcopy_VkBufferCreateInfo(Allocator * alloc,VkStructureType rootType,const VkBufferCreateInfo * from,VkBufferCreateInfo * to)854 void deepcopy_VkBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
855                                  const VkBufferCreateInfo* from, VkBufferCreateInfo* to) {
856     (void)alloc;
857     (void)rootType;
858     *to = *from;
859     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
860         rootType = from->sType;
861     }
862     const void* from_pNext = from;
863     size_t pNext_size = 0u;
864     while (!pNext_size && from_pNext) {
865         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
866         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
867     }
868     to->pNext = nullptr;
869     if (pNext_size) {
870         to->pNext = (void*)alloc->alloc(pNext_size);
871         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
872     }
873     to->pQueueFamilyIndices = nullptr;
874     if (from->pQueueFamilyIndices) {
875         to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
876             from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
877     }
878 }
879 
deepcopy_VkBufferViewCreateInfo(Allocator * alloc,VkStructureType rootType,const VkBufferViewCreateInfo * from,VkBufferViewCreateInfo * to)880 void deepcopy_VkBufferViewCreateInfo(Allocator* alloc, VkStructureType rootType,
881                                      const VkBufferViewCreateInfo* from,
882                                      VkBufferViewCreateInfo* to) {
883     (void)alloc;
884     (void)rootType;
885     *to = *from;
886     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
887         rootType = from->sType;
888     }
889     const void* from_pNext = from;
890     size_t pNext_size = 0u;
891     while (!pNext_size && from_pNext) {
892         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
893         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
894     }
895     to->pNext = nullptr;
896     if (pNext_size) {
897         to->pNext = (void*)alloc->alloc(pNext_size);
898         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
899     }
900 }
901 
deepcopy_VkImageCreateInfo(Allocator * alloc,VkStructureType rootType,const VkImageCreateInfo * from,VkImageCreateInfo * to)902 void deepcopy_VkImageCreateInfo(Allocator* alloc, VkStructureType rootType,
903                                 const VkImageCreateInfo* from, VkImageCreateInfo* to) {
904     (void)alloc;
905     (void)rootType;
906     *to = *from;
907     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
908         rootType = from->sType;
909     }
910     const void* from_pNext = from;
911     size_t pNext_size = 0u;
912     while (!pNext_size && from_pNext) {
913         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
914         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
915     }
916     to->pNext = nullptr;
917     if (pNext_size) {
918         to->pNext = (void*)alloc->alloc(pNext_size);
919         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
920     }
921     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
922     to->pQueueFamilyIndices = nullptr;
923     if (from->pQueueFamilyIndices) {
924         to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
925             from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
926     }
927 }
928 
deepcopy_VkSubresourceLayout(Allocator * alloc,VkStructureType rootType,const VkSubresourceLayout * from,VkSubresourceLayout * to)929 void deepcopy_VkSubresourceLayout(Allocator* alloc, VkStructureType rootType,
930                                   const VkSubresourceLayout* from, VkSubresourceLayout* to) {
931     (void)alloc;
932     (void)rootType;
933     *to = *from;
934 }
935 
deepcopy_VkComponentMapping(Allocator * alloc,VkStructureType rootType,const VkComponentMapping * from,VkComponentMapping * to)936 void deepcopy_VkComponentMapping(Allocator* alloc, VkStructureType rootType,
937                                  const VkComponentMapping* from, VkComponentMapping* to) {
938     (void)alloc;
939     (void)rootType;
940     *to = *from;
941 }
942 
deepcopy_VkImageViewCreateInfo(Allocator * alloc,VkStructureType rootType,const VkImageViewCreateInfo * from,VkImageViewCreateInfo * to)943 void deepcopy_VkImageViewCreateInfo(Allocator* alloc, VkStructureType rootType,
944                                     const VkImageViewCreateInfo* from, VkImageViewCreateInfo* to) {
945     (void)alloc;
946     (void)rootType;
947     *to = *from;
948     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
949         rootType = from->sType;
950     }
951     const void* from_pNext = from;
952     size_t pNext_size = 0u;
953     while (!pNext_size && from_pNext) {
954         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
955         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
956     }
957     to->pNext = nullptr;
958     if (pNext_size) {
959         to->pNext = (void*)alloc->alloc(pNext_size);
960         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
961     }
962     deepcopy_VkComponentMapping(alloc, rootType, &from->components,
963                                 (VkComponentMapping*)(&to->components));
964     deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
965                                      (VkImageSubresourceRange*)(&to->subresourceRange));
966 }
967 
deepcopy_VkShaderModuleCreateInfo(Allocator * alloc,VkStructureType rootType,const VkShaderModuleCreateInfo * from,VkShaderModuleCreateInfo * to)968 void deepcopy_VkShaderModuleCreateInfo(Allocator* alloc, VkStructureType rootType,
969                                        const VkShaderModuleCreateInfo* from,
970                                        VkShaderModuleCreateInfo* to) {
971     (void)alloc;
972     (void)rootType;
973     *to = *from;
974     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
975         rootType = from->sType;
976     }
977     const void* from_pNext = from;
978     size_t pNext_size = 0u;
979     while (!pNext_size && from_pNext) {
980         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
981         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
982     }
983     to->pNext = nullptr;
984     if (pNext_size) {
985         to->pNext = (void*)alloc->alloc(pNext_size);
986         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
987     }
988     to->pCode = nullptr;
989     if (from->pCode) {
990         to->pCode =
991             (uint32_t*)alloc->dupArray(from->pCode, (from->codeSize / 4) * sizeof(const uint32_t));
992     }
993 }
994 
deepcopy_VkPipelineCacheCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineCacheCreateInfo * from,VkPipelineCacheCreateInfo * to)995 void deepcopy_VkPipelineCacheCreateInfo(Allocator* alloc, VkStructureType rootType,
996                                         const VkPipelineCacheCreateInfo* from,
997                                         VkPipelineCacheCreateInfo* to) {
998     (void)alloc;
999     (void)rootType;
1000     *to = *from;
1001     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1002         rootType = from->sType;
1003     }
1004     const void* from_pNext = from;
1005     size_t pNext_size = 0u;
1006     while (!pNext_size && from_pNext) {
1007         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1008         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1009     }
1010     to->pNext = nullptr;
1011     if (pNext_size) {
1012         to->pNext = (void*)alloc->alloc(pNext_size);
1013         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1014     }
1015     to->pInitialData = nullptr;
1016     if (from->pInitialData) {
1017         to->pInitialData = (void*)alloc->dupArray(from->pInitialData,
1018                                                   from->initialDataSize * sizeof(const uint8_t));
1019     }
1020 }
1021 
deepcopy_VkSpecializationMapEntry(Allocator * alloc,VkStructureType rootType,const VkSpecializationMapEntry * from,VkSpecializationMapEntry * to)1022 void deepcopy_VkSpecializationMapEntry(Allocator* alloc, VkStructureType rootType,
1023                                        const VkSpecializationMapEntry* from,
1024                                        VkSpecializationMapEntry* to) {
1025     (void)alloc;
1026     (void)rootType;
1027     *to = *from;
1028 }
1029 
deepcopy_VkSpecializationInfo(Allocator * alloc,VkStructureType rootType,const VkSpecializationInfo * from,VkSpecializationInfo * to)1030 void deepcopy_VkSpecializationInfo(Allocator* alloc, VkStructureType rootType,
1031                                    const VkSpecializationInfo* from, VkSpecializationInfo* to) {
1032     (void)alloc;
1033     (void)rootType;
1034     *to = *from;
1035     if (from) {
1036         to->pMapEntries = nullptr;
1037         if (from->pMapEntries) {
1038             to->pMapEntries = (VkSpecializationMapEntry*)alloc->alloc(
1039                 from->mapEntryCount * sizeof(const VkSpecializationMapEntry));
1040             to->mapEntryCount = from->mapEntryCount;
1041             for (uint32_t i = 0; i < (uint32_t)from->mapEntryCount; ++i) {
1042                 deepcopy_VkSpecializationMapEntry(alloc, rootType, from->pMapEntries + i,
1043                                                   (VkSpecializationMapEntry*)(to->pMapEntries + i));
1044             }
1045         }
1046     }
1047     to->pData = nullptr;
1048     if (from->pData) {
1049         to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
1050     }
1051 }
1052 
deepcopy_VkPipelineShaderStageCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineShaderStageCreateInfo * from,VkPipelineShaderStageCreateInfo * to)1053 void deepcopy_VkPipelineShaderStageCreateInfo(Allocator* alloc, VkStructureType rootType,
1054                                               const VkPipelineShaderStageCreateInfo* from,
1055                                               VkPipelineShaderStageCreateInfo* to) {
1056     (void)alloc;
1057     (void)rootType;
1058     *to = *from;
1059     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1060         rootType = from->sType;
1061     }
1062     const void* from_pNext = from;
1063     size_t pNext_size = 0u;
1064     while (!pNext_size && from_pNext) {
1065         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1066         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1067     }
1068     to->pNext = nullptr;
1069     if (pNext_size) {
1070         to->pNext = (void*)alloc->alloc(pNext_size);
1071         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1072     }
1073     to->pName = nullptr;
1074     if (from->pName) {
1075         to->pName = alloc->strDup(from->pName);
1076     }
1077     to->pSpecializationInfo = nullptr;
1078     if (from->pSpecializationInfo) {
1079         to->pSpecializationInfo =
1080             (VkSpecializationInfo*)alloc->alloc(sizeof(const VkSpecializationInfo));
1081         deepcopy_VkSpecializationInfo(alloc, rootType, from->pSpecializationInfo,
1082                                       (VkSpecializationInfo*)(to->pSpecializationInfo));
1083     }
1084 }
1085 
deepcopy_VkComputePipelineCreateInfo(Allocator * alloc,VkStructureType rootType,const VkComputePipelineCreateInfo * from,VkComputePipelineCreateInfo * to)1086 void deepcopy_VkComputePipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
1087                                           const VkComputePipelineCreateInfo* from,
1088                                           VkComputePipelineCreateInfo* to) {
1089     (void)alloc;
1090     (void)rootType;
1091     *to = *from;
1092     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1093         rootType = from->sType;
1094     }
1095     const void* from_pNext = from;
1096     size_t pNext_size = 0u;
1097     while (!pNext_size && from_pNext) {
1098         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1099         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1100     }
1101     to->pNext = nullptr;
1102     if (pNext_size) {
1103         to->pNext = (void*)alloc->alloc(pNext_size);
1104         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1105     }
1106     deepcopy_VkPipelineShaderStageCreateInfo(alloc, rootType, &from->stage,
1107                                              (VkPipelineShaderStageCreateInfo*)(&to->stage));
1108 }
1109 
deepcopy_VkVertexInputBindingDescription(Allocator * alloc,VkStructureType rootType,const VkVertexInputBindingDescription * from,VkVertexInputBindingDescription * to)1110 void deepcopy_VkVertexInputBindingDescription(Allocator* alloc, VkStructureType rootType,
1111                                               const VkVertexInputBindingDescription* from,
1112                                               VkVertexInputBindingDescription* to) {
1113     (void)alloc;
1114     (void)rootType;
1115     *to = *from;
1116 }
1117 
deepcopy_VkVertexInputAttributeDescription(Allocator * alloc,VkStructureType rootType,const VkVertexInputAttributeDescription * from,VkVertexInputAttributeDescription * to)1118 void deepcopy_VkVertexInputAttributeDescription(Allocator* alloc, VkStructureType rootType,
1119                                                 const VkVertexInputAttributeDescription* from,
1120                                                 VkVertexInputAttributeDescription* to) {
1121     (void)alloc;
1122     (void)rootType;
1123     *to = *from;
1124 }
1125 
deepcopy_VkPipelineVertexInputStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineVertexInputStateCreateInfo * from,VkPipelineVertexInputStateCreateInfo * to)1126 void deepcopy_VkPipelineVertexInputStateCreateInfo(Allocator* alloc, VkStructureType rootType,
1127                                                    const VkPipelineVertexInputStateCreateInfo* from,
1128                                                    VkPipelineVertexInputStateCreateInfo* to) {
1129     (void)alloc;
1130     (void)rootType;
1131     *to = *from;
1132     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1133         rootType = from->sType;
1134     }
1135     const void* from_pNext = from;
1136     size_t pNext_size = 0u;
1137     while (!pNext_size && from_pNext) {
1138         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1139         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1140     }
1141     to->pNext = nullptr;
1142     if (pNext_size) {
1143         to->pNext = (void*)alloc->alloc(pNext_size);
1144         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1145     }
1146     if (from) {
1147         to->pVertexBindingDescriptions = nullptr;
1148         if (from->pVertexBindingDescriptions) {
1149             to->pVertexBindingDescriptions = (VkVertexInputBindingDescription*)alloc->alloc(
1150                 from->vertexBindingDescriptionCount *
1151                 sizeof(const VkVertexInputBindingDescription));
1152             to->vertexBindingDescriptionCount = from->vertexBindingDescriptionCount;
1153             for (uint32_t i = 0; i < (uint32_t)from->vertexBindingDescriptionCount; ++i) {
1154                 deepcopy_VkVertexInputBindingDescription(
1155                     alloc, rootType, from->pVertexBindingDescriptions + i,
1156                     (VkVertexInputBindingDescription*)(to->pVertexBindingDescriptions + i));
1157             }
1158         }
1159     }
1160     if (from) {
1161         to->pVertexAttributeDescriptions = nullptr;
1162         if (from->pVertexAttributeDescriptions) {
1163             to->pVertexAttributeDescriptions = (VkVertexInputAttributeDescription*)alloc->alloc(
1164                 from->vertexAttributeDescriptionCount *
1165                 sizeof(const VkVertexInputAttributeDescription));
1166             to->vertexAttributeDescriptionCount = from->vertexAttributeDescriptionCount;
1167             for (uint32_t i = 0; i < (uint32_t)from->vertexAttributeDescriptionCount; ++i) {
1168                 deepcopy_VkVertexInputAttributeDescription(
1169                     alloc, rootType, from->pVertexAttributeDescriptions + i,
1170                     (VkVertexInputAttributeDescription*)(to->pVertexAttributeDescriptions + i));
1171             }
1172         }
1173     }
1174 }
1175 
deepcopy_VkPipelineInputAssemblyStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineInputAssemblyStateCreateInfo * from,VkPipelineInputAssemblyStateCreateInfo * to)1176 void deepcopy_VkPipelineInputAssemblyStateCreateInfo(
1177     Allocator* alloc, VkStructureType rootType, const VkPipelineInputAssemblyStateCreateInfo* from,
1178     VkPipelineInputAssemblyStateCreateInfo* to) {
1179     (void)alloc;
1180     (void)rootType;
1181     *to = *from;
1182     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1183         rootType = from->sType;
1184     }
1185     const void* from_pNext = from;
1186     size_t pNext_size = 0u;
1187     while (!pNext_size && from_pNext) {
1188         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1189         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1190     }
1191     to->pNext = nullptr;
1192     if (pNext_size) {
1193         to->pNext = (void*)alloc->alloc(pNext_size);
1194         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1195     }
1196 }
1197 
deepcopy_VkPipelineTessellationStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineTessellationStateCreateInfo * from,VkPipelineTessellationStateCreateInfo * to)1198 void deepcopy_VkPipelineTessellationStateCreateInfo(
1199     Allocator* alloc, VkStructureType rootType, const VkPipelineTessellationStateCreateInfo* from,
1200     VkPipelineTessellationStateCreateInfo* to) {
1201     (void)alloc;
1202     (void)rootType;
1203     *to = *from;
1204     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1205         rootType = from->sType;
1206     }
1207     const void* from_pNext = from;
1208     size_t pNext_size = 0u;
1209     while (!pNext_size && from_pNext) {
1210         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1211         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1212     }
1213     to->pNext = nullptr;
1214     if (pNext_size) {
1215         to->pNext = (void*)alloc->alloc(pNext_size);
1216         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1217     }
1218 }
1219 
deepcopy_VkViewport(Allocator * alloc,VkStructureType rootType,const VkViewport * from,VkViewport * to)1220 void deepcopy_VkViewport(Allocator* alloc, VkStructureType rootType, const VkViewport* from,
1221                          VkViewport* to) {
1222     (void)alloc;
1223     (void)rootType;
1224     *to = *from;
1225 }
1226 
deepcopy_VkPipelineViewportStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineViewportStateCreateInfo * from,VkPipelineViewportStateCreateInfo * to)1227 void deepcopy_VkPipelineViewportStateCreateInfo(Allocator* alloc, VkStructureType rootType,
1228                                                 const VkPipelineViewportStateCreateInfo* from,
1229                                                 VkPipelineViewportStateCreateInfo* to) {
1230     (void)alloc;
1231     (void)rootType;
1232     *to = *from;
1233     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1234         rootType = from->sType;
1235     }
1236     const void* from_pNext = from;
1237     size_t pNext_size = 0u;
1238     while (!pNext_size && from_pNext) {
1239         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1240         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1241     }
1242     to->pNext = nullptr;
1243     if (pNext_size) {
1244         to->pNext = (void*)alloc->alloc(pNext_size);
1245         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1246     }
1247     if (from) {
1248         to->pViewports = nullptr;
1249         if (from->pViewports) {
1250             to->pViewports =
1251                 (VkViewport*)alloc->alloc(from->viewportCount * sizeof(const VkViewport));
1252             to->viewportCount = from->viewportCount;
1253             for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
1254                 deepcopy_VkViewport(alloc, rootType, from->pViewports + i,
1255                                     (VkViewport*)(to->pViewports + i));
1256             }
1257         }
1258     }
1259     if (from) {
1260         to->pScissors = nullptr;
1261         if (from->pScissors) {
1262             to->pScissors = (VkRect2D*)alloc->alloc(from->scissorCount * sizeof(const VkRect2D));
1263             to->scissorCount = from->scissorCount;
1264             for (uint32_t i = 0; i < (uint32_t)from->scissorCount; ++i) {
1265                 deepcopy_VkRect2D(alloc, rootType, from->pScissors + i,
1266                                   (VkRect2D*)(to->pScissors + i));
1267             }
1268         }
1269     }
1270 }
1271 
deepcopy_VkPipelineRasterizationStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineRasterizationStateCreateInfo * from,VkPipelineRasterizationStateCreateInfo * to)1272 void deepcopy_VkPipelineRasterizationStateCreateInfo(
1273     Allocator* alloc, VkStructureType rootType, const VkPipelineRasterizationStateCreateInfo* from,
1274     VkPipelineRasterizationStateCreateInfo* to) {
1275     (void)alloc;
1276     (void)rootType;
1277     *to = *from;
1278     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1279         rootType = from->sType;
1280     }
1281     const void* from_pNext = from;
1282     size_t pNext_size = 0u;
1283     while (!pNext_size && from_pNext) {
1284         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1285         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1286     }
1287     to->pNext = nullptr;
1288     if (pNext_size) {
1289         to->pNext = (void*)alloc->alloc(pNext_size);
1290         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1291     }
1292 }
1293 
deepcopy_VkPipelineMultisampleStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineMultisampleStateCreateInfo * from,VkPipelineMultisampleStateCreateInfo * to)1294 void deepcopy_VkPipelineMultisampleStateCreateInfo(Allocator* alloc, VkStructureType rootType,
1295                                                    const VkPipelineMultisampleStateCreateInfo* from,
1296                                                    VkPipelineMultisampleStateCreateInfo* to) {
1297     (void)alloc;
1298     (void)rootType;
1299     *to = *from;
1300     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1301         rootType = from->sType;
1302     }
1303     const void* from_pNext = from;
1304     size_t pNext_size = 0u;
1305     while (!pNext_size && from_pNext) {
1306         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1307         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1308     }
1309     to->pNext = nullptr;
1310     if (pNext_size) {
1311         to->pNext = (void*)alloc->alloc(pNext_size);
1312         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1313     }
1314     to->pSampleMask = nullptr;
1315     if (from->pSampleMask) {
1316         to->pSampleMask = (VkSampleMask*)alloc->dupArray(
1317             from->pSampleMask,
1318             (((from->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
1319     }
1320 }
1321 
deepcopy_VkStencilOpState(Allocator * alloc,VkStructureType rootType,const VkStencilOpState * from,VkStencilOpState * to)1322 void deepcopy_VkStencilOpState(Allocator* alloc, VkStructureType rootType,
1323                                const VkStencilOpState* from, VkStencilOpState* to) {
1324     (void)alloc;
1325     (void)rootType;
1326     *to = *from;
1327 }
1328 
deepcopy_VkPipelineDepthStencilStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineDepthStencilStateCreateInfo * from,VkPipelineDepthStencilStateCreateInfo * to)1329 void deepcopy_VkPipelineDepthStencilStateCreateInfo(
1330     Allocator* alloc, VkStructureType rootType, const VkPipelineDepthStencilStateCreateInfo* from,
1331     VkPipelineDepthStencilStateCreateInfo* to) {
1332     (void)alloc;
1333     (void)rootType;
1334     *to = *from;
1335     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1336         rootType = from->sType;
1337     }
1338     const void* from_pNext = from;
1339     size_t pNext_size = 0u;
1340     while (!pNext_size && from_pNext) {
1341         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1342         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1343     }
1344     to->pNext = nullptr;
1345     if (pNext_size) {
1346         to->pNext = (void*)alloc->alloc(pNext_size);
1347         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1348     }
1349     deepcopy_VkStencilOpState(alloc, rootType, &from->front, (VkStencilOpState*)(&to->front));
1350     deepcopy_VkStencilOpState(alloc, rootType, &from->back, (VkStencilOpState*)(&to->back));
1351 }
1352 
deepcopy_VkPipelineColorBlendAttachmentState(Allocator * alloc,VkStructureType rootType,const VkPipelineColorBlendAttachmentState * from,VkPipelineColorBlendAttachmentState * to)1353 void deepcopy_VkPipelineColorBlendAttachmentState(Allocator* alloc, VkStructureType rootType,
1354                                                   const VkPipelineColorBlendAttachmentState* from,
1355                                                   VkPipelineColorBlendAttachmentState* to) {
1356     (void)alloc;
1357     (void)rootType;
1358     *to = *from;
1359 }
1360 
deepcopy_VkPipelineColorBlendStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineColorBlendStateCreateInfo * from,VkPipelineColorBlendStateCreateInfo * to)1361 void deepcopy_VkPipelineColorBlendStateCreateInfo(Allocator* alloc, VkStructureType rootType,
1362                                                   const VkPipelineColorBlendStateCreateInfo* from,
1363                                                   VkPipelineColorBlendStateCreateInfo* to) {
1364     (void)alloc;
1365     (void)rootType;
1366     *to = *from;
1367     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1368         rootType = from->sType;
1369     }
1370     const void* from_pNext = from;
1371     size_t pNext_size = 0u;
1372     while (!pNext_size && from_pNext) {
1373         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1374         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1375     }
1376     to->pNext = nullptr;
1377     if (pNext_size) {
1378         to->pNext = (void*)alloc->alloc(pNext_size);
1379         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1380     }
1381     if (from) {
1382         to->pAttachments = nullptr;
1383         if (from->pAttachments) {
1384             to->pAttachments = (VkPipelineColorBlendAttachmentState*)alloc->alloc(
1385                 from->attachmentCount * sizeof(const VkPipelineColorBlendAttachmentState));
1386             to->attachmentCount = from->attachmentCount;
1387             for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
1388                 deepcopy_VkPipelineColorBlendAttachmentState(
1389                     alloc, rootType, from->pAttachments + i,
1390                     (VkPipelineColorBlendAttachmentState*)(to->pAttachments + i));
1391             }
1392         }
1393     }
1394     memcpy(to->blendConstants, from->blendConstants, 4 * sizeof(float));
1395 }
1396 
deepcopy_VkPipelineDynamicStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineDynamicStateCreateInfo * from,VkPipelineDynamicStateCreateInfo * to)1397 void deepcopy_VkPipelineDynamicStateCreateInfo(Allocator* alloc, VkStructureType rootType,
1398                                                const VkPipelineDynamicStateCreateInfo* from,
1399                                                VkPipelineDynamicStateCreateInfo* to) {
1400     (void)alloc;
1401     (void)rootType;
1402     *to = *from;
1403     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1404         rootType = from->sType;
1405     }
1406     const void* from_pNext = from;
1407     size_t pNext_size = 0u;
1408     while (!pNext_size && from_pNext) {
1409         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1410         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1411     }
1412     to->pNext = nullptr;
1413     if (pNext_size) {
1414         to->pNext = (void*)alloc->alloc(pNext_size);
1415         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1416     }
1417     to->pDynamicStates = nullptr;
1418     if (from->pDynamicStates) {
1419         to->pDynamicStates = (VkDynamicState*)alloc->dupArray(
1420             from->pDynamicStates, from->dynamicStateCount * sizeof(const VkDynamicState));
1421     }
1422 }
1423 
deepcopy_VkGraphicsPipelineCreateInfo(Allocator * alloc,VkStructureType rootType,const VkGraphicsPipelineCreateInfo * from,VkGraphicsPipelineCreateInfo * to)1424 void deepcopy_VkGraphicsPipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
1425                                            const VkGraphicsPipelineCreateInfo* from,
1426                                            VkGraphicsPipelineCreateInfo* to) {
1427     (void)alloc;
1428     (void)rootType;
1429     *to = *from;
1430     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1431         rootType = from->sType;
1432     }
1433     const void* from_pNext = from;
1434     size_t pNext_size = 0u;
1435     while (!pNext_size && from_pNext) {
1436         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1437         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1438     }
1439     to->pNext = nullptr;
1440     if (pNext_size) {
1441         to->pNext = (void*)alloc->alloc(pNext_size);
1442         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1443     }
1444     if (from) {
1445         to->pStages = nullptr;
1446         if (from->pStages) {
1447             to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
1448                 from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
1449             to->stageCount = from->stageCount;
1450             for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
1451                 deepcopy_VkPipelineShaderStageCreateInfo(
1452                     alloc, rootType, from->pStages + i,
1453                     (VkPipelineShaderStageCreateInfo*)(to->pStages + i));
1454             }
1455         }
1456     }
1457     to->pVertexInputState = nullptr;
1458     if (from->pVertexInputState) {
1459         to->pVertexInputState = (VkPipelineVertexInputStateCreateInfo*)alloc->alloc(
1460             sizeof(const VkPipelineVertexInputStateCreateInfo));
1461         deepcopy_VkPipelineVertexInputStateCreateInfo(
1462             alloc, rootType, from->pVertexInputState,
1463             (VkPipelineVertexInputStateCreateInfo*)(to->pVertexInputState));
1464     }
1465     to->pInputAssemblyState = nullptr;
1466     if (from->pInputAssemblyState) {
1467         to->pInputAssemblyState = (VkPipelineInputAssemblyStateCreateInfo*)alloc->alloc(
1468             sizeof(const VkPipelineInputAssemblyStateCreateInfo));
1469         deepcopy_VkPipelineInputAssemblyStateCreateInfo(
1470             alloc, rootType, from->pInputAssemblyState,
1471             (VkPipelineInputAssemblyStateCreateInfo*)(to->pInputAssemblyState));
1472     }
1473     to->pTessellationState = nullptr;
1474     if (from->pTessellationState) {
1475         to->pTessellationState = (VkPipelineTessellationStateCreateInfo*)alloc->alloc(
1476             sizeof(const VkPipelineTessellationStateCreateInfo));
1477         deepcopy_VkPipelineTessellationStateCreateInfo(
1478             alloc, rootType, from->pTessellationState,
1479             (VkPipelineTessellationStateCreateInfo*)(to->pTessellationState));
1480     }
1481     to->pViewportState = nullptr;
1482     if (from->pViewportState) {
1483         to->pViewportState = (VkPipelineViewportStateCreateInfo*)alloc->alloc(
1484             sizeof(const VkPipelineViewportStateCreateInfo));
1485         deepcopy_VkPipelineViewportStateCreateInfo(
1486             alloc, rootType, from->pViewportState,
1487             (VkPipelineViewportStateCreateInfo*)(to->pViewportState));
1488     }
1489     to->pRasterizationState = nullptr;
1490     if (from->pRasterizationState) {
1491         to->pRasterizationState = (VkPipelineRasterizationStateCreateInfo*)alloc->alloc(
1492             sizeof(const VkPipelineRasterizationStateCreateInfo));
1493         deepcopy_VkPipelineRasterizationStateCreateInfo(
1494             alloc, rootType, from->pRasterizationState,
1495             (VkPipelineRasterizationStateCreateInfo*)(to->pRasterizationState));
1496     }
1497     to->pMultisampleState = nullptr;
1498     if (from->pMultisampleState) {
1499         to->pMultisampleState = (VkPipelineMultisampleStateCreateInfo*)alloc->alloc(
1500             sizeof(const VkPipelineMultisampleStateCreateInfo));
1501         deepcopy_VkPipelineMultisampleStateCreateInfo(
1502             alloc, rootType, from->pMultisampleState,
1503             (VkPipelineMultisampleStateCreateInfo*)(to->pMultisampleState));
1504     }
1505     to->pDepthStencilState = nullptr;
1506     if (from->pDepthStencilState) {
1507         to->pDepthStencilState = (VkPipelineDepthStencilStateCreateInfo*)alloc->alloc(
1508             sizeof(const VkPipelineDepthStencilStateCreateInfo));
1509         deepcopy_VkPipelineDepthStencilStateCreateInfo(
1510             alloc, rootType, from->pDepthStencilState,
1511             (VkPipelineDepthStencilStateCreateInfo*)(to->pDepthStencilState));
1512     }
1513     to->pColorBlendState = nullptr;
1514     if (from->pColorBlendState) {
1515         to->pColorBlendState = (VkPipelineColorBlendStateCreateInfo*)alloc->alloc(
1516             sizeof(const VkPipelineColorBlendStateCreateInfo));
1517         deepcopy_VkPipelineColorBlendStateCreateInfo(
1518             alloc, rootType, from->pColorBlendState,
1519             (VkPipelineColorBlendStateCreateInfo*)(to->pColorBlendState));
1520     }
1521     to->pDynamicState = nullptr;
1522     if (from->pDynamicState) {
1523         to->pDynamicState = (VkPipelineDynamicStateCreateInfo*)alloc->alloc(
1524             sizeof(const VkPipelineDynamicStateCreateInfo));
1525         deepcopy_VkPipelineDynamicStateCreateInfo(
1526             alloc, rootType, from->pDynamicState,
1527             (VkPipelineDynamicStateCreateInfo*)(to->pDynamicState));
1528     }
1529 }
1530 
deepcopy_VkPushConstantRange(Allocator * alloc,VkStructureType rootType,const VkPushConstantRange * from,VkPushConstantRange * to)1531 void deepcopy_VkPushConstantRange(Allocator* alloc, VkStructureType rootType,
1532                                   const VkPushConstantRange* from, VkPushConstantRange* to) {
1533     (void)alloc;
1534     (void)rootType;
1535     *to = *from;
1536 }
1537 
deepcopy_VkPipelineLayoutCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineLayoutCreateInfo * from,VkPipelineLayoutCreateInfo * to)1538 void deepcopy_VkPipelineLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
1539                                          const VkPipelineLayoutCreateInfo* from,
1540                                          VkPipelineLayoutCreateInfo* to) {
1541     (void)alloc;
1542     (void)rootType;
1543     *to = *from;
1544     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1545         rootType = from->sType;
1546     }
1547     const void* from_pNext = from;
1548     size_t pNext_size = 0u;
1549     while (!pNext_size && from_pNext) {
1550         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1551         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1552     }
1553     to->pNext = nullptr;
1554     if (pNext_size) {
1555         to->pNext = (void*)alloc->alloc(pNext_size);
1556         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1557     }
1558     to->pSetLayouts = nullptr;
1559     if (from->pSetLayouts) {
1560         to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
1561             from->pSetLayouts, from->setLayoutCount * sizeof(const VkDescriptorSetLayout));
1562     }
1563     if (from) {
1564         to->pPushConstantRanges = nullptr;
1565         if (from->pPushConstantRanges) {
1566             to->pPushConstantRanges = (VkPushConstantRange*)alloc->alloc(
1567                 from->pushConstantRangeCount * sizeof(const VkPushConstantRange));
1568             to->pushConstantRangeCount = from->pushConstantRangeCount;
1569             for (uint32_t i = 0; i < (uint32_t)from->pushConstantRangeCount; ++i) {
1570                 deepcopy_VkPushConstantRange(alloc, rootType, from->pPushConstantRanges + i,
1571                                              (VkPushConstantRange*)(to->pPushConstantRanges + i));
1572             }
1573         }
1574     }
1575 }
1576 
deepcopy_VkSamplerCreateInfo(Allocator * alloc,VkStructureType rootType,const VkSamplerCreateInfo * from,VkSamplerCreateInfo * to)1577 void deepcopy_VkSamplerCreateInfo(Allocator* alloc, VkStructureType rootType,
1578                                   const VkSamplerCreateInfo* from, VkSamplerCreateInfo* to) {
1579     (void)alloc;
1580     (void)rootType;
1581     *to = *from;
1582     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1583         rootType = from->sType;
1584     }
1585     const void* from_pNext = from;
1586     size_t pNext_size = 0u;
1587     while (!pNext_size && from_pNext) {
1588         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1589         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1590     }
1591     to->pNext = nullptr;
1592     if (pNext_size) {
1593         to->pNext = (void*)alloc->alloc(pNext_size);
1594         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1595     }
1596 }
1597 
deepcopy_VkCopyDescriptorSet(Allocator * alloc,VkStructureType rootType,const VkCopyDescriptorSet * from,VkCopyDescriptorSet * to)1598 void deepcopy_VkCopyDescriptorSet(Allocator* alloc, VkStructureType rootType,
1599                                   const VkCopyDescriptorSet* from, VkCopyDescriptorSet* to) {
1600     (void)alloc;
1601     (void)rootType;
1602     *to = *from;
1603     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1604         rootType = from->sType;
1605     }
1606     const void* from_pNext = from;
1607     size_t pNext_size = 0u;
1608     while (!pNext_size && from_pNext) {
1609         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1610         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1611     }
1612     to->pNext = nullptr;
1613     if (pNext_size) {
1614         to->pNext = (void*)alloc->alloc(pNext_size);
1615         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1616     }
1617 }
1618 
deepcopy_VkDescriptorBufferInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorBufferInfo * from,VkDescriptorBufferInfo * to)1619 void deepcopy_VkDescriptorBufferInfo(Allocator* alloc, VkStructureType rootType,
1620                                      const VkDescriptorBufferInfo* from,
1621                                      VkDescriptorBufferInfo* to) {
1622     (void)alloc;
1623     (void)rootType;
1624     *to = *from;
1625 }
1626 
deepcopy_VkDescriptorImageInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorImageInfo * from,VkDescriptorImageInfo * to)1627 void deepcopy_VkDescriptorImageInfo(Allocator* alloc, VkStructureType rootType,
1628                                     const VkDescriptorImageInfo* from, VkDescriptorImageInfo* to) {
1629     (void)alloc;
1630     (void)rootType;
1631     *to = *from;
1632 }
1633 
deepcopy_VkDescriptorPoolSize(Allocator * alloc,VkStructureType rootType,const VkDescriptorPoolSize * from,VkDescriptorPoolSize * to)1634 void deepcopy_VkDescriptorPoolSize(Allocator* alloc, VkStructureType rootType,
1635                                    const VkDescriptorPoolSize* from, VkDescriptorPoolSize* to) {
1636     (void)alloc;
1637     (void)rootType;
1638     *to = *from;
1639 }
1640 
deepcopy_VkDescriptorPoolCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorPoolCreateInfo * from,VkDescriptorPoolCreateInfo * to)1641 void deepcopy_VkDescriptorPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
1642                                          const VkDescriptorPoolCreateInfo* from,
1643                                          VkDescriptorPoolCreateInfo* to) {
1644     (void)alloc;
1645     (void)rootType;
1646     *to = *from;
1647     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1648         rootType = from->sType;
1649     }
1650     const void* from_pNext = from;
1651     size_t pNext_size = 0u;
1652     while (!pNext_size && from_pNext) {
1653         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1654         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1655     }
1656     to->pNext = nullptr;
1657     if (pNext_size) {
1658         to->pNext = (void*)alloc->alloc(pNext_size);
1659         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1660     }
1661     if (from) {
1662         to->pPoolSizes = nullptr;
1663         if (from->pPoolSizes) {
1664             to->pPoolSizes = (VkDescriptorPoolSize*)alloc->alloc(
1665                 from->poolSizeCount * sizeof(const VkDescriptorPoolSize));
1666             to->poolSizeCount = from->poolSizeCount;
1667             for (uint32_t i = 0; i < (uint32_t)from->poolSizeCount; ++i) {
1668                 deepcopy_VkDescriptorPoolSize(alloc, rootType, from->pPoolSizes + i,
1669                                               (VkDescriptorPoolSize*)(to->pPoolSizes + i));
1670             }
1671         }
1672     }
1673 }
1674 
deepcopy_VkDescriptorSetAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetAllocateInfo * from,VkDescriptorSetAllocateInfo * to)1675 void deepcopy_VkDescriptorSetAllocateInfo(Allocator* alloc, VkStructureType rootType,
1676                                           const VkDescriptorSetAllocateInfo* from,
1677                                           VkDescriptorSetAllocateInfo* to) {
1678     (void)alloc;
1679     (void)rootType;
1680     *to = *from;
1681     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1682         rootType = from->sType;
1683     }
1684     const void* from_pNext = from;
1685     size_t pNext_size = 0u;
1686     while (!pNext_size && from_pNext) {
1687         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1688         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1689     }
1690     to->pNext = nullptr;
1691     if (pNext_size) {
1692         to->pNext = (void*)alloc->alloc(pNext_size);
1693         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1694     }
1695     to->pSetLayouts = nullptr;
1696     if (from->pSetLayouts) {
1697         to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
1698             from->pSetLayouts, from->descriptorSetCount * sizeof(const VkDescriptorSetLayout));
1699     }
1700 }
1701 
deepcopy_VkDescriptorSetLayoutBinding(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetLayoutBinding * from,VkDescriptorSetLayoutBinding * to)1702 void deepcopy_VkDescriptorSetLayoutBinding(Allocator* alloc, VkStructureType rootType,
1703                                            const VkDescriptorSetLayoutBinding* from,
1704                                            VkDescriptorSetLayoutBinding* to) {
1705     (void)alloc;
1706     (void)rootType;
1707     *to = *from;
1708     to->pImmutableSamplers = nullptr;
1709     if (from->pImmutableSamplers) {
1710         to->pImmutableSamplers = (VkSampler*)alloc->dupArray(
1711             from->pImmutableSamplers, from->descriptorCount * sizeof(const VkSampler));
1712     }
1713 }
1714 
deepcopy_VkDescriptorSetLayoutCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetLayoutCreateInfo * from,VkDescriptorSetLayoutCreateInfo * to)1715 void deepcopy_VkDescriptorSetLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
1716                                               const VkDescriptorSetLayoutCreateInfo* from,
1717                                               VkDescriptorSetLayoutCreateInfo* to) {
1718     (void)alloc;
1719     (void)rootType;
1720     *to = *from;
1721     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1722         rootType = from->sType;
1723     }
1724     const void* from_pNext = from;
1725     size_t pNext_size = 0u;
1726     while (!pNext_size && from_pNext) {
1727         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1728         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1729     }
1730     to->pNext = nullptr;
1731     if (pNext_size) {
1732         to->pNext = (void*)alloc->alloc(pNext_size);
1733         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1734     }
1735     if (from) {
1736         to->pBindings = nullptr;
1737         if (from->pBindings) {
1738             to->pBindings = (VkDescriptorSetLayoutBinding*)alloc->alloc(
1739                 from->bindingCount * sizeof(const VkDescriptorSetLayoutBinding));
1740             to->bindingCount = from->bindingCount;
1741             for (uint32_t i = 0; i < (uint32_t)from->bindingCount; ++i) {
1742                 deepcopy_VkDescriptorSetLayoutBinding(
1743                     alloc, rootType, from->pBindings + i,
1744                     (VkDescriptorSetLayoutBinding*)(to->pBindings + i));
1745             }
1746         }
1747     }
1748 }
1749 
deepcopy_VkWriteDescriptorSet(Allocator * alloc,VkStructureType rootType,const VkWriteDescriptorSet * from,VkWriteDescriptorSet * to)1750 void deepcopy_VkWriteDescriptorSet(Allocator* alloc, VkStructureType rootType,
1751                                    const VkWriteDescriptorSet* from, VkWriteDescriptorSet* to) {
1752     (void)alloc;
1753     (void)rootType;
1754     *to = *from;
1755     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1756         rootType = from->sType;
1757     }
1758     const void* from_pNext = from;
1759     size_t pNext_size = 0u;
1760     while (!pNext_size && from_pNext) {
1761         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1762         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1763     }
1764     to->pNext = nullptr;
1765     if (pNext_size) {
1766         to->pNext = (void*)alloc->alloc(pNext_size);
1767         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1768     }
1769     if (from) {
1770         to->pImageInfo = nullptr;
1771         if (from->pImageInfo) {
1772             to->pImageInfo = (VkDescriptorImageInfo*)alloc->alloc(
1773                 from->descriptorCount * sizeof(const VkDescriptorImageInfo));
1774             to->descriptorCount = from->descriptorCount;
1775             for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
1776                 deepcopy_VkDescriptorImageInfo(alloc, rootType, from->pImageInfo + i,
1777                                                (VkDescriptorImageInfo*)(to->pImageInfo + i));
1778             }
1779         }
1780     }
1781     if (from) {
1782         to->pBufferInfo = nullptr;
1783         if (from->pBufferInfo) {
1784             to->pBufferInfo = (VkDescriptorBufferInfo*)alloc->alloc(
1785                 from->descriptorCount * sizeof(const VkDescriptorBufferInfo));
1786             to->descriptorCount = from->descriptorCount;
1787             for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
1788                 deepcopy_VkDescriptorBufferInfo(alloc, rootType, from->pBufferInfo + i,
1789                                                 (VkDescriptorBufferInfo*)(to->pBufferInfo + i));
1790             }
1791         }
1792     }
1793     to->pTexelBufferView = nullptr;
1794     if (from->pTexelBufferView) {
1795         to->pTexelBufferView = (VkBufferView*)alloc->dupArray(
1796             from->pTexelBufferView, from->descriptorCount * sizeof(const VkBufferView));
1797     }
1798 }
1799 
deepcopy_VkAttachmentDescription(Allocator * alloc,VkStructureType rootType,const VkAttachmentDescription * from,VkAttachmentDescription * to)1800 void deepcopy_VkAttachmentDescription(Allocator* alloc, VkStructureType rootType,
1801                                       const VkAttachmentDescription* from,
1802                                       VkAttachmentDescription* to) {
1803     (void)alloc;
1804     (void)rootType;
1805     *to = *from;
1806 }
1807 
deepcopy_VkAttachmentReference(Allocator * alloc,VkStructureType rootType,const VkAttachmentReference * from,VkAttachmentReference * to)1808 void deepcopy_VkAttachmentReference(Allocator* alloc, VkStructureType rootType,
1809                                     const VkAttachmentReference* from, VkAttachmentReference* to) {
1810     (void)alloc;
1811     (void)rootType;
1812     *to = *from;
1813 }
1814 
deepcopy_VkFramebufferCreateInfo(Allocator * alloc,VkStructureType rootType,const VkFramebufferCreateInfo * from,VkFramebufferCreateInfo * to)1815 void deepcopy_VkFramebufferCreateInfo(Allocator* alloc, VkStructureType rootType,
1816                                       const VkFramebufferCreateInfo* from,
1817                                       VkFramebufferCreateInfo* to) {
1818     (void)alloc;
1819     (void)rootType;
1820     *to = *from;
1821     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1822         rootType = from->sType;
1823     }
1824     const void* from_pNext = from;
1825     size_t pNext_size = 0u;
1826     while (!pNext_size && from_pNext) {
1827         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1828         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1829     }
1830     to->pNext = nullptr;
1831     if (pNext_size) {
1832         to->pNext = (void*)alloc->alloc(pNext_size);
1833         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1834     }
1835     to->pAttachments = nullptr;
1836     if (from->pAttachments) {
1837         to->pAttachments = (VkImageView*)alloc->dupArray(
1838             from->pAttachments, from->attachmentCount * sizeof(const VkImageView));
1839     }
1840 }
1841 
deepcopy_VkSubpassDescription(Allocator * alloc,VkStructureType rootType,const VkSubpassDescription * from,VkSubpassDescription * to)1842 void deepcopy_VkSubpassDescription(Allocator* alloc, VkStructureType rootType,
1843                                    const VkSubpassDescription* from, VkSubpassDescription* to) {
1844     (void)alloc;
1845     (void)rootType;
1846     *to = *from;
1847     if (from) {
1848         to->pInputAttachments = nullptr;
1849         if (from->pInputAttachments) {
1850             to->pInputAttachments = (VkAttachmentReference*)alloc->alloc(
1851                 from->inputAttachmentCount * sizeof(const VkAttachmentReference));
1852             to->inputAttachmentCount = from->inputAttachmentCount;
1853             for (uint32_t i = 0; i < (uint32_t)from->inputAttachmentCount; ++i) {
1854                 deepcopy_VkAttachmentReference(alloc, rootType, from->pInputAttachments + i,
1855                                                (VkAttachmentReference*)(to->pInputAttachments + i));
1856             }
1857         }
1858     }
1859     if (from) {
1860         to->pColorAttachments = nullptr;
1861         if (from->pColorAttachments) {
1862             to->pColorAttachments = (VkAttachmentReference*)alloc->alloc(
1863                 from->colorAttachmentCount * sizeof(const VkAttachmentReference));
1864             to->colorAttachmentCount = from->colorAttachmentCount;
1865             for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
1866                 deepcopy_VkAttachmentReference(alloc, rootType, from->pColorAttachments + i,
1867                                                (VkAttachmentReference*)(to->pColorAttachments + i));
1868             }
1869         }
1870     }
1871     if (from) {
1872         to->pResolveAttachments = nullptr;
1873         if (from->pResolveAttachments) {
1874             to->pResolveAttachments = (VkAttachmentReference*)alloc->alloc(
1875                 from->colorAttachmentCount * sizeof(const VkAttachmentReference));
1876             to->colorAttachmentCount = from->colorAttachmentCount;
1877             for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
1878                 deepcopy_VkAttachmentReference(
1879                     alloc, rootType, from->pResolveAttachments + i,
1880                     (VkAttachmentReference*)(to->pResolveAttachments + i));
1881             }
1882         }
1883     }
1884     to->pDepthStencilAttachment = nullptr;
1885     if (from->pDepthStencilAttachment) {
1886         to->pDepthStencilAttachment =
1887             (VkAttachmentReference*)alloc->alloc(sizeof(const VkAttachmentReference));
1888         deepcopy_VkAttachmentReference(alloc, rootType, from->pDepthStencilAttachment,
1889                                        (VkAttachmentReference*)(to->pDepthStencilAttachment));
1890     }
1891     to->pPreserveAttachments = nullptr;
1892     if (from->pPreserveAttachments) {
1893         to->pPreserveAttachments = (uint32_t*)alloc->dupArray(
1894             from->pPreserveAttachments, from->preserveAttachmentCount * sizeof(const uint32_t));
1895     }
1896 }
1897 
deepcopy_VkSubpassDependency(Allocator * alloc,VkStructureType rootType,const VkSubpassDependency * from,VkSubpassDependency * to)1898 void deepcopy_VkSubpassDependency(Allocator* alloc, VkStructureType rootType,
1899                                   const VkSubpassDependency* from, VkSubpassDependency* to) {
1900     (void)alloc;
1901     (void)rootType;
1902     *to = *from;
1903 }
1904 
deepcopy_VkRenderPassCreateInfo(Allocator * alloc,VkStructureType rootType,const VkRenderPassCreateInfo * from,VkRenderPassCreateInfo * to)1905 void deepcopy_VkRenderPassCreateInfo(Allocator* alloc, VkStructureType rootType,
1906                                      const VkRenderPassCreateInfo* from,
1907                                      VkRenderPassCreateInfo* to) {
1908     (void)alloc;
1909     (void)rootType;
1910     *to = *from;
1911     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1912         rootType = from->sType;
1913     }
1914     const void* from_pNext = from;
1915     size_t pNext_size = 0u;
1916     while (!pNext_size && from_pNext) {
1917         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1918         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1919     }
1920     to->pNext = nullptr;
1921     if (pNext_size) {
1922         to->pNext = (void*)alloc->alloc(pNext_size);
1923         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1924     }
1925     if (from) {
1926         to->pAttachments = nullptr;
1927         if (from->pAttachments) {
1928             to->pAttachments = (VkAttachmentDescription*)alloc->alloc(
1929                 from->attachmentCount * sizeof(const VkAttachmentDescription));
1930             to->attachmentCount = from->attachmentCount;
1931             for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
1932                 deepcopy_VkAttachmentDescription(alloc, rootType, from->pAttachments + i,
1933                                                  (VkAttachmentDescription*)(to->pAttachments + i));
1934             }
1935         }
1936     }
1937     if (from) {
1938         to->pSubpasses = nullptr;
1939         if (from->pSubpasses) {
1940             to->pSubpasses = (VkSubpassDescription*)alloc->alloc(
1941                 from->subpassCount * sizeof(const VkSubpassDescription));
1942             to->subpassCount = from->subpassCount;
1943             for (uint32_t i = 0; i < (uint32_t)from->subpassCount; ++i) {
1944                 deepcopy_VkSubpassDescription(alloc, rootType, from->pSubpasses + i,
1945                                               (VkSubpassDescription*)(to->pSubpasses + i));
1946             }
1947         }
1948     }
1949     if (from) {
1950         to->pDependencies = nullptr;
1951         if (from->pDependencies) {
1952             to->pDependencies = (VkSubpassDependency*)alloc->alloc(
1953                 from->dependencyCount * sizeof(const VkSubpassDependency));
1954             to->dependencyCount = from->dependencyCount;
1955             for (uint32_t i = 0; i < (uint32_t)from->dependencyCount; ++i) {
1956                 deepcopy_VkSubpassDependency(alloc, rootType, from->pDependencies + i,
1957                                              (VkSubpassDependency*)(to->pDependencies + i));
1958             }
1959         }
1960     }
1961 }
1962 
deepcopy_VkCommandPoolCreateInfo(Allocator * alloc,VkStructureType rootType,const VkCommandPoolCreateInfo * from,VkCommandPoolCreateInfo * to)1963 void deepcopy_VkCommandPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
1964                                       const VkCommandPoolCreateInfo* from,
1965                                       VkCommandPoolCreateInfo* to) {
1966     (void)alloc;
1967     (void)rootType;
1968     *to = *from;
1969     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1970         rootType = from->sType;
1971     }
1972     const void* from_pNext = from;
1973     size_t pNext_size = 0u;
1974     while (!pNext_size && from_pNext) {
1975         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1976         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1977     }
1978     to->pNext = nullptr;
1979     if (pNext_size) {
1980         to->pNext = (void*)alloc->alloc(pNext_size);
1981         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
1982     }
1983 }
1984 
deepcopy_VkCommandBufferAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkCommandBufferAllocateInfo * from,VkCommandBufferAllocateInfo * to)1985 void deepcopy_VkCommandBufferAllocateInfo(Allocator* alloc, VkStructureType rootType,
1986                                           const VkCommandBufferAllocateInfo* from,
1987                                           VkCommandBufferAllocateInfo* to) {
1988     (void)alloc;
1989     (void)rootType;
1990     *to = *from;
1991     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
1992         rootType = from->sType;
1993     }
1994     const void* from_pNext = from;
1995     size_t pNext_size = 0u;
1996     while (!pNext_size && from_pNext) {
1997         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
1998         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
1999     }
2000     to->pNext = nullptr;
2001     if (pNext_size) {
2002         to->pNext = (void*)alloc->alloc(pNext_size);
2003         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2004     }
2005 }
2006 
deepcopy_VkCommandBufferInheritanceInfo(Allocator * alloc,VkStructureType rootType,const VkCommandBufferInheritanceInfo * from,VkCommandBufferInheritanceInfo * to)2007 void deepcopy_VkCommandBufferInheritanceInfo(Allocator* alloc, VkStructureType rootType,
2008                                              const VkCommandBufferInheritanceInfo* from,
2009                                              VkCommandBufferInheritanceInfo* to) {
2010     (void)alloc;
2011     (void)rootType;
2012     *to = *from;
2013     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2014         rootType = from->sType;
2015     }
2016     const void* from_pNext = from;
2017     size_t pNext_size = 0u;
2018     while (!pNext_size && from_pNext) {
2019         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2020         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2021     }
2022     to->pNext = nullptr;
2023     if (pNext_size) {
2024         to->pNext = (void*)alloc->alloc(pNext_size);
2025         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2026     }
2027 }
2028 
deepcopy_VkCommandBufferBeginInfo(Allocator * alloc,VkStructureType rootType,const VkCommandBufferBeginInfo * from,VkCommandBufferBeginInfo * to)2029 void deepcopy_VkCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
2030                                        const VkCommandBufferBeginInfo* from,
2031                                        VkCommandBufferBeginInfo* to) {
2032     (void)alloc;
2033     (void)rootType;
2034     *to = *from;
2035     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2036         rootType = from->sType;
2037     }
2038     const void* from_pNext = from;
2039     size_t pNext_size = 0u;
2040     while (!pNext_size && from_pNext) {
2041         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2042         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2043     }
2044     to->pNext = nullptr;
2045     if (pNext_size) {
2046         to->pNext = (void*)alloc->alloc(pNext_size);
2047         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2048     }
2049     to->pInheritanceInfo = nullptr;
2050     if (from->pInheritanceInfo) {
2051         to->pInheritanceInfo = (VkCommandBufferInheritanceInfo*)alloc->alloc(
2052             sizeof(const VkCommandBufferInheritanceInfo));
2053         deepcopy_VkCommandBufferInheritanceInfo(
2054             alloc, rootType, from->pInheritanceInfo,
2055             (VkCommandBufferInheritanceInfo*)(to->pInheritanceInfo));
2056     }
2057 }
2058 
deepcopy_VkBufferCopy(Allocator * alloc,VkStructureType rootType,const VkBufferCopy * from,VkBufferCopy * to)2059 void deepcopy_VkBufferCopy(Allocator* alloc, VkStructureType rootType, const VkBufferCopy* from,
2060                            VkBufferCopy* to) {
2061     (void)alloc;
2062     (void)rootType;
2063     *to = *from;
2064 }
2065 
deepcopy_VkImageSubresourceLayers(Allocator * alloc,VkStructureType rootType,const VkImageSubresourceLayers * from,VkImageSubresourceLayers * to)2066 void deepcopy_VkImageSubresourceLayers(Allocator* alloc, VkStructureType rootType,
2067                                        const VkImageSubresourceLayers* from,
2068                                        VkImageSubresourceLayers* to) {
2069     (void)alloc;
2070     (void)rootType;
2071     *to = *from;
2072 }
2073 
deepcopy_VkBufferImageCopy(Allocator * alloc,VkStructureType rootType,const VkBufferImageCopy * from,VkBufferImageCopy * to)2074 void deepcopy_VkBufferImageCopy(Allocator* alloc, VkStructureType rootType,
2075                                 const VkBufferImageCopy* from, VkBufferImageCopy* to) {
2076     (void)alloc;
2077     (void)rootType;
2078     *to = *from;
2079     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
2080                                       (VkImageSubresourceLayers*)(&to->imageSubresource));
2081     deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
2082     deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
2083 }
2084 
deepcopy_VkClearColorValue(Allocator * alloc,VkStructureType rootType,const VkClearColorValue * from,VkClearColorValue * to)2085 void deepcopy_VkClearColorValue(Allocator* alloc, VkStructureType rootType,
2086                                 const VkClearColorValue* from, VkClearColorValue* to) {
2087     (void)alloc;
2088     (void)rootType;
2089     *to = *from;
2090     memcpy(to->float32, from->float32, 4 * sizeof(float));
2091     memcpy(to->int32, from->int32, 4 * sizeof(int32_t));
2092     memcpy(to->uint32, from->uint32, 4 * sizeof(uint32_t));
2093 }
2094 
deepcopy_VkClearDepthStencilValue(Allocator * alloc,VkStructureType rootType,const VkClearDepthStencilValue * from,VkClearDepthStencilValue * to)2095 void deepcopy_VkClearDepthStencilValue(Allocator* alloc, VkStructureType rootType,
2096                                        const VkClearDepthStencilValue* from,
2097                                        VkClearDepthStencilValue* to) {
2098     (void)alloc;
2099     (void)rootType;
2100     *to = *from;
2101 }
2102 
deepcopy_VkClearValue(Allocator * alloc,VkStructureType rootType,const VkClearValue * from,VkClearValue * to)2103 void deepcopy_VkClearValue(Allocator* alloc, VkStructureType rootType, const VkClearValue* from,
2104                            VkClearValue* to) {
2105     (void)alloc;
2106     (void)rootType;
2107     *to = *from;
2108     deepcopy_VkClearColorValue(alloc, rootType, &from->color, (VkClearColorValue*)(&to->color));
2109     deepcopy_VkClearDepthStencilValue(alloc, rootType, &from->depthStencil,
2110                                       (VkClearDepthStencilValue*)(&to->depthStencil));
2111 }
2112 
deepcopy_VkClearAttachment(Allocator * alloc,VkStructureType rootType,const VkClearAttachment * from,VkClearAttachment * to)2113 void deepcopy_VkClearAttachment(Allocator* alloc, VkStructureType rootType,
2114                                 const VkClearAttachment* from, VkClearAttachment* to) {
2115     (void)alloc;
2116     (void)rootType;
2117     *to = *from;
2118     deepcopy_VkClearValue(alloc, rootType, &from->clearValue, (VkClearValue*)(&to->clearValue));
2119 }
2120 
deepcopy_VkClearRect(Allocator * alloc,VkStructureType rootType,const VkClearRect * from,VkClearRect * to)2121 void deepcopy_VkClearRect(Allocator* alloc, VkStructureType rootType, const VkClearRect* from,
2122                           VkClearRect* to) {
2123     (void)alloc;
2124     (void)rootType;
2125     *to = *from;
2126     deepcopy_VkRect2D(alloc, rootType, &from->rect, (VkRect2D*)(&to->rect));
2127 }
2128 
deepcopy_VkImageBlit(Allocator * alloc,VkStructureType rootType,const VkImageBlit * from,VkImageBlit * to)2129 void deepcopy_VkImageBlit(Allocator* alloc, VkStructureType rootType, const VkImageBlit* from,
2130                           VkImageBlit* to) {
2131     (void)alloc;
2132     (void)rootType;
2133     *to = *from;
2134     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
2135                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
2136     for (uint32_t i = 0; i < (uint32_t)2; ++i) {
2137         deepcopy_VkOffset3D(alloc, rootType, from->srcOffsets + i,
2138                             (VkOffset3D*)(to->srcOffsets + i));
2139     }
2140     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
2141                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
2142     for (uint32_t i = 0; i < (uint32_t)2; ++i) {
2143         deepcopy_VkOffset3D(alloc, rootType, from->dstOffsets + i,
2144                             (VkOffset3D*)(to->dstOffsets + i));
2145     }
2146 }
2147 
deepcopy_VkImageCopy(Allocator * alloc,VkStructureType rootType,const VkImageCopy * from,VkImageCopy * to)2148 void deepcopy_VkImageCopy(Allocator* alloc, VkStructureType rootType, const VkImageCopy* from,
2149                           VkImageCopy* to) {
2150     (void)alloc;
2151     (void)rootType;
2152     *to = *from;
2153     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
2154                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
2155     deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
2156     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
2157                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
2158     deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
2159     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
2160 }
2161 
deepcopy_VkImageResolve(Allocator * alloc,VkStructureType rootType,const VkImageResolve * from,VkImageResolve * to)2162 void deepcopy_VkImageResolve(Allocator* alloc, VkStructureType rootType, const VkImageResolve* from,
2163                              VkImageResolve* to) {
2164     (void)alloc;
2165     (void)rootType;
2166     *to = *from;
2167     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
2168                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
2169     deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
2170     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
2171                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
2172     deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
2173     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
2174 }
2175 
deepcopy_VkRenderPassBeginInfo(Allocator * alloc,VkStructureType rootType,const VkRenderPassBeginInfo * from,VkRenderPassBeginInfo * to)2176 void deepcopy_VkRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
2177                                     const VkRenderPassBeginInfo* from, VkRenderPassBeginInfo* to) {
2178     (void)alloc;
2179     (void)rootType;
2180     *to = *from;
2181     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2182         rootType = from->sType;
2183     }
2184     const void* from_pNext = from;
2185     size_t pNext_size = 0u;
2186     while (!pNext_size && from_pNext) {
2187         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2188         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2189     }
2190     to->pNext = nullptr;
2191     if (pNext_size) {
2192         to->pNext = (void*)alloc->alloc(pNext_size);
2193         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2194     }
2195     deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
2196     if (from) {
2197         to->pClearValues = nullptr;
2198         if (from->pClearValues) {
2199             to->pClearValues =
2200                 (VkClearValue*)alloc->alloc(from->clearValueCount * sizeof(const VkClearValue));
2201             to->clearValueCount = from->clearValueCount;
2202             for (uint32_t i = 0; i < (uint32_t)from->clearValueCount; ++i) {
2203                 deepcopy_VkClearValue(alloc, rootType, from->pClearValues + i,
2204                                       (VkClearValue*)(to->pClearValues + i));
2205             }
2206         }
2207     }
2208 }
2209 
2210 #endif
2211 #ifdef VK_VERSION_1_1
deepcopy_VkPhysicalDeviceSubgroupProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSubgroupProperties * from,VkPhysicalDeviceSubgroupProperties * to)2212 void deepcopy_VkPhysicalDeviceSubgroupProperties(Allocator* alloc, VkStructureType rootType,
2213                                                  const VkPhysicalDeviceSubgroupProperties* from,
2214                                                  VkPhysicalDeviceSubgroupProperties* to) {
2215     (void)alloc;
2216     (void)rootType;
2217     *to = *from;
2218     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2219         rootType = from->sType;
2220     }
2221     const void* from_pNext = from;
2222     size_t pNext_size = 0u;
2223     while (!pNext_size && from_pNext) {
2224         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2225         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2226     }
2227     to->pNext = nullptr;
2228     if (pNext_size) {
2229         to->pNext = (void*)alloc->alloc(pNext_size);
2230         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2231     }
2232 }
2233 
deepcopy_VkBindBufferMemoryInfo(Allocator * alloc,VkStructureType rootType,const VkBindBufferMemoryInfo * from,VkBindBufferMemoryInfo * to)2234 void deepcopy_VkBindBufferMemoryInfo(Allocator* alloc, VkStructureType rootType,
2235                                      const VkBindBufferMemoryInfo* from,
2236                                      VkBindBufferMemoryInfo* to) {
2237     (void)alloc;
2238     (void)rootType;
2239     *to = *from;
2240     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2241         rootType = from->sType;
2242     }
2243     const void* from_pNext = from;
2244     size_t pNext_size = 0u;
2245     while (!pNext_size && from_pNext) {
2246         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2247         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2248     }
2249     to->pNext = nullptr;
2250     if (pNext_size) {
2251         to->pNext = (void*)alloc->alloc(pNext_size);
2252         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2253     }
2254 }
2255 
deepcopy_VkBindImageMemoryInfo(Allocator * alloc,VkStructureType rootType,const VkBindImageMemoryInfo * from,VkBindImageMemoryInfo * to)2256 void deepcopy_VkBindImageMemoryInfo(Allocator* alloc, VkStructureType rootType,
2257                                     const VkBindImageMemoryInfo* from, VkBindImageMemoryInfo* to) {
2258     (void)alloc;
2259     (void)rootType;
2260     *to = *from;
2261     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2262         rootType = from->sType;
2263     }
2264     const void* from_pNext = from;
2265     size_t pNext_size = 0u;
2266     while (!pNext_size && from_pNext) {
2267         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2268         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2269     }
2270     to->pNext = nullptr;
2271     if (pNext_size) {
2272         to->pNext = (void*)alloc->alloc(pNext_size);
2273         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2274     }
2275 }
2276 
deepcopy_VkPhysicalDevice16BitStorageFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevice16BitStorageFeatures * from,VkPhysicalDevice16BitStorageFeatures * to)2277 void deepcopy_VkPhysicalDevice16BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
2278                                                    const VkPhysicalDevice16BitStorageFeatures* from,
2279                                                    VkPhysicalDevice16BitStorageFeatures* to) {
2280     (void)alloc;
2281     (void)rootType;
2282     *to = *from;
2283     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2284         rootType = from->sType;
2285     }
2286     const void* from_pNext = from;
2287     size_t pNext_size = 0u;
2288     while (!pNext_size && from_pNext) {
2289         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2290         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2291     }
2292     to->pNext = nullptr;
2293     if (pNext_size) {
2294         to->pNext = (void*)alloc->alloc(pNext_size);
2295         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2296     }
2297 }
2298 
deepcopy_VkMemoryDedicatedRequirements(Allocator * alloc,VkStructureType rootType,const VkMemoryDedicatedRequirements * from,VkMemoryDedicatedRequirements * to)2299 void deepcopy_VkMemoryDedicatedRequirements(Allocator* alloc, VkStructureType rootType,
2300                                             const VkMemoryDedicatedRequirements* from,
2301                                             VkMemoryDedicatedRequirements* to) {
2302     (void)alloc;
2303     (void)rootType;
2304     *to = *from;
2305     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2306         rootType = from->sType;
2307     }
2308     const void* from_pNext = from;
2309     size_t pNext_size = 0u;
2310     while (!pNext_size && from_pNext) {
2311         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2312         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2313     }
2314     to->pNext = nullptr;
2315     if (pNext_size) {
2316         to->pNext = (void*)alloc->alloc(pNext_size);
2317         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2318     }
2319 }
2320 
deepcopy_VkMemoryDedicatedAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryDedicatedAllocateInfo * from,VkMemoryDedicatedAllocateInfo * to)2321 void deepcopy_VkMemoryDedicatedAllocateInfo(Allocator* alloc, VkStructureType rootType,
2322                                             const VkMemoryDedicatedAllocateInfo* from,
2323                                             VkMemoryDedicatedAllocateInfo* to) {
2324     (void)alloc;
2325     (void)rootType;
2326     *to = *from;
2327     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2328         rootType = from->sType;
2329     }
2330     const void* from_pNext = from;
2331     size_t pNext_size = 0u;
2332     while (!pNext_size && from_pNext) {
2333         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2334         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2335     }
2336     to->pNext = nullptr;
2337     if (pNext_size) {
2338         to->pNext = (void*)alloc->alloc(pNext_size);
2339         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2340     }
2341 }
2342 
deepcopy_VkMemoryAllocateFlagsInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryAllocateFlagsInfo * from,VkMemoryAllocateFlagsInfo * to)2343 void deepcopy_VkMemoryAllocateFlagsInfo(Allocator* alloc, VkStructureType rootType,
2344                                         const VkMemoryAllocateFlagsInfo* from,
2345                                         VkMemoryAllocateFlagsInfo* to) {
2346     (void)alloc;
2347     (void)rootType;
2348     *to = *from;
2349     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2350         rootType = from->sType;
2351     }
2352     const void* from_pNext = from;
2353     size_t pNext_size = 0u;
2354     while (!pNext_size && from_pNext) {
2355         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2356         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2357     }
2358     to->pNext = nullptr;
2359     if (pNext_size) {
2360         to->pNext = (void*)alloc->alloc(pNext_size);
2361         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2362     }
2363 }
2364 
deepcopy_VkDeviceGroupRenderPassBeginInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceGroupRenderPassBeginInfo * from,VkDeviceGroupRenderPassBeginInfo * to)2365 void deepcopy_VkDeviceGroupRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
2366                                                const VkDeviceGroupRenderPassBeginInfo* from,
2367                                                VkDeviceGroupRenderPassBeginInfo* to) {
2368     (void)alloc;
2369     (void)rootType;
2370     *to = *from;
2371     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2372         rootType = from->sType;
2373     }
2374     const void* from_pNext = from;
2375     size_t pNext_size = 0u;
2376     while (!pNext_size && from_pNext) {
2377         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2378         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2379     }
2380     to->pNext = nullptr;
2381     if (pNext_size) {
2382         to->pNext = (void*)alloc->alloc(pNext_size);
2383         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2384     }
2385     if (from) {
2386         to->pDeviceRenderAreas = nullptr;
2387         if (from->pDeviceRenderAreas) {
2388             to->pDeviceRenderAreas =
2389                 (VkRect2D*)alloc->alloc(from->deviceRenderAreaCount * sizeof(const VkRect2D));
2390             to->deviceRenderAreaCount = from->deviceRenderAreaCount;
2391             for (uint32_t i = 0; i < (uint32_t)from->deviceRenderAreaCount; ++i) {
2392                 deepcopy_VkRect2D(alloc, rootType, from->pDeviceRenderAreas + i,
2393                                   (VkRect2D*)(to->pDeviceRenderAreas + i));
2394             }
2395         }
2396     }
2397 }
2398 
deepcopy_VkDeviceGroupCommandBufferBeginInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceGroupCommandBufferBeginInfo * from,VkDeviceGroupCommandBufferBeginInfo * to)2399 void deepcopy_VkDeviceGroupCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
2400                                                   const VkDeviceGroupCommandBufferBeginInfo* from,
2401                                                   VkDeviceGroupCommandBufferBeginInfo* to) {
2402     (void)alloc;
2403     (void)rootType;
2404     *to = *from;
2405     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2406         rootType = from->sType;
2407     }
2408     const void* from_pNext = from;
2409     size_t pNext_size = 0u;
2410     while (!pNext_size && from_pNext) {
2411         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2412         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2413     }
2414     to->pNext = nullptr;
2415     if (pNext_size) {
2416         to->pNext = (void*)alloc->alloc(pNext_size);
2417         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2418     }
2419 }
2420 
deepcopy_VkDeviceGroupSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceGroupSubmitInfo * from,VkDeviceGroupSubmitInfo * to)2421 void deepcopy_VkDeviceGroupSubmitInfo(Allocator* alloc, VkStructureType rootType,
2422                                       const VkDeviceGroupSubmitInfo* from,
2423                                       VkDeviceGroupSubmitInfo* to) {
2424     (void)alloc;
2425     (void)rootType;
2426     *to = *from;
2427     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2428         rootType = from->sType;
2429     }
2430     const void* from_pNext = from;
2431     size_t pNext_size = 0u;
2432     while (!pNext_size && from_pNext) {
2433         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2434         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2435     }
2436     to->pNext = nullptr;
2437     if (pNext_size) {
2438         to->pNext = (void*)alloc->alloc(pNext_size);
2439         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2440     }
2441     to->pWaitSemaphoreDeviceIndices = nullptr;
2442     if (from->pWaitSemaphoreDeviceIndices) {
2443         to->pWaitSemaphoreDeviceIndices = (uint32_t*)alloc->dupArray(
2444             from->pWaitSemaphoreDeviceIndices, from->waitSemaphoreCount * sizeof(const uint32_t));
2445     }
2446     to->pCommandBufferDeviceMasks = nullptr;
2447     if (from->pCommandBufferDeviceMasks) {
2448         to->pCommandBufferDeviceMasks = (uint32_t*)alloc->dupArray(
2449             from->pCommandBufferDeviceMasks, from->commandBufferCount * sizeof(const uint32_t));
2450     }
2451     to->pSignalSemaphoreDeviceIndices = nullptr;
2452     if (from->pSignalSemaphoreDeviceIndices) {
2453         to->pSignalSemaphoreDeviceIndices =
2454             (uint32_t*)alloc->dupArray(from->pSignalSemaphoreDeviceIndices,
2455                                        from->signalSemaphoreCount * sizeof(const uint32_t));
2456     }
2457 }
2458 
deepcopy_VkDeviceGroupBindSparseInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceGroupBindSparseInfo * from,VkDeviceGroupBindSparseInfo * to)2459 void deepcopy_VkDeviceGroupBindSparseInfo(Allocator* alloc, VkStructureType rootType,
2460                                           const VkDeviceGroupBindSparseInfo* from,
2461                                           VkDeviceGroupBindSparseInfo* to) {
2462     (void)alloc;
2463     (void)rootType;
2464     *to = *from;
2465     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2466         rootType = from->sType;
2467     }
2468     const void* from_pNext = from;
2469     size_t pNext_size = 0u;
2470     while (!pNext_size && from_pNext) {
2471         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2472         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2473     }
2474     to->pNext = nullptr;
2475     if (pNext_size) {
2476         to->pNext = (void*)alloc->alloc(pNext_size);
2477         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2478     }
2479 }
2480 
deepcopy_VkBindBufferMemoryDeviceGroupInfo(Allocator * alloc,VkStructureType rootType,const VkBindBufferMemoryDeviceGroupInfo * from,VkBindBufferMemoryDeviceGroupInfo * to)2481 void deepcopy_VkBindBufferMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
2482                                                 const VkBindBufferMemoryDeviceGroupInfo* from,
2483                                                 VkBindBufferMemoryDeviceGroupInfo* to) {
2484     (void)alloc;
2485     (void)rootType;
2486     *to = *from;
2487     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2488         rootType = from->sType;
2489     }
2490     const void* from_pNext = from;
2491     size_t pNext_size = 0u;
2492     while (!pNext_size && from_pNext) {
2493         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2494         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2495     }
2496     to->pNext = nullptr;
2497     if (pNext_size) {
2498         to->pNext = (void*)alloc->alloc(pNext_size);
2499         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2500     }
2501     to->pDeviceIndices = nullptr;
2502     if (from->pDeviceIndices) {
2503         to->pDeviceIndices = (uint32_t*)alloc->dupArray(
2504             from->pDeviceIndices, from->deviceIndexCount * sizeof(const uint32_t));
2505     }
2506 }
2507 
deepcopy_VkBindImageMemoryDeviceGroupInfo(Allocator * alloc,VkStructureType rootType,const VkBindImageMemoryDeviceGroupInfo * from,VkBindImageMemoryDeviceGroupInfo * to)2508 void deepcopy_VkBindImageMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
2509                                                const VkBindImageMemoryDeviceGroupInfo* from,
2510                                                VkBindImageMemoryDeviceGroupInfo* to) {
2511     (void)alloc;
2512     (void)rootType;
2513     *to = *from;
2514     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2515         rootType = from->sType;
2516     }
2517     const void* from_pNext = from;
2518     size_t pNext_size = 0u;
2519     while (!pNext_size && from_pNext) {
2520         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2521         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2522     }
2523     to->pNext = nullptr;
2524     if (pNext_size) {
2525         to->pNext = (void*)alloc->alloc(pNext_size);
2526         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2527     }
2528     to->pDeviceIndices = nullptr;
2529     if (from->pDeviceIndices) {
2530         to->pDeviceIndices = (uint32_t*)alloc->dupArray(
2531             from->pDeviceIndices, from->deviceIndexCount * sizeof(const uint32_t));
2532     }
2533     if (from) {
2534         to->pSplitInstanceBindRegions = nullptr;
2535         if (from->pSplitInstanceBindRegions) {
2536             to->pSplitInstanceBindRegions = (VkRect2D*)alloc->alloc(
2537                 from->splitInstanceBindRegionCount * sizeof(const VkRect2D));
2538             to->splitInstanceBindRegionCount = from->splitInstanceBindRegionCount;
2539             for (uint32_t i = 0; i < (uint32_t)from->splitInstanceBindRegionCount; ++i) {
2540                 deepcopy_VkRect2D(alloc, rootType, from->pSplitInstanceBindRegions + i,
2541                                   (VkRect2D*)(to->pSplitInstanceBindRegions + i));
2542             }
2543         }
2544     }
2545 }
2546 
deepcopy_VkPhysicalDeviceGroupProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceGroupProperties * from,VkPhysicalDeviceGroupProperties * to)2547 void deepcopy_VkPhysicalDeviceGroupProperties(Allocator* alloc, VkStructureType rootType,
2548                                               const VkPhysicalDeviceGroupProperties* from,
2549                                               VkPhysicalDeviceGroupProperties* to) {
2550     (void)alloc;
2551     (void)rootType;
2552     *to = *from;
2553     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2554         rootType = from->sType;
2555     }
2556     const void* from_pNext = from;
2557     size_t pNext_size = 0u;
2558     while (!pNext_size && from_pNext) {
2559         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2560         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2561     }
2562     to->pNext = nullptr;
2563     if (pNext_size) {
2564         to->pNext = (void*)alloc->alloc(pNext_size);
2565         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2566     }
2567     memcpy(to->physicalDevices, from->physicalDevices,
2568            VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice));
2569 }
2570 
deepcopy_VkDeviceGroupDeviceCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceGroupDeviceCreateInfo * from,VkDeviceGroupDeviceCreateInfo * to)2571 void deepcopy_VkDeviceGroupDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
2572                                             const VkDeviceGroupDeviceCreateInfo* from,
2573                                             VkDeviceGroupDeviceCreateInfo* to) {
2574     (void)alloc;
2575     (void)rootType;
2576     *to = *from;
2577     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2578         rootType = from->sType;
2579     }
2580     const void* from_pNext = from;
2581     size_t pNext_size = 0u;
2582     while (!pNext_size && from_pNext) {
2583         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2584         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2585     }
2586     to->pNext = nullptr;
2587     if (pNext_size) {
2588         to->pNext = (void*)alloc->alloc(pNext_size);
2589         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2590     }
2591     to->pPhysicalDevices = nullptr;
2592     if (from->pPhysicalDevices) {
2593         to->pPhysicalDevices = (VkPhysicalDevice*)alloc->dupArray(
2594             from->pPhysicalDevices, from->physicalDeviceCount * sizeof(const VkPhysicalDevice));
2595     }
2596 }
2597 
deepcopy_VkBufferMemoryRequirementsInfo2(Allocator * alloc,VkStructureType rootType,const VkBufferMemoryRequirementsInfo2 * from,VkBufferMemoryRequirementsInfo2 * to)2598 void deepcopy_VkBufferMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
2599                                               const VkBufferMemoryRequirementsInfo2* from,
2600                                               VkBufferMemoryRequirementsInfo2* to) {
2601     (void)alloc;
2602     (void)rootType;
2603     *to = *from;
2604     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2605         rootType = from->sType;
2606     }
2607     const void* from_pNext = from;
2608     size_t pNext_size = 0u;
2609     while (!pNext_size && from_pNext) {
2610         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2611         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2612     }
2613     to->pNext = nullptr;
2614     if (pNext_size) {
2615         to->pNext = (void*)alloc->alloc(pNext_size);
2616         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2617     }
2618 }
2619 
deepcopy_VkImageMemoryRequirementsInfo2(Allocator * alloc,VkStructureType rootType,const VkImageMemoryRequirementsInfo2 * from,VkImageMemoryRequirementsInfo2 * to)2620 void deepcopy_VkImageMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
2621                                              const VkImageMemoryRequirementsInfo2* from,
2622                                              VkImageMemoryRequirementsInfo2* to) {
2623     (void)alloc;
2624     (void)rootType;
2625     *to = *from;
2626     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2627         rootType = from->sType;
2628     }
2629     const void* from_pNext = from;
2630     size_t pNext_size = 0u;
2631     while (!pNext_size && from_pNext) {
2632         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2633         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2634     }
2635     to->pNext = nullptr;
2636     if (pNext_size) {
2637         to->pNext = (void*)alloc->alloc(pNext_size);
2638         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2639     }
2640 }
2641 
deepcopy_VkImageSparseMemoryRequirementsInfo2(Allocator * alloc,VkStructureType rootType,const VkImageSparseMemoryRequirementsInfo2 * from,VkImageSparseMemoryRequirementsInfo2 * to)2642 void deepcopy_VkImageSparseMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
2643                                                    const VkImageSparseMemoryRequirementsInfo2* from,
2644                                                    VkImageSparseMemoryRequirementsInfo2* to) {
2645     (void)alloc;
2646     (void)rootType;
2647     *to = *from;
2648     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2649         rootType = from->sType;
2650     }
2651     const void* from_pNext = from;
2652     size_t pNext_size = 0u;
2653     while (!pNext_size && from_pNext) {
2654         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2655         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2656     }
2657     to->pNext = nullptr;
2658     if (pNext_size) {
2659         to->pNext = (void*)alloc->alloc(pNext_size);
2660         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2661     }
2662 }
2663 
deepcopy_VkMemoryRequirements2(Allocator * alloc,VkStructureType rootType,const VkMemoryRequirements2 * from,VkMemoryRequirements2 * to)2664 void deepcopy_VkMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
2665                                     const VkMemoryRequirements2* from, VkMemoryRequirements2* to) {
2666     (void)alloc;
2667     (void)rootType;
2668     *to = *from;
2669     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2670         rootType = from->sType;
2671     }
2672     const void* from_pNext = from;
2673     size_t pNext_size = 0u;
2674     while (!pNext_size && from_pNext) {
2675         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2676         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2677     }
2678     to->pNext = nullptr;
2679     if (pNext_size) {
2680         to->pNext = (void*)alloc->alloc(pNext_size);
2681         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2682     }
2683     deepcopy_VkMemoryRequirements(alloc, rootType, &from->memoryRequirements,
2684                                   (VkMemoryRequirements*)(&to->memoryRequirements));
2685 }
2686 
deepcopy_VkSparseImageMemoryRequirements2(Allocator * alloc,VkStructureType rootType,const VkSparseImageMemoryRequirements2 * from,VkSparseImageMemoryRequirements2 * to)2687 void deepcopy_VkSparseImageMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
2688                                                const VkSparseImageMemoryRequirements2* from,
2689                                                VkSparseImageMemoryRequirements2* to) {
2690     (void)alloc;
2691     (void)rootType;
2692     *to = *from;
2693     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2694         rootType = from->sType;
2695     }
2696     const void* from_pNext = from;
2697     size_t pNext_size = 0u;
2698     while (!pNext_size && from_pNext) {
2699         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2700         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2701     }
2702     to->pNext = nullptr;
2703     if (pNext_size) {
2704         to->pNext = (void*)alloc->alloc(pNext_size);
2705         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2706     }
2707     deepcopy_VkSparseImageMemoryRequirements(
2708         alloc, rootType, &from->memoryRequirements,
2709         (VkSparseImageMemoryRequirements*)(&to->memoryRequirements));
2710 }
2711 
deepcopy_VkPhysicalDeviceFeatures2(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceFeatures2 * from,VkPhysicalDeviceFeatures2 * to)2712 void deepcopy_VkPhysicalDeviceFeatures2(Allocator* alloc, VkStructureType rootType,
2713                                         const VkPhysicalDeviceFeatures2* from,
2714                                         VkPhysicalDeviceFeatures2* to) {
2715     (void)alloc;
2716     (void)rootType;
2717     *to = *from;
2718     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2719         rootType = from->sType;
2720     }
2721     const void* from_pNext = from;
2722     size_t pNext_size = 0u;
2723     while (!pNext_size && from_pNext) {
2724         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2725         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2726     }
2727     to->pNext = nullptr;
2728     if (pNext_size) {
2729         to->pNext = (void*)alloc->alloc(pNext_size);
2730         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2731     }
2732     deepcopy_VkPhysicalDeviceFeatures(alloc, rootType, &from->features,
2733                                       (VkPhysicalDeviceFeatures*)(&to->features));
2734 }
2735 
deepcopy_VkPhysicalDeviceProperties2(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProperties2 * from,VkPhysicalDeviceProperties2 * to)2736 void deepcopy_VkPhysicalDeviceProperties2(Allocator* alloc, VkStructureType rootType,
2737                                           const VkPhysicalDeviceProperties2* from,
2738                                           VkPhysicalDeviceProperties2* to) {
2739     (void)alloc;
2740     (void)rootType;
2741     *to = *from;
2742     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2743         rootType = from->sType;
2744     }
2745     const void* from_pNext = from;
2746     size_t pNext_size = 0u;
2747     while (!pNext_size && from_pNext) {
2748         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2749         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2750     }
2751     to->pNext = nullptr;
2752     if (pNext_size) {
2753         to->pNext = (void*)alloc->alloc(pNext_size);
2754         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2755     }
2756     deepcopy_VkPhysicalDeviceProperties(alloc, rootType, &from->properties,
2757                                         (VkPhysicalDeviceProperties*)(&to->properties));
2758 }
2759 
deepcopy_VkFormatProperties2(Allocator * alloc,VkStructureType rootType,const VkFormatProperties2 * from,VkFormatProperties2 * to)2760 void deepcopy_VkFormatProperties2(Allocator* alloc, VkStructureType rootType,
2761                                   const VkFormatProperties2* from, VkFormatProperties2* to) {
2762     (void)alloc;
2763     (void)rootType;
2764     *to = *from;
2765     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2766         rootType = from->sType;
2767     }
2768     const void* from_pNext = from;
2769     size_t pNext_size = 0u;
2770     while (!pNext_size && from_pNext) {
2771         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2772         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2773     }
2774     to->pNext = nullptr;
2775     if (pNext_size) {
2776         to->pNext = (void*)alloc->alloc(pNext_size);
2777         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2778     }
2779     deepcopy_VkFormatProperties(alloc, rootType, &from->formatProperties,
2780                                 (VkFormatProperties*)(&to->formatProperties));
2781 }
2782 
deepcopy_VkImageFormatProperties2(Allocator * alloc,VkStructureType rootType,const VkImageFormatProperties2 * from,VkImageFormatProperties2 * to)2783 void deepcopy_VkImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
2784                                        const VkImageFormatProperties2* from,
2785                                        VkImageFormatProperties2* to) {
2786     (void)alloc;
2787     (void)rootType;
2788     *to = *from;
2789     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2790         rootType = from->sType;
2791     }
2792     const void* from_pNext = from;
2793     size_t pNext_size = 0u;
2794     while (!pNext_size && from_pNext) {
2795         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2796         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2797     }
2798     to->pNext = nullptr;
2799     if (pNext_size) {
2800         to->pNext = (void*)alloc->alloc(pNext_size);
2801         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2802     }
2803     deepcopy_VkImageFormatProperties(alloc, rootType, &from->imageFormatProperties,
2804                                      (VkImageFormatProperties*)(&to->imageFormatProperties));
2805 }
2806 
deepcopy_VkPhysicalDeviceImageFormatInfo2(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImageFormatInfo2 * from,VkPhysicalDeviceImageFormatInfo2 * to)2807 void deepcopy_VkPhysicalDeviceImageFormatInfo2(Allocator* alloc, VkStructureType rootType,
2808                                                const VkPhysicalDeviceImageFormatInfo2* from,
2809                                                VkPhysicalDeviceImageFormatInfo2* to) {
2810     (void)alloc;
2811     (void)rootType;
2812     *to = *from;
2813     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2814         rootType = from->sType;
2815     }
2816     const void* from_pNext = from;
2817     size_t pNext_size = 0u;
2818     while (!pNext_size && from_pNext) {
2819         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2820         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2821     }
2822     to->pNext = nullptr;
2823     if (pNext_size) {
2824         to->pNext = (void*)alloc->alloc(pNext_size);
2825         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2826     }
2827 }
2828 
deepcopy_VkQueueFamilyProperties2(Allocator * alloc,VkStructureType rootType,const VkQueueFamilyProperties2 * from,VkQueueFamilyProperties2 * to)2829 void deepcopy_VkQueueFamilyProperties2(Allocator* alloc, VkStructureType rootType,
2830                                        const VkQueueFamilyProperties2* from,
2831                                        VkQueueFamilyProperties2* to) {
2832     (void)alloc;
2833     (void)rootType;
2834     *to = *from;
2835     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2836         rootType = from->sType;
2837     }
2838     const void* from_pNext = from;
2839     size_t pNext_size = 0u;
2840     while (!pNext_size && from_pNext) {
2841         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2842         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2843     }
2844     to->pNext = nullptr;
2845     if (pNext_size) {
2846         to->pNext = (void*)alloc->alloc(pNext_size);
2847         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2848     }
2849     deepcopy_VkQueueFamilyProperties(alloc, rootType, &from->queueFamilyProperties,
2850                                      (VkQueueFamilyProperties*)(&to->queueFamilyProperties));
2851 }
2852 
deepcopy_VkPhysicalDeviceMemoryProperties2(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMemoryProperties2 * from,VkPhysicalDeviceMemoryProperties2 * to)2853 void deepcopy_VkPhysicalDeviceMemoryProperties2(Allocator* alloc, VkStructureType rootType,
2854                                                 const VkPhysicalDeviceMemoryProperties2* from,
2855                                                 VkPhysicalDeviceMemoryProperties2* to) {
2856     (void)alloc;
2857     (void)rootType;
2858     *to = *from;
2859     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2860         rootType = from->sType;
2861     }
2862     const void* from_pNext = from;
2863     size_t pNext_size = 0u;
2864     while (!pNext_size && from_pNext) {
2865         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2866         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2867     }
2868     to->pNext = nullptr;
2869     if (pNext_size) {
2870         to->pNext = (void*)alloc->alloc(pNext_size);
2871         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2872     }
2873     deepcopy_VkPhysicalDeviceMemoryProperties(
2874         alloc, rootType, &from->memoryProperties,
2875         (VkPhysicalDeviceMemoryProperties*)(&to->memoryProperties));
2876 }
2877 
deepcopy_VkSparseImageFormatProperties2(Allocator * alloc,VkStructureType rootType,const VkSparseImageFormatProperties2 * from,VkSparseImageFormatProperties2 * to)2878 void deepcopy_VkSparseImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
2879                                              const VkSparseImageFormatProperties2* from,
2880                                              VkSparseImageFormatProperties2* to) {
2881     (void)alloc;
2882     (void)rootType;
2883     *to = *from;
2884     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2885         rootType = from->sType;
2886     }
2887     const void* from_pNext = from;
2888     size_t pNext_size = 0u;
2889     while (!pNext_size && from_pNext) {
2890         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2891         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2892     }
2893     to->pNext = nullptr;
2894     if (pNext_size) {
2895         to->pNext = (void*)alloc->alloc(pNext_size);
2896         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2897     }
2898     deepcopy_VkSparseImageFormatProperties(alloc, rootType, &from->properties,
2899                                            (VkSparseImageFormatProperties*)(&to->properties));
2900 }
2901 
deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSparseImageFormatInfo2 * from,VkPhysicalDeviceSparseImageFormatInfo2 * to)2902 void deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(
2903     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceSparseImageFormatInfo2* from,
2904     VkPhysicalDeviceSparseImageFormatInfo2* to) {
2905     (void)alloc;
2906     (void)rootType;
2907     *to = *from;
2908     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2909         rootType = from->sType;
2910     }
2911     const void* from_pNext = from;
2912     size_t pNext_size = 0u;
2913     while (!pNext_size && from_pNext) {
2914         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2915         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2916     }
2917     to->pNext = nullptr;
2918     if (pNext_size) {
2919         to->pNext = (void*)alloc->alloc(pNext_size);
2920         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2921     }
2922 }
2923 
deepcopy_VkPhysicalDevicePointClippingProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePointClippingProperties * from,VkPhysicalDevicePointClippingProperties * to)2924 void deepcopy_VkPhysicalDevicePointClippingProperties(
2925     Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePointClippingProperties* from,
2926     VkPhysicalDevicePointClippingProperties* to) {
2927     (void)alloc;
2928     (void)rootType;
2929     *to = *from;
2930     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2931         rootType = from->sType;
2932     }
2933     const void* from_pNext = from;
2934     size_t pNext_size = 0u;
2935     while (!pNext_size && from_pNext) {
2936         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2937         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2938     }
2939     to->pNext = nullptr;
2940     if (pNext_size) {
2941         to->pNext = (void*)alloc->alloc(pNext_size);
2942         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2943     }
2944 }
2945 
deepcopy_VkInputAttachmentAspectReference(Allocator * alloc,VkStructureType rootType,const VkInputAttachmentAspectReference * from,VkInputAttachmentAspectReference * to)2946 void deepcopy_VkInputAttachmentAspectReference(Allocator* alloc, VkStructureType rootType,
2947                                                const VkInputAttachmentAspectReference* from,
2948                                                VkInputAttachmentAspectReference* to) {
2949     (void)alloc;
2950     (void)rootType;
2951     *to = *from;
2952 }
2953 
deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(Allocator * alloc,VkStructureType rootType,const VkRenderPassInputAttachmentAspectCreateInfo * from,VkRenderPassInputAttachmentAspectCreateInfo * to)2954 void deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(
2955     Allocator* alloc, VkStructureType rootType,
2956     const VkRenderPassInputAttachmentAspectCreateInfo* from,
2957     VkRenderPassInputAttachmentAspectCreateInfo* to) {
2958     (void)alloc;
2959     (void)rootType;
2960     *to = *from;
2961     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2962         rootType = from->sType;
2963     }
2964     const void* from_pNext = from;
2965     size_t pNext_size = 0u;
2966     while (!pNext_size && from_pNext) {
2967         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
2968         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
2969     }
2970     to->pNext = nullptr;
2971     if (pNext_size) {
2972         to->pNext = (void*)alloc->alloc(pNext_size);
2973         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
2974     }
2975     if (from) {
2976         to->pAspectReferences = nullptr;
2977         if (from->pAspectReferences) {
2978             to->pAspectReferences = (VkInputAttachmentAspectReference*)alloc->alloc(
2979                 from->aspectReferenceCount * sizeof(const VkInputAttachmentAspectReference));
2980             to->aspectReferenceCount = from->aspectReferenceCount;
2981             for (uint32_t i = 0; i < (uint32_t)from->aspectReferenceCount; ++i) {
2982                 deepcopy_VkInputAttachmentAspectReference(
2983                     alloc, rootType, from->pAspectReferences + i,
2984                     (VkInputAttachmentAspectReference*)(to->pAspectReferences + i));
2985             }
2986         }
2987     }
2988 }
2989 
deepcopy_VkImageViewUsageCreateInfo(Allocator * alloc,VkStructureType rootType,const VkImageViewUsageCreateInfo * from,VkImageViewUsageCreateInfo * to)2990 void deepcopy_VkImageViewUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
2991                                          const VkImageViewUsageCreateInfo* from,
2992                                          VkImageViewUsageCreateInfo* to) {
2993     (void)alloc;
2994     (void)rootType;
2995     *to = *from;
2996     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
2997         rootType = from->sType;
2998     }
2999     const void* from_pNext = from;
3000     size_t pNext_size = 0u;
3001     while (!pNext_size && from_pNext) {
3002         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3003         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3004     }
3005     to->pNext = nullptr;
3006     if (pNext_size) {
3007         to->pNext = (void*)alloc->alloc(pNext_size);
3008         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3009     }
3010 }
3011 
deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineTessellationDomainOriginStateCreateInfo * from,VkPipelineTessellationDomainOriginStateCreateInfo * to)3012 void deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(
3013     Allocator* alloc, VkStructureType rootType,
3014     const VkPipelineTessellationDomainOriginStateCreateInfo* from,
3015     VkPipelineTessellationDomainOriginStateCreateInfo* to) {
3016     (void)alloc;
3017     (void)rootType;
3018     *to = *from;
3019     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3020         rootType = from->sType;
3021     }
3022     const void* from_pNext = from;
3023     size_t pNext_size = 0u;
3024     while (!pNext_size && from_pNext) {
3025         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3026         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3027     }
3028     to->pNext = nullptr;
3029     if (pNext_size) {
3030         to->pNext = (void*)alloc->alloc(pNext_size);
3031         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3032     }
3033 }
3034 
deepcopy_VkRenderPassMultiviewCreateInfo(Allocator * alloc,VkStructureType rootType,const VkRenderPassMultiviewCreateInfo * from,VkRenderPassMultiviewCreateInfo * to)3035 void deepcopy_VkRenderPassMultiviewCreateInfo(Allocator* alloc, VkStructureType rootType,
3036                                               const VkRenderPassMultiviewCreateInfo* from,
3037                                               VkRenderPassMultiviewCreateInfo* to) {
3038     (void)alloc;
3039     (void)rootType;
3040     *to = *from;
3041     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3042         rootType = from->sType;
3043     }
3044     const void* from_pNext = from;
3045     size_t pNext_size = 0u;
3046     while (!pNext_size && from_pNext) {
3047         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3048         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3049     }
3050     to->pNext = nullptr;
3051     if (pNext_size) {
3052         to->pNext = (void*)alloc->alloc(pNext_size);
3053         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3054     }
3055     to->pViewMasks = nullptr;
3056     if (from->pViewMasks) {
3057         to->pViewMasks = (uint32_t*)alloc->dupArray(from->pViewMasks,
3058                                                     from->subpassCount * sizeof(const uint32_t));
3059     }
3060     to->pViewOffsets = nullptr;
3061     if (from->pViewOffsets) {
3062         to->pViewOffsets = (int32_t*)alloc->dupArray(from->pViewOffsets,
3063                                                      from->dependencyCount * sizeof(const int32_t));
3064     }
3065     to->pCorrelationMasks = nullptr;
3066     if (from->pCorrelationMasks) {
3067         to->pCorrelationMasks = (uint32_t*)alloc->dupArray(
3068             from->pCorrelationMasks, from->correlationMaskCount * sizeof(const uint32_t));
3069     }
3070 }
3071 
deepcopy_VkPhysicalDeviceMultiviewFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMultiviewFeatures * from,VkPhysicalDeviceMultiviewFeatures * to)3072 void deepcopy_VkPhysicalDeviceMultiviewFeatures(Allocator* alloc, VkStructureType rootType,
3073                                                 const VkPhysicalDeviceMultiviewFeatures* from,
3074                                                 VkPhysicalDeviceMultiviewFeatures* to) {
3075     (void)alloc;
3076     (void)rootType;
3077     *to = *from;
3078     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3079         rootType = from->sType;
3080     }
3081     const void* from_pNext = from;
3082     size_t pNext_size = 0u;
3083     while (!pNext_size && from_pNext) {
3084         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3085         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3086     }
3087     to->pNext = nullptr;
3088     if (pNext_size) {
3089         to->pNext = (void*)alloc->alloc(pNext_size);
3090         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3091     }
3092 }
3093 
deepcopy_VkPhysicalDeviceMultiviewProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMultiviewProperties * from,VkPhysicalDeviceMultiviewProperties * to)3094 void deepcopy_VkPhysicalDeviceMultiviewProperties(Allocator* alloc, VkStructureType rootType,
3095                                                   const VkPhysicalDeviceMultiviewProperties* from,
3096                                                   VkPhysicalDeviceMultiviewProperties* to) {
3097     (void)alloc;
3098     (void)rootType;
3099     *to = *from;
3100     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3101         rootType = from->sType;
3102     }
3103     const void* from_pNext = from;
3104     size_t pNext_size = 0u;
3105     while (!pNext_size && from_pNext) {
3106         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3107         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3108     }
3109     to->pNext = nullptr;
3110     if (pNext_size) {
3111         to->pNext = (void*)alloc->alloc(pNext_size);
3112         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3113     }
3114 }
3115 
deepcopy_VkPhysicalDeviceVariablePointersFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVariablePointersFeatures * from,VkPhysicalDeviceVariablePointersFeatures * to)3116 void deepcopy_VkPhysicalDeviceVariablePointersFeatures(
3117     Allocator* alloc, VkStructureType rootType,
3118     const VkPhysicalDeviceVariablePointersFeatures* from,
3119     VkPhysicalDeviceVariablePointersFeatures* to) {
3120     (void)alloc;
3121     (void)rootType;
3122     *to = *from;
3123     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3124         rootType = from->sType;
3125     }
3126     const void* from_pNext = from;
3127     size_t pNext_size = 0u;
3128     while (!pNext_size && from_pNext) {
3129         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3130         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3131     }
3132     to->pNext = nullptr;
3133     if (pNext_size) {
3134         to->pNext = (void*)alloc->alloc(pNext_size);
3135         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3136     }
3137 }
3138 
deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProtectedMemoryFeatures * from,VkPhysicalDeviceProtectedMemoryFeatures * to)3139 void deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(
3140     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceProtectedMemoryFeatures* from,
3141     VkPhysicalDeviceProtectedMemoryFeatures* to) {
3142     (void)alloc;
3143     (void)rootType;
3144     *to = *from;
3145     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3146         rootType = from->sType;
3147     }
3148     const void* from_pNext = from;
3149     size_t pNext_size = 0u;
3150     while (!pNext_size && from_pNext) {
3151         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3152         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3153     }
3154     to->pNext = nullptr;
3155     if (pNext_size) {
3156         to->pNext = (void*)alloc->alloc(pNext_size);
3157         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3158     }
3159 }
3160 
deepcopy_VkPhysicalDeviceProtectedMemoryProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProtectedMemoryProperties * from,VkPhysicalDeviceProtectedMemoryProperties * to)3161 void deepcopy_VkPhysicalDeviceProtectedMemoryProperties(
3162     Allocator* alloc, VkStructureType rootType,
3163     const VkPhysicalDeviceProtectedMemoryProperties* from,
3164     VkPhysicalDeviceProtectedMemoryProperties* to) {
3165     (void)alloc;
3166     (void)rootType;
3167     *to = *from;
3168     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3169         rootType = from->sType;
3170     }
3171     const void* from_pNext = from;
3172     size_t pNext_size = 0u;
3173     while (!pNext_size && from_pNext) {
3174         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3175         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3176     }
3177     to->pNext = nullptr;
3178     if (pNext_size) {
3179         to->pNext = (void*)alloc->alloc(pNext_size);
3180         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3181     }
3182 }
3183 
deepcopy_VkDeviceQueueInfo2(Allocator * alloc,VkStructureType rootType,const VkDeviceQueueInfo2 * from,VkDeviceQueueInfo2 * to)3184 void deepcopy_VkDeviceQueueInfo2(Allocator* alloc, VkStructureType rootType,
3185                                  const VkDeviceQueueInfo2* from, VkDeviceQueueInfo2* to) {
3186     (void)alloc;
3187     (void)rootType;
3188     *to = *from;
3189     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3190         rootType = from->sType;
3191     }
3192     const void* from_pNext = from;
3193     size_t pNext_size = 0u;
3194     while (!pNext_size && from_pNext) {
3195         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3196         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3197     }
3198     to->pNext = nullptr;
3199     if (pNext_size) {
3200         to->pNext = (void*)alloc->alloc(pNext_size);
3201         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3202     }
3203 }
3204 
deepcopy_VkProtectedSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkProtectedSubmitInfo * from,VkProtectedSubmitInfo * to)3205 void deepcopy_VkProtectedSubmitInfo(Allocator* alloc, VkStructureType rootType,
3206                                     const VkProtectedSubmitInfo* from, VkProtectedSubmitInfo* to) {
3207     (void)alloc;
3208     (void)rootType;
3209     *to = *from;
3210     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3211         rootType = from->sType;
3212     }
3213     const void* from_pNext = from;
3214     size_t pNext_size = 0u;
3215     while (!pNext_size && from_pNext) {
3216         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3217         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3218     }
3219     to->pNext = nullptr;
3220     if (pNext_size) {
3221         to->pNext = (void*)alloc->alloc(pNext_size);
3222         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3223     }
3224 }
3225 
deepcopy_VkSamplerYcbcrConversionCreateInfo(Allocator * alloc,VkStructureType rootType,const VkSamplerYcbcrConversionCreateInfo * from,VkSamplerYcbcrConversionCreateInfo * to)3226 void deepcopy_VkSamplerYcbcrConversionCreateInfo(Allocator* alloc, VkStructureType rootType,
3227                                                  const VkSamplerYcbcrConversionCreateInfo* from,
3228                                                  VkSamplerYcbcrConversionCreateInfo* to) {
3229     (void)alloc;
3230     (void)rootType;
3231     *to = *from;
3232     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3233         rootType = from->sType;
3234     }
3235     const void* from_pNext = from;
3236     size_t pNext_size = 0u;
3237     while (!pNext_size && from_pNext) {
3238         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3239         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3240     }
3241     to->pNext = nullptr;
3242     if (pNext_size) {
3243         to->pNext = (void*)alloc->alloc(pNext_size);
3244         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3245     }
3246     deepcopy_VkComponentMapping(alloc, rootType, &from->components,
3247                                 (VkComponentMapping*)(&to->components));
3248 }
3249 
deepcopy_VkSamplerYcbcrConversionInfo(Allocator * alloc,VkStructureType rootType,const VkSamplerYcbcrConversionInfo * from,VkSamplerYcbcrConversionInfo * to)3250 void deepcopy_VkSamplerYcbcrConversionInfo(Allocator* alloc, VkStructureType rootType,
3251                                            const VkSamplerYcbcrConversionInfo* from,
3252                                            VkSamplerYcbcrConversionInfo* to) {
3253     (void)alloc;
3254     (void)rootType;
3255     *to = *from;
3256     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3257         rootType = from->sType;
3258     }
3259     const void* from_pNext = from;
3260     size_t pNext_size = 0u;
3261     while (!pNext_size && from_pNext) {
3262         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3263         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3264     }
3265     to->pNext = nullptr;
3266     if (pNext_size) {
3267         to->pNext = (void*)alloc->alloc(pNext_size);
3268         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3269     }
3270 }
3271 
deepcopy_VkBindImagePlaneMemoryInfo(Allocator * alloc,VkStructureType rootType,const VkBindImagePlaneMemoryInfo * from,VkBindImagePlaneMemoryInfo * to)3272 void deepcopy_VkBindImagePlaneMemoryInfo(Allocator* alloc, VkStructureType rootType,
3273                                          const VkBindImagePlaneMemoryInfo* from,
3274                                          VkBindImagePlaneMemoryInfo* to) {
3275     (void)alloc;
3276     (void)rootType;
3277     *to = *from;
3278     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3279         rootType = from->sType;
3280     }
3281     const void* from_pNext = from;
3282     size_t pNext_size = 0u;
3283     while (!pNext_size && from_pNext) {
3284         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3285         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3286     }
3287     to->pNext = nullptr;
3288     if (pNext_size) {
3289         to->pNext = (void*)alloc->alloc(pNext_size);
3290         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3291     }
3292 }
3293 
deepcopy_VkImagePlaneMemoryRequirementsInfo(Allocator * alloc,VkStructureType rootType,const VkImagePlaneMemoryRequirementsInfo * from,VkImagePlaneMemoryRequirementsInfo * to)3294 void deepcopy_VkImagePlaneMemoryRequirementsInfo(Allocator* alloc, VkStructureType rootType,
3295                                                  const VkImagePlaneMemoryRequirementsInfo* from,
3296                                                  VkImagePlaneMemoryRequirementsInfo* to) {
3297     (void)alloc;
3298     (void)rootType;
3299     *to = *from;
3300     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3301         rootType = from->sType;
3302     }
3303     const void* from_pNext = from;
3304     size_t pNext_size = 0u;
3305     while (!pNext_size && from_pNext) {
3306         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3307         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3308     }
3309     to->pNext = nullptr;
3310     if (pNext_size) {
3311         to->pNext = (void*)alloc->alloc(pNext_size);
3312         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3313     }
3314 }
3315 
deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSamplerYcbcrConversionFeatures * from,VkPhysicalDeviceSamplerYcbcrConversionFeatures * to)3316 void deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
3317     Allocator* alloc, VkStructureType rootType,
3318     const VkPhysicalDeviceSamplerYcbcrConversionFeatures* from,
3319     VkPhysicalDeviceSamplerYcbcrConversionFeatures* to) {
3320     (void)alloc;
3321     (void)rootType;
3322     *to = *from;
3323     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3324         rootType = from->sType;
3325     }
3326     const void* from_pNext = from;
3327     size_t pNext_size = 0u;
3328     while (!pNext_size && from_pNext) {
3329         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3330         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3331     }
3332     to->pNext = nullptr;
3333     if (pNext_size) {
3334         to->pNext = (void*)alloc->alloc(pNext_size);
3335         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3336     }
3337 }
3338 
deepcopy_VkSamplerYcbcrConversionImageFormatProperties(Allocator * alloc,VkStructureType rootType,const VkSamplerYcbcrConversionImageFormatProperties * from,VkSamplerYcbcrConversionImageFormatProperties * to)3339 void deepcopy_VkSamplerYcbcrConversionImageFormatProperties(
3340     Allocator* alloc, VkStructureType rootType,
3341     const VkSamplerYcbcrConversionImageFormatProperties* from,
3342     VkSamplerYcbcrConversionImageFormatProperties* to) {
3343     (void)alloc;
3344     (void)rootType;
3345     *to = *from;
3346     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3347         rootType = from->sType;
3348     }
3349     const void* from_pNext = from;
3350     size_t pNext_size = 0u;
3351     while (!pNext_size && from_pNext) {
3352         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3353         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3354     }
3355     to->pNext = nullptr;
3356     if (pNext_size) {
3357         to->pNext = (void*)alloc->alloc(pNext_size);
3358         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3359     }
3360 }
3361 
deepcopy_VkDescriptorUpdateTemplateEntry(Allocator * alloc,VkStructureType rootType,const VkDescriptorUpdateTemplateEntry * from,VkDescriptorUpdateTemplateEntry * to)3362 void deepcopy_VkDescriptorUpdateTemplateEntry(Allocator* alloc, VkStructureType rootType,
3363                                               const VkDescriptorUpdateTemplateEntry* from,
3364                                               VkDescriptorUpdateTemplateEntry* to) {
3365     (void)alloc;
3366     (void)rootType;
3367     *to = *from;
3368 }
3369 
deepcopy_VkDescriptorUpdateTemplateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorUpdateTemplateCreateInfo * from,VkDescriptorUpdateTemplateCreateInfo * to)3370 void deepcopy_VkDescriptorUpdateTemplateCreateInfo(Allocator* alloc, VkStructureType rootType,
3371                                                    const VkDescriptorUpdateTemplateCreateInfo* from,
3372                                                    VkDescriptorUpdateTemplateCreateInfo* to) {
3373     (void)alloc;
3374     (void)rootType;
3375     *to = *from;
3376     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3377         rootType = from->sType;
3378     }
3379     const void* from_pNext = from;
3380     size_t pNext_size = 0u;
3381     while (!pNext_size && from_pNext) {
3382         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3383         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3384     }
3385     to->pNext = nullptr;
3386     if (pNext_size) {
3387         to->pNext = (void*)alloc->alloc(pNext_size);
3388         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3389     }
3390     if (from) {
3391         to->pDescriptorUpdateEntries = nullptr;
3392         if (from->pDescriptorUpdateEntries) {
3393             to->pDescriptorUpdateEntries = (VkDescriptorUpdateTemplateEntry*)alloc->alloc(
3394                 from->descriptorUpdateEntryCount * sizeof(const VkDescriptorUpdateTemplateEntry));
3395             to->descriptorUpdateEntryCount = from->descriptorUpdateEntryCount;
3396             for (uint32_t i = 0; i < (uint32_t)from->descriptorUpdateEntryCount; ++i) {
3397                 deepcopy_VkDescriptorUpdateTemplateEntry(
3398                     alloc, rootType, from->pDescriptorUpdateEntries + i,
3399                     (VkDescriptorUpdateTemplateEntry*)(to->pDescriptorUpdateEntries + i));
3400             }
3401         }
3402     }
3403 }
3404 
deepcopy_VkExternalMemoryProperties(Allocator * alloc,VkStructureType rootType,const VkExternalMemoryProperties * from,VkExternalMemoryProperties * to)3405 void deepcopy_VkExternalMemoryProperties(Allocator* alloc, VkStructureType rootType,
3406                                          const VkExternalMemoryProperties* from,
3407                                          VkExternalMemoryProperties* to) {
3408     (void)alloc;
3409     (void)rootType;
3410     *to = *from;
3411 }
3412 
deepcopy_VkPhysicalDeviceExternalImageFormatInfo(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExternalImageFormatInfo * from,VkPhysicalDeviceExternalImageFormatInfo * to)3413 void deepcopy_VkPhysicalDeviceExternalImageFormatInfo(
3414     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalImageFormatInfo* from,
3415     VkPhysicalDeviceExternalImageFormatInfo* to) {
3416     (void)alloc;
3417     (void)rootType;
3418     *to = *from;
3419     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3420         rootType = from->sType;
3421     }
3422     const void* from_pNext = from;
3423     size_t pNext_size = 0u;
3424     while (!pNext_size && from_pNext) {
3425         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3426         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3427     }
3428     to->pNext = nullptr;
3429     if (pNext_size) {
3430         to->pNext = (void*)alloc->alloc(pNext_size);
3431         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3432     }
3433 }
3434 
deepcopy_VkExternalImageFormatProperties(Allocator * alloc,VkStructureType rootType,const VkExternalImageFormatProperties * from,VkExternalImageFormatProperties * to)3435 void deepcopy_VkExternalImageFormatProperties(Allocator* alloc, VkStructureType rootType,
3436                                               const VkExternalImageFormatProperties* from,
3437                                               VkExternalImageFormatProperties* to) {
3438     (void)alloc;
3439     (void)rootType;
3440     *to = *from;
3441     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3442         rootType = from->sType;
3443     }
3444     const void* from_pNext = from;
3445     size_t pNext_size = 0u;
3446     while (!pNext_size && from_pNext) {
3447         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3448         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3449     }
3450     to->pNext = nullptr;
3451     if (pNext_size) {
3452         to->pNext = (void*)alloc->alloc(pNext_size);
3453         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3454     }
3455     deepcopy_VkExternalMemoryProperties(
3456         alloc, rootType, &from->externalMemoryProperties,
3457         (VkExternalMemoryProperties*)(&to->externalMemoryProperties));
3458 }
3459 
deepcopy_VkPhysicalDeviceExternalBufferInfo(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExternalBufferInfo * from,VkPhysicalDeviceExternalBufferInfo * to)3460 void deepcopy_VkPhysicalDeviceExternalBufferInfo(Allocator* alloc, VkStructureType rootType,
3461                                                  const VkPhysicalDeviceExternalBufferInfo* from,
3462                                                  VkPhysicalDeviceExternalBufferInfo* to) {
3463     (void)alloc;
3464     (void)rootType;
3465     *to = *from;
3466     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3467         rootType = from->sType;
3468     }
3469     const void* from_pNext = from;
3470     size_t pNext_size = 0u;
3471     while (!pNext_size && from_pNext) {
3472         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3473         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3474     }
3475     to->pNext = nullptr;
3476     if (pNext_size) {
3477         to->pNext = (void*)alloc->alloc(pNext_size);
3478         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3479     }
3480 }
3481 
deepcopy_VkExternalBufferProperties(Allocator * alloc,VkStructureType rootType,const VkExternalBufferProperties * from,VkExternalBufferProperties * to)3482 void deepcopy_VkExternalBufferProperties(Allocator* alloc, VkStructureType rootType,
3483                                          const VkExternalBufferProperties* from,
3484                                          VkExternalBufferProperties* to) {
3485     (void)alloc;
3486     (void)rootType;
3487     *to = *from;
3488     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3489         rootType = from->sType;
3490     }
3491     const void* from_pNext = from;
3492     size_t pNext_size = 0u;
3493     while (!pNext_size && from_pNext) {
3494         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3495         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3496     }
3497     to->pNext = nullptr;
3498     if (pNext_size) {
3499         to->pNext = (void*)alloc->alloc(pNext_size);
3500         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3501     }
3502     deepcopy_VkExternalMemoryProperties(
3503         alloc, rootType, &from->externalMemoryProperties,
3504         (VkExternalMemoryProperties*)(&to->externalMemoryProperties));
3505 }
3506 
deepcopy_VkPhysicalDeviceIDProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceIDProperties * from,VkPhysicalDeviceIDProperties * to)3507 void deepcopy_VkPhysicalDeviceIDProperties(Allocator* alloc, VkStructureType rootType,
3508                                            const VkPhysicalDeviceIDProperties* from,
3509                                            VkPhysicalDeviceIDProperties* to) {
3510     (void)alloc;
3511     (void)rootType;
3512     *to = *from;
3513     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3514         rootType = from->sType;
3515     }
3516     const void* from_pNext = from;
3517     size_t pNext_size = 0u;
3518     while (!pNext_size && from_pNext) {
3519         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3520         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3521     }
3522     to->pNext = nullptr;
3523     if (pNext_size) {
3524         to->pNext = (void*)alloc->alloc(pNext_size);
3525         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3526     }
3527     memcpy(to->deviceUUID, from->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
3528     memcpy(to->driverUUID, from->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
3529     memcpy(to->deviceLUID, from->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
3530 }
3531 
deepcopy_VkExternalMemoryImageCreateInfo(Allocator * alloc,VkStructureType rootType,const VkExternalMemoryImageCreateInfo * from,VkExternalMemoryImageCreateInfo * to)3532 void deepcopy_VkExternalMemoryImageCreateInfo(Allocator* alloc, VkStructureType rootType,
3533                                               const VkExternalMemoryImageCreateInfo* from,
3534                                               VkExternalMemoryImageCreateInfo* to) {
3535     (void)alloc;
3536     (void)rootType;
3537     *to = *from;
3538     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3539         rootType = from->sType;
3540     }
3541     const void* from_pNext = from;
3542     size_t pNext_size = 0u;
3543     while (!pNext_size && from_pNext) {
3544         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3545         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3546     }
3547     to->pNext = nullptr;
3548     if (pNext_size) {
3549         to->pNext = (void*)alloc->alloc(pNext_size);
3550         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3551     }
3552 }
3553 
deepcopy_VkExternalMemoryBufferCreateInfo(Allocator * alloc,VkStructureType rootType,const VkExternalMemoryBufferCreateInfo * from,VkExternalMemoryBufferCreateInfo * to)3554 void deepcopy_VkExternalMemoryBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
3555                                                const VkExternalMemoryBufferCreateInfo* from,
3556                                                VkExternalMemoryBufferCreateInfo* to) {
3557     (void)alloc;
3558     (void)rootType;
3559     *to = *from;
3560     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3561         rootType = from->sType;
3562     }
3563     const void* from_pNext = from;
3564     size_t pNext_size = 0u;
3565     while (!pNext_size && from_pNext) {
3566         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3567         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3568     }
3569     to->pNext = nullptr;
3570     if (pNext_size) {
3571         to->pNext = (void*)alloc->alloc(pNext_size);
3572         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3573     }
3574 }
3575 
deepcopy_VkExportMemoryAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkExportMemoryAllocateInfo * from,VkExportMemoryAllocateInfo * to)3576 void deepcopy_VkExportMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
3577                                          const VkExportMemoryAllocateInfo* from,
3578                                          VkExportMemoryAllocateInfo* to) {
3579     (void)alloc;
3580     (void)rootType;
3581     *to = *from;
3582     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3583         rootType = from->sType;
3584     }
3585     const void* from_pNext = from;
3586     size_t pNext_size = 0u;
3587     while (!pNext_size && from_pNext) {
3588         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3589         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3590     }
3591     to->pNext = nullptr;
3592     if (pNext_size) {
3593         to->pNext = (void*)alloc->alloc(pNext_size);
3594         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3595     }
3596 }
3597 
deepcopy_VkPhysicalDeviceExternalFenceInfo(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExternalFenceInfo * from,VkPhysicalDeviceExternalFenceInfo * to)3598 void deepcopy_VkPhysicalDeviceExternalFenceInfo(Allocator* alloc, VkStructureType rootType,
3599                                                 const VkPhysicalDeviceExternalFenceInfo* from,
3600                                                 VkPhysicalDeviceExternalFenceInfo* to) {
3601     (void)alloc;
3602     (void)rootType;
3603     *to = *from;
3604     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3605         rootType = from->sType;
3606     }
3607     const void* from_pNext = from;
3608     size_t pNext_size = 0u;
3609     while (!pNext_size && from_pNext) {
3610         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3611         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3612     }
3613     to->pNext = nullptr;
3614     if (pNext_size) {
3615         to->pNext = (void*)alloc->alloc(pNext_size);
3616         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3617     }
3618 }
3619 
deepcopy_VkExternalFenceProperties(Allocator * alloc,VkStructureType rootType,const VkExternalFenceProperties * from,VkExternalFenceProperties * to)3620 void deepcopy_VkExternalFenceProperties(Allocator* alloc, VkStructureType rootType,
3621                                         const VkExternalFenceProperties* from,
3622                                         VkExternalFenceProperties* to) {
3623     (void)alloc;
3624     (void)rootType;
3625     *to = *from;
3626     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3627         rootType = from->sType;
3628     }
3629     const void* from_pNext = from;
3630     size_t pNext_size = 0u;
3631     while (!pNext_size && from_pNext) {
3632         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3633         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3634     }
3635     to->pNext = nullptr;
3636     if (pNext_size) {
3637         to->pNext = (void*)alloc->alloc(pNext_size);
3638         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3639     }
3640 }
3641 
deepcopy_VkExportFenceCreateInfo(Allocator * alloc,VkStructureType rootType,const VkExportFenceCreateInfo * from,VkExportFenceCreateInfo * to)3642 void deepcopy_VkExportFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
3643                                       const VkExportFenceCreateInfo* from,
3644                                       VkExportFenceCreateInfo* to) {
3645     (void)alloc;
3646     (void)rootType;
3647     *to = *from;
3648     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3649         rootType = from->sType;
3650     }
3651     const void* from_pNext = from;
3652     size_t pNext_size = 0u;
3653     while (!pNext_size && from_pNext) {
3654         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3655         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3656     }
3657     to->pNext = nullptr;
3658     if (pNext_size) {
3659         to->pNext = (void*)alloc->alloc(pNext_size);
3660         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3661     }
3662 }
3663 
deepcopy_VkExportSemaphoreCreateInfo(Allocator * alloc,VkStructureType rootType,const VkExportSemaphoreCreateInfo * from,VkExportSemaphoreCreateInfo * to)3664 void deepcopy_VkExportSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
3665                                           const VkExportSemaphoreCreateInfo* from,
3666                                           VkExportSemaphoreCreateInfo* to) {
3667     (void)alloc;
3668     (void)rootType;
3669     *to = *from;
3670     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3671         rootType = from->sType;
3672     }
3673     const void* from_pNext = from;
3674     size_t pNext_size = 0u;
3675     while (!pNext_size && from_pNext) {
3676         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3677         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3678     }
3679     to->pNext = nullptr;
3680     if (pNext_size) {
3681         to->pNext = (void*)alloc->alloc(pNext_size);
3682         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3683     }
3684 }
3685 
deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExternalSemaphoreInfo * from,VkPhysicalDeviceExternalSemaphoreInfo * to)3686 void deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(
3687     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalSemaphoreInfo* from,
3688     VkPhysicalDeviceExternalSemaphoreInfo* to) {
3689     (void)alloc;
3690     (void)rootType;
3691     *to = *from;
3692     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3693         rootType = from->sType;
3694     }
3695     const void* from_pNext = from;
3696     size_t pNext_size = 0u;
3697     while (!pNext_size && from_pNext) {
3698         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3699         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3700     }
3701     to->pNext = nullptr;
3702     if (pNext_size) {
3703         to->pNext = (void*)alloc->alloc(pNext_size);
3704         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3705     }
3706 }
3707 
deepcopy_VkExternalSemaphoreProperties(Allocator * alloc,VkStructureType rootType,const VkExternalSemaphoreProperties * from,VkExternalSemaphoreProperties * to)3708 void deepcopy_VkExternalSemaphoreProperties(Allocator* alloc, VkStructureType rootType,
3709                                             const VkExternalSemaphoreProperties* from,
3710                                             VkExternalSemaphoreProperties* to) {
3711     (void)alloc;
3712     (void)rootType;
3713     *to = *from;
3714     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3715         rootType = from->sType;
3716     }
3717     const void* from_pNext = from;
3718     size_t pNext_size = 0u;
3719     while (!pNext_size && from_pNext) {
3720         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3721         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3722     }
3723     to->pNext = nullptr;
3724     if (pNext_size) {
3725         to->pNext = (void*)alloc->alloc(pNext_size);
3726         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3727     }
3728 }
3729 
deepcopy_VkPhysicalDeviceMaintenance3Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance3Properties * from,VkPhysicalDeviceMaintenance3Properties * to)3730 void deepcopy_VkPhysicalDeviceMaintenance3Properties(
3731     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance3Properties* from,
3732     VkPhysicalDeviceMaintenance3Properties* to) {
3733     (void)alloc;
3734     (void)rootType;
3735     *to = *from;
3736     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3737         rootType = from->sType;
3738     }
3739     const void* from_pNext = from;
3740     size_t pNext_size = 0u;
3741     while (!pNext_size && from_pNext) {
3742         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3743         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3744     }
3745     to->pNext = nullptr;
3746     if (pNext_size) {
3747         to->pNext = (void*)alloc->alloc(pNext_size);
3748         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3749     }
3750 }
3751 
deepcopy_VkDescriptorSetLayoutSupport(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetLayoutSupport * from,VkDescriptorSetLayoutSupport * to)3752 void deepcopy_VkDescriptorSetLayoutSupport(Allocator* alloc, VkStructureType rootType,
3753                                            const VkDescriptorSetLayoutSupport* from,
3754                                            VkDescriptorSetLayoutSupport* to) {
3755     (void)alloc;
3756     (void)rootType;
3757     *to = *from;
3758     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3759         rootType = from->sType;
3760     }
3761     const void* from_pNext = from;
3762     size_t pNext_size = 0u;
3763     while (!pNext_size && from_pNext) {
3764         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3765         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3766     }
3767     to->pNext = nullptr;
3768     if (pNext_size) {
3769         to->pNext = (void*)alloc->alloc(pNext_size);
3770         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3771     }
3772 }
3773 
deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderDrawParametersFeatures * from,VkPhysicalDeviceShaderDrawParametersFeatures * to)3774 void deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(
3775     Allocator* alloc, VkStructureType rootType,
3776     const VkPhysicalDeviceShaderDrawParametersFeatures* from,
3777     VkPhysicalDeviceShaderDrawParametersFeatures* to) {
3778     (void)alloc;
3779     (void)rootType;
3780     *to = *from;
3781     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3782         rootType = from->sType;
3783     }
3784     const void* from_pNext = from;
3785     size_t pNext_size = 0u;
3786     while (!pNext_size && from_pNext) {
3787         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3788         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3789     }
3790     to->pNext = nullptr;
3791     if (pNext_size) {
3792         to->pNext = (void*)alloc->alloc(pNext_size);
3793         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3794     }
3795 }
3796 
3797 #endif
3798 #ifdef VK_VERSION_1_2
deepcopy_VkPhysicalDeviceVulkan11Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan11Features * from,VkPhysicalDeviceVulkan11Features * to)3799 void deepcopy_VkPhysicalDeviceVulkan11Features(Allocator* alloc, VkStructureType rootType,
3800                                                const VkPhysicalDeviceVulkan11Features* from,
3801                                                VkPhysicalDeviceVulkan11Features* to) {
3802     (void)alloc;
3803     (void)rootType;
3804     *to = *from;
3805     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3806         rootType = from->sType;
3807     }
3808     const void* from_pNext = from;
3809     size_t pNext_size = 0u;
3810     while (!pNext_size && from_pNext) {
3811         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3812         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3813     }
3814     to->pNext = nullptr;
3815     if (pNext_size) {
3816         to->pNext = (void*)alloc->alloc(pNext_size);
3817         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3818     }
3819 }
3820 
deepcopy_VkPhysicalDeviceVulkan11Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan11Properties * from,VkPhysicalDeviceVulkan11Properties * to)3821 void deepcopy_VkPhysicalDeviceVulkan11Properties(Allocator* alloc, VkStructureType rootType,
3822                                                  const VkPhysicalDeviceVulkan11Properties* from,
3823                                                  VkPhysicalDeviceVulkan11Properties* to) {
3824     (void)alloc;
3825     (void)rootType;
3826     *to = *from;
3827     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3828         rootType = from->sType;
3829     }
3830     const void* from_pNext = from;
3831     size_t pNext_size = 0u;
3832     while (!pNext_size && from_pNext) {
3833         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3834         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3835     }
3836     to->pNext = nullptr;
3837     if (pNext_size) {
3838         to->pNext = (void*)alloc->alloc(pNext_size);
3839         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3840     }
3841     memcpy(to->deviceUUID, from->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
3842     memcpy(to->driverUUID, from->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
3843     memcpy(to->deviceLUID, from->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
3844 }
3845 
deepcopy_VkPhysicalDeviceVulkan12Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan12Features * from,VkPhysicalDeviceVulkan12Features * to)3846 void deepcopy_VkPhysicalDeviceVulkan12Features(Allocator* alloc, VkStructureType rootType,
3847                                                const VkPhysicalDeviceVulkan12Features* from,
3848                                                VkPhysicalDeviceVulkan12Features* to) {
3849     (void)alloc;
3850     (void)rootType;
3851     *to = *from;
3852     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3853         rootType = from->sType;
3854     }
3855     const void* from_pNext = from;
3856     size_t pNext_size = 0u;
3857     while (!pNext_size && from_pNext) {
3858         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3859         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3860     }
3861     to->pNext = nullptr;
3862     if (pNext_size) {
3863         to->pNext = (void*)alloc->alloc(pNext_size);
3864         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3865     }
3866 }
3867 
deepcopy_VkConformanceVersion(Allocator * alloc,VkStructureType rootType,const VkConformanceVersion * from,VkConformanceVersion * to)3868 void deepcopy_VkConformanceVersion(Allocator* alloc, VkStructureType rootType,
3869                                    const VkConformanceVersion* from, VkConformanceVersion* to) {
3870     (void)alloc;
3871     (void)rootType;
3872     *to = *from;
3873 }
3874 
deepcopy_VkPhysicalDeviceVulkan12Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan12Properties * from,VkPhysicalDeviceVulkan12Properties * to)3875 void deepcopy_VkPhysicalDeviceVulkan12Properties(Allocator* alloc, VkStructureType rootType,
3876                                                  const VkPhysicalDeviceVulkan12Properties* from,
3877                                                  VkPhysicalDeviceVulkan12Properties* to) {
3878     (void)alloc;
3879     (void)rootType;
3880     *to = *from;
3881     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3882         rootType = from->sType;
3883     }
3884     const void* from_pNext = from;
3885     size_t pNext_size = 0u;
3886     while (!pNext_size && from_pNext) {
3887         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3888         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3889     }
3890     to->pNext = nullptr;
3891     if (pNext_size) {
3892         to->pNext = (void*)alloc->alloc(pNext_size);
3893         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3894     }
3895     memcpy(to->driverName, from->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
3896     memcpy(to->driverInfo, from->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
3897     deepcopy_VkConformanceVersion(alloc, rootType, &from->conformanceVersion,
3898                                   (VkConformanceVersion*)(&to->conformanceVersion));
3899 }
3900 
deepcopy_VkImageFormatListCreateInfo(Allocator * alloc,VkStructureType rootType,const VkImageFormatListCreateInfo * from,VkImageFormatListCreateInfo * to)3901 void deepcopy_VkImageFormatListCreateInfo(Allocator* alloc, VkStructureType rootType,
3902                                           const VkImageFormatListCreateInfo* from,
3903                                           VkImageFormatListCreateInfo* to) {
3904     (void)alloc;
3905     (void)rootType;
3906     *to = *from;
3907     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3908         rootType = from->sType;
3909     }
3910     const void* from_pNext = from;
3911     size_t pNext_size = 0u;
3912     while (!pNext_size && from_pNext) {
3913         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3914         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3915     }
3916     to->pNext = nullptr;
3917     if (pNext_size) {
3918         to->pNext = (void*)alloc->alloc(pNext_size);
3919         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3920     }
3921     to->pViewFormats = nullptr;
3922     if (from->pViewFormats) {
3923         to->pViewFormats = (VkFormat*)alloc->dupArray(
3924             from->pViewFormats, from->viewFormatCount * sizeof(const VkFormat));
3925     }
3926 }
3927 
deepcopy_VkAttachmentDescription2(Allocator * alloc,VkStructureType rootType,const VkAttachmentDescription2 * from,VkAttachmentDescription2 * to)3928 void deepcopy_VkAttachmentDescription2(Allocator* alloc, VkStructureType rootType,
3929                                        const VkAttachmentDescription2* from,
3930                                        VkAttachmentDescription2* to) {
3931     (void)alloc;
3932     (void)rootType;
3933     *to = *from;
3934     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3935         rootType = from->sType;
3936     }
3937     const void* from_pNext = from;
3938     size_t pNext_size = 0u;
3939     while (!pNext_size && from_pNext) {
3940         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3941         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3942     }
3943     to->pNext = nullptr;
3944     if (pNext_size) {
3945         to->pNext = (void*)alloc->alloc(pNext_size);
3946         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3947     }
3948 }
3949 
deepcopy_VkAttachmentReference2(Allocator * alloc,VkStructureType rootType,const VkAttachmentReference2 * from,VkAttachmentReference2 * to)3950 void deepcopy_VkAttachmentReference2(Allocator* alloc, VkStructureType rootType,
3951                                      const VkAttachmentReference2* from,
3952                                      VkAttachmentReference2* to) {
3953     (void)alloc;
3954     (void)rootType;
3955     *to = *from;
3956     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3957         rootType = from->sType;
3958     }
3959     const void* from_pNext = from;
3960     size_t pNext_size = 0u;
3961     while (!pNext_size && from_pNext) {
3962         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3963         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3964     }
3965     to->pNext = nullptr;
3966     if (pNext_size) {
3967         to->pNext = (void*)alloc->alloc(pNext_size);
3968         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3969     }
3970 }
3971 
deepcopy_VkSubpassDescription2(Allocator * alloc,VkStructureType rootType,const VkSubpassDescription2 * from,VkSubpassDescription2 * to)3972 void deepcopy_VkSubpassDescription2(Allocator* alloc, VkStructureType rootType,
3973                                     const VkSubpassDescription2* from, VkSubpassDescription2* to) {
3974     (void)alloc;
3975     (void)rootType;
3976     *to = *from;
3977     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
3978         rootType = from->sType;
3979     }
3980     const void* from_pNext = from;
3981     size_t pNext_size = 0u;
3982     while (!pNext_size && from_pNext) {
3983         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
3984         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
3985     }
3986     to->pNext = nullptr;
3987     if (pNext_size) {
3988         to->pNext = (void*)alloc->alloc(pNext_size);
3989         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
3990     }
3991     if (from) {
3992         to->pInputAttachments = nullptr;
3993         if (from->pInputAttachments) {
3994             to->pInputAttachments = (VkAttachmentReference2*)alloc->alloc(
3995                 from->inputAttachmentCount * sizeof(const VkAttachmentReference2));
3996             to->inputAttachmentCount = from->inputAttachmentCount;
3997             for (uint32_t i = 0; i < (uint32_t)from->inputAttachmentCount; ++i) {
3998                 deepcopy_VkAttachmentReference2(
3999                     alloc, rootType, from->pInputAttachments + i,
4000                     (VkAttachmentReference2*)(to->pInputAttachments + i));
4001             }
4002         }
4003     }
4004     if (from) {
4005         to->pColorAttachments = nullptr;
4006         if (from->pColorAttachments) {
4007             to->pColorAttachments = (VkAttachmentReference2*)alloc->alloc(
4008                 from->colorAttachmentCount * sizeof(const VkAttachmentReference2));
4009             to->colorAttachmentCount = from->colorAttachmentCount;
4010             for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
4011                 deepcopy_VkAttachmentReference2(
4012                     alloc, rootType, from->pColorAttachments + i,
4013                     (VkAttachmentReference2*)(to->pColorAttachments + i));
4014             }
4015         }
4016     }
4017     if (from) {
4018         to->pResolveAttachments = nullptr;
4019         if (from->pResolveAttachments) {
4020             to->pResolveAttachments = (VkAttachmentReference2*)alloc->alloc(
4021                 from->colorAttachmentCount * sizeof(const VkAttachmentReference2));
4022             to->colorAttachmentCount = from->colorAttachmentCount;
4023             for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
4024                 deepcopy_VkAttachmentReference2(
4025                     alloc, rootType, from->pResolveAttachments + i,
4026                     (VkAttachmentReference2*)(to->pResolveAttachments + i));
4027             }
4028         }
4029     }
4030     to->pDepthStencilAttachment = nullptr;
4031     if (from->pDepthStencilAttachment) {
4032         to->pDepthStencilAttachment =
4033             (VkAttachmentReference2*)alloc->alloc(sizeof(const VkAttachmentReference2));
4034         deepcopy_VkAttachmentReference2(alloc, rootType, from->pDepthStencilAttachment,
4035                                         (VkAttachmentReference2*)(to->pDepthStencilAttachment));
4036     }
4037     to->pPreserveAttachments = nullptr;
4038     if (from->pPreserveAttachments) {
4039         to->pPreserveAttachments = (uint32_t*)alloc->dupArray(
4040             from->pPreserveAttachments, from->preserveAttachmentCount * sizeof(const uint32_t));
4041     }
4042 }
4043 
deepcopy_VkSubpassDependency2(Allocator * alloc,VkStructureType rootType,const VkSubpassDependency2 * from,VkSubpassDependency2 * to)4044 void deepcopy_VkSubpassDependency2(Allocator* alloc, VkStructureType rootType,
4045                                    const VkSubpassDependency2* from, VkSubpassDependency2* to) {
4046     (void)alloc;
4047     (void)rootType;
4048     *to = *from;
4049     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4050         rootType = from->sType;
4051     }
4052     const void* from_pNext = from;
4053     size_t pNext_size = 0u;
4054     while (!pNext_size && from_pNext) {
4055         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4056         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4057     }
4058     to->pNext = nullptr;
4059     if (pNext_size) {
4060         to->pNext = (void*)alloc->alloc(pNext_size);
4061         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4062     }
4063 }
4064 
deepcopy_VkRenderPassCreateInfo2(Allocator * alloc,VkStructureType rootType,const VkRenderPassCreateInfo2 * from,VkRenderPassCreateInfo2 * to)4065 void deepcopy_VkRenderPassCreateInfo2(Allocator* alloc, VkStructureType rootType,
4066                                       const VkRenderPassCreateInfo2* from,
4067                                       VkRenderPassCreateInfo2* to) {
4068     (void)alloc;
4069     (void)rootType;
4070     *to = *from;
4071     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4072         rootType = from->sType;
4073     }
4074     const void* from_pNext = from;
4075     size_t pNext_size = 0u;
4076     while (!pNext_size && from_pNext) {
4077         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4078         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4079     }
4080     to->pNext = nullptr;
4081     if (pNext_size) {
4082         to->pNext = (void*)alloc->alloc(pNext_size);
4083         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4084     }
4085     if (from) {
4086         to->pAttachments = nullptr;
4087         if (from->pAttachments) {
4088             to->pAttachments = (VkAttachmentDescription2*)alloc->alloc(
4089                 from->attachmentCount * sizeof(const VkAttachmentDescription2));
4090             to->attachmentCount = from->attachmentCount;
4091             for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
4092                 deepcopy_VkAttachmentDescription2(
4093                     alloc, rootType, from->pAttachments + i,
4094                     (VkAttachmentDescription2*)(to->pAttachments + i));
4095             }
4096         }
4097     }
4098     if (from) {
4099         to->pSubpasses = nullptr;
4100         if (from->pSubpasses) {
4101             to->pSubpasses = (VkSubpassDescription2*)alloc->alloc(
4102                 from->subpassCount * sizeof(const VkSubpassDescription2));
4103             to->subpassCount = from->subpassCount;
4104             for (uint32_t i = 0; i < (uint32_t)from->subpassCount; ++i) {
4105                 deepcopy_VkSubpassDescription2(alloc, rootType, from->pSubpasses + i,
4106                                                (VkSubpassDescription2*)(to->pSubpasses + i));
4107             }
4108         }
4109     }
4110     if (from) {
4111         to->pDependencies = nullptr;
4112         if (from->pDependencies) {
4113             to->pDependencies = (VkSubpassDependency2*)alloc->alloc(
4114                 from->dependencyCount * sizeof(const VkSubpassDependency2));
4115             to->dependencyCount = from->dependencyCount;
4116             for (uint32_t i = 0; i < (uint32_t)from->dependencyCount; ++i) {
4117                 deepcopy_VkSubpassDependency2(alloc, rootType, from->pDependencies + i,
4118                                               (VkSubpassDependency2*)(to->pDependencies + i));
4119             }
4120         }
4121     }
4122     to->pCorrelatedViewMasks = nullptr;
4123     if (from->pCorrelatedViewMasks) {
4124         to->pCorrelatedViewMasks = (uint32_t*)alloc->dupArray(
4125             from->pCorrelatedViewMasks, from->correlatedViewMaskCount * sizeof(const uint32_t));
4126     }
4127 }
4128 
deepcopy_VkSubpassBeginInfo(Allocator * alloc,VkStructureType rootType,const VkSubpassBeginInfo * from,VkSubpassBeginInfo * to)4129 void deepcopy_VkSubpassBeginInfo(Allocator* alloc, VkStructureType rootType,
4130                                  const VkSubpassBeginInfo* from, VkSubpassBeginInfo* to) {
4131     (void)alloc;
4132     (void)rootType;
4133     *to = *from;
4134     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4135         rootType = from->sType;
4136     }
4137     const void* from_pNext = from;
4138     size_t pNext_size = 0u;
4139     while (!pNext_size && from_pNext) {
4140         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4141         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4142     }
4143     to->pNext = nullptr;
4144     if (pNext_size) {
4145         to->pNext = (void*)alloc->alloc(pNext_size);
4146         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4147     }
4148 }
4149 
deepcopy_VkSubpassEndInfo(Allocator * alloc,VkStructureType rootType,const VkSubpassEndInfo * from,VkSubpassEndInfo * to)4150 void deepcopy_VkSubpassEndInfo(Allocator* alloc, VkStructureType rootType,
4151                                const VkSubpassEndInfo* from, VkSubpassEndInfo* to) {
4152     (void)alloc;
4153     (void)rootType;
4154     *to = *from;
4155     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4156         rootType = from->sType;
4157     }
4158     const void* from_pNext = from;
4159     size_t pNext_size = 0u;
4160     while (!pNext_size && from_pNext) {
4161         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4162         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4163     }
4164     to->pNext = nullptr;
4165     if (pNext_size) {
4166         to->pNext = (void*)alloc->alloc(pNext_size);
4167         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4168     }
4169 }
4170 
deepcopy_VkPhysicalDevice8BitStorageFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevice8BitStorageFeatures * from,VkPhysicalDevice8BitStorageFeatures * to)4171 void deepcopy_VkPhysicalDevice8BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
4172                                                   const VkPhysicalDevice8BitStorageFeatures* from,
4173                                                   VkPhysicalDevice8BitStorageFeatures* to) {
4174     (void)alloc;
4175     (void)rootType;
4176     *to = *from;
4177     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4178         rootType = from->sType;
4179     }
4180     const void* from_pNext = from;
4181     size_t pNext_size = 0u;
4182     while (!pNext_size && from_pNext) {
4183         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4184         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4185     }
4186     to->pNext = nullptr;
4187     if (pNext_size) {
4188         to->pNext = (void*)alloc->alloc(pNext_size);
4189         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4190     }
4191 }
4192 
deepcopy_VkPhysicalDeviceDriverProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDriverProperties * from,VkPhysicalDeviceDriverProperties * to)4193 void deepcopy_VkPhysicalDeviceDriverProperties(Allocator* alloc, VkStructureType rootType,
4194                                                const VkPhysicalDeviceDriverProperties* from,
4195                                                VkPhysicalDeviceDriverProperties* to) {
4196     (void)alloc;
4197     (void)rootType;
4198     *to = *from;
4199     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4200         rootType = from->sType;
4201     }
4202     const void* from_pNext = from;
4203     size_t pNext_size = 0u;
4204     while (!pNext_size && from_pNext) {
4205         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4206         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4207     }
4208     to->pNext = nullptr;
4209     if (pNext_size) {
4210         to->pNext = (void*)alloc->alloc(pNext_size);
4211         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4212     }
4213     memcpy(to->driverName, from->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
4214     memcpy(to->driverInfo, from->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
4215     deepcopy_VkConformanceVersion(alloc, rootType, &from->conformanceVersion,
4216                                   (VkConformanceVersion*)(&to->conformanceVersion));
4217 }
4218 
deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderAtomicInt64Features * from,VkPhysicalDeviceShaderAtomicInt64Features * to)4219 void deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(
4220     Allocator* alloc, VkStructureType rootType,
4221     const VkPhysicalDeviceShaderAtomicInt64Features* from,
4222     VkPhysicalDeviceShaderAtomicInt64Features* to) {
4223     (void)alloc;
4224     (void)rootType;
4225     *to = *from;
4226     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4227         rootType = from->sType;
4228     }
4229     const void* from_pNext = from;
4230     size_t pNext_size = 0u;
4231     while (!pNext_size && from_pNext) {
4232         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4233         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4234     }
4235     to->pNext = nullptr;
4236     if (pNext_size) {
4237         to->pNext = (void*)alloc->alloc(pNext_size);
4238         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4239     }
4240 }
4241 
deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderFloat16Int8Features * from,VkPhysicalDeviceShaderFloat16Int8Features * to)4242 void deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(
4243     Allocator* alloc, VkStructureType rootType,
4244     const VkPhysicalDeviceShaderFloat16Int8Features* from,
4245     VkPhysicalDeviceShaderFloat16Int8Features* to) {
4246     (void)alloc;
4247     (void)rootType;
4248     *to = *from;
4249     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4250         rootType = from->sType;
4251     }
4252     const void* from_pNext = from;
4253     size_t pNext_size = 0u;
4254     while (!pNext_size && from_pNext) {
4255         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4256         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4257     }
4258     to->pNext = nullptr;
4259     if (pNext_size) {
4260         to->pNext = (void*)alloc->alloc(pNext_size);
4261         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4262     }
4263 }
4264 
deepcopy_VkPhysicalDeviceFloatControlsProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceFloatControlsProperties * from,VkPhysicalDeviceFloatControlsProperties * to)4265 void deepcopy_VkPhysicalDeviceFloatControlsProperties(
4266     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceFloatControlsProperties* from,
4267     VkPhysicalDeviceFloatControlsProperties* to) {
4268     (void)alloc;
4269     (void)rootType;
4270     *to = *from;
4271     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4272         rootType = from->sType;
4273     }
4274     const void* from_pNext = from;
4275     size_t pNext_size = 0u;
4276     while (!pNext_size && from_pNext) {
4277         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4278         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4279     }
4280     to->pNext = nullptr;
4281     if (pNext_size) {
4282         to->pNext = (void*)alloc->alloc(pNext_size);
4283         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4284     }
4285 }
4286 
deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetLayoutBindingFlagsCreateInfo * from,VkDescriptorSetLayoutBindingFlagsCreateInfo * to)4287 void deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(
4288     Allocator* alloc, VkStructureType rootType,
4289     const VkDescriptorSetLayoutBindingFlagsCreateInfo* from,
4290     VkDescriptorSetLayoutBindingFlagsCreateInfo* to) {
4291     (void)alloc;
4292     (void)rootType;
4293     *to = *from;
4294     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4295         rootType = from->sType;
4296     }
4297     const void* from_pNext = from;
4298     size_t pNext_size = 0u;
4299     while (!pNext_size && from_pNext) {
4300         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4301         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4302     }
4303     to->pNext = nullptr;
4304     if (pNext_size) {
4305         to->pNext = (void*)alloc->alloc(pNext_size);
4306         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4307     }
4308     to->pBindingFlags = nullptr;
4309     if (from->pBindingFlags) {
4310         to->pBindingFlags = (VkDescriptorBindingFlags*)alloc->dupArray(
4311             from->pBindingFlags, from->bindingCount * sizeof(const VkDescriptorBindingFlags));
4312     }
4313 }
4314 
deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDescriptorIndexingFeatures * from,VkPhysicalDeviceDescriptorIndexingFeatures * to)4315 void deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(
4316     Allocator* alloc, VkStructureType rootType,
4317     const VkPhysicalDeviceDescriptorIndexingFeatures* from,
4318     VkPhysicalDeviceDescriptorIndexingFeatures* to) {
4319     (void)alloc;
4320     (void)rootType;
4321     *to = *from;
4322     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4323         rootType = from->sType;
4324     }
4325     const void* from_pNext = from;
4326     size_t pNext_size = 0u;
4327     while (!pNext_size && from_pNext) {
4328         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4329         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4330     }
4331     to->pNext = nullptr;
4332     if (pNext_size) {
4333         to->pNext = (void*)alloc->alloc(pNext_size);
4334         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4335     }
4336 }
4337 
deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDescriptorIndexingProperties * from,VkPhysicalDeviceDescriptorIndexingProperties * to)4338 void deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(
4339     Allocator* alloc, VkStructureType rootType,
4340     const VkPhysicalDeviceDescriptorIndexingProperties* from,
4341     VkPhysicalDeviceDescriptorIndexingProperties* to) {
4342     (void)alloc;
4343     (void)rootType;
4344     *to = *from;
4345     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4346         rootType = from->sType;
4347     }
4348     const void* from_pNext = from;
4349     size_t pNext_size = 0u;
4350     while (!pNext_size && from_pNext) {
4351         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4352         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4353     }
4354     to->pNext = nullptr;
4355     if (pNext_size) {
4356         to->pNext = (void*)alloc->alloc(pNext_size);
4357         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4358     }
4359 }
4360 
deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetVariableDescriptorCountAllocateInfo * from,VkDescriptorSetVariableDescriptorCountAllocateInfo * to)4361 void deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(
4362     Allocator* alloc, VkStructureType rootType,
4363     const VkDescriptorSetVariableDescriptorCountAllocateInfo* from,
4364     VkDescriptorSetVariableDescriptorCountAllocateInfo* to) {
4365     (void)alloc;
4366     (void)rootType;
4367     *to = *from;
4368     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4369         rootType = from->sType;
4370     }
4371     const void* from_pNext = from;
4372     size_t pNext_size = 0u;
4373     while (!pNext_size && from_pNext) {
4374         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4375         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4376     }
4377     to->pNext = nullptr;
4378     if (pNext_size) {
4379         to->pNext = (void*)alloc->alloc(pNext_size);
4380         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4381     }
4382     to->pDescriptorCounts = nullptr;
4383     if (from->pDescriptorCounts) {
4384         to->pDescriptorCounts = (uint32_t*)alloc->dupArray(
4385             from->pDescriptorCounts, from->descriptorSetCount * sizeof(const uint32_t));
4386     }
4387 }
4388 
deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(Allocator * alloc,VkStructureType rootType,const VkDescriptorSetVariableDescriptorCountLayoutSupport * from,VkDescriptorSetVariableDescriptorCountLayoutSupport * to)4389 void deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(
4390     Allocator* alloc, VkStructureType rootType,
4391     const VkDescriptorSetVariableDescriptorCountLayoutSupport* from,
4392     VkDescriptorSetVariableDescriptorCountLayoutSupport* to) {
4393     (void)alloc;
4394     (void)rootType;
4395     *to = *from;
4396     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4397         rootType = from->sType;
4398     }
4399     const void* from_pNext = from;
4400     size_t pNext_size = 0u;
4401     while (!pNext_size && from_pNext) {
4402         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4403         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4404     }
4405     to->pNext = nullptr;
4406     if (pNext_size) {
4407         to->pNext = (void*)alloc->alloc(pNext_size);
4408         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4409     }
4410 }
4411 
deepcopy_VkSubpassDescriptionDepthStencilResolve(Allocator * alloc,VkStructureType rootType,const VkSubpassDescriptionDepthStencilResolve * from,VkSubpassDescriptionDepthStencilResolve * to)4412 void deepcopy_VkSubpassDescriptionDepthStencilResolve(
4413     Allocator* alloc, VkStructureType rootType, const VkSubpassDescriptionDepthStencilResolve* from,
4414     VkSubpassDescriptionDepthStencilResolve* to) {
4415     (void)alloc;
4416     (void)rootType;
4417     *to = *from;
4418     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4419         rootType = from->sType;
4420     }
4421     const void* from_pNext = from;
4422     size_t pNext_size = 0u;
4423     while (!pNext_size && from_pNext) {
4424         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4425         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4426     }
4427     to->pNext = nullptr;
4428     if (pNext_size) {
4429         to->pNext = (void*)alloc->alloc(pNext_size);
4430         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4431     }
4432     to->pDepthStencilResolveAttachment = nullptr;
4433     if (from->pDepthStencilResolveAttachment) {
4434         to->pDepthStencilResolveAttachment =
4435             (VkAttachmentReference2*)alloc->alloc(sizeof(const VkAttachmentReference2));
4436         deepcopy_VkAttachmentReference2(
4437             alloc, rootType, from->pDepthStencilResolveAttachment,
4438             (VkAttachmentReference2*)(to->pDepthStencilResolveAttachment));
4439     }
4440 }
4441 
deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDepthStencilResolveProperties * from,VkPhysicalDeviceDepthStencilResolveProperties * to)4442 void deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(
4443     Allocator* alloc, VkStructureType rootType,
4444     const VkPhysicalDeviceDepthStencilResolveProperties* from,
4445     VkPhysicalDeviceDepthStencilResolveProperties* to) {
4446     (void)alloc;
4447     (void)rootType;
4448     *to = *from;
4449     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4450         rootType = from->sType;
4451     }
4452     const void* from_pNext = from;
4453     size_t pNext_size = 0u;
4454     while (!pNext_size && from_pNext) {
4455         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4456         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4457     }
4458     to->pNext = nullptr;
4459     if (pNext_size) {
4460         to->pNext = (void*)alloc->alloc(pNext_size);
4461         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4462     }
4463 }
4464 
deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceScalarBlockLayoutFeatures * from,VkPhysicalDeviceScalarBlockLayoutFeatures * to)4465 void deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(
4466     Allocator* alloc, VkStructureType rootType,
4467     const VkPhysicalDeviceScalarBlockLayoutFeatures* from,
4468     VkPhysicalDeviceScalarBlockLayoutFeatures* to) {
4469     (void)alloc;
4470     (void)rootType;
4471     *to = *from;
4472     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4473         rootType = from->sType;
4474     }
4475     const void* from_pNext = from;
4476     size_t pNext_size = 0u;
4477     while (!pNext_size && from_pNext) {
4478         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4479         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4480     }
4481     to->pNext = nullptr;
4482     if (pNext_size) {
4483         to->pNext = (void*)alloc->alloc(pNext_size);
4484         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4485     }
4486 }
4487 
deepcopy_VkImageStencilUsageCreateInfo(Allocator * alloc,VkStructureType rootType,const VkImageStencilUsageCreateInfo * from,VkImageStencilUsageCreateInfo * to)4488 void deepcopy_VkImageStencilUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
4489                                             const VkImageStencilUsageCreateInfo* from,
4490                                             VkImageStencilUsageCreateInfo* to) {
4491     (void)alloc;
4492     (void)rootType;
4493     *to = *from;
4494     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4495         rootType = from->sType;
4496     }
4497     const void* from_pNext = from;
4498     size_t pNext_size = 0u;
4499     while (!pNext_size && from_pNext) {
4500         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4501         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4502     }
4503     to->pNext = nullptr;
4504     if (pNext_size) {
4505         to->pNext = (void*)alloc->alloc(pNext_size);
4506         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4507     }
4508 }
4509 
deepcopy_VkSamplerReductionModeCreateInfo(Allocator * alloc,VkStructureType rootType,const VkSamplerReductionModeCreateInfo * from,VkSamplerReductionModeCreateInfo * to)4510 void deepcopy_VkSamplerReductionModeCreateInfo(Allocator* alloc, VkStructureType rootType,
4511                                                const VkSamplerReductionModeCreateInfo* from,
4512                                                VkSamplerReductionModeCreateInfo* to) {
4513     (void)alloc;
4514     (void)rootType;
4515     *to = *from;
4516     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4517         rootType = from->sType;
4518     }
4519     const void* from_pNext = from;
4520     size_t pNext_size = 0u;
4521     while (!pNext_size && from_pNext) {
4522         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4523         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4524     }
4525     to->pNext = nullptr;
4526     if (pNext_size) {
4527         to->pNext = (void*)alloc->alloc(pNext_size);
4528         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4529     }
4530 }
4531 
deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSamplerFilterMinmaxProperties * from,VkPhysicalDeviceSamplerFilterMinmaxProperties * to)4532 void deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(
4533     Allocator* alloc, VkStructureType rootType,
4534     const VkPhysicalDeviceSamplerFilterMinmaxProperties* from,
4535     VkPhysicalDeviceSamplerFilterMinmaxProperties* to) {
4536     (void)alloc;
4537     (void)rootType;
4538     *to = *from;
4539     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4540         rootType = from->sType;
4541     }
4542     const void* from_pNext = from;
4543     size_t pNext_size = 0u;
4544     while (!pNext_size && from_pNext) {
4545         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4546         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4547     }
4548     to->pNext = nullptr;
4549     if (pNext_size) {
4550         to->pNext = (void*)alloc->alloc(pNext_size);
4551         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4552     }
4553 }
4554 
deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkanMemoryModelFeatures * from,VkPhysicalDeviceVulkanMemoryModelFeatures * to)4555 void deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(
4556     Allocator* alloc, VkStructureType rootType,
4557     const VkPhysicalDeviceVulkanMemoryModelFeatures* from,
4558     VkPhysicalDeviceVulkanMemoryModelFeatures* to) {
4559     (void)alloc;
4560     (void)rootType;
4561     *to = *from;
4562     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4563         rootType = from->sType;
4564     }
4565     const void* from_pNext = from;
4566     size_t pNext_size = 0u;
4567     while (!pNext_size && from_pNext) {
4568         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4569         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4570     }
4571     to->pNext = nullptr;
4572     if (pNext_size) {
4573         to->pNext = (void*)alloc->alloc(pNext_size);
4574         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4575     }
4576 }
4577 
deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImagelessFramebufferFeatures * from,VkPhysicalDeviceImagelessFramebufferFeatures * to)4578 void deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(
4579     Allocator* alloc, VkStructureType rootType,
4580     const VkPhysicalDeviceImagelessFramebufferFeatures* from,
4581     VkPhysicalDeviceImagelessFramebufferFeatures* to) {
4582     (void)alloc;
4583     (void)rootType;
4584     *to = *from;
4585     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4586         rootType = from->sType;
4587     }
4588     const void* from_pNext = from;
4589     size_t pNext_size = 0u;
4590     while (!pNext_size && from_pNext) {
4591         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4592         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4593     }
4594     to->pNext = nullptr;
4595     if (pNext_size) {
4596         to->pNext = (void*)alloc->alloc(pNext_size);
4597         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4598     }
4599 }
4600 
deepcopy_VkFramebufferAttachmentImageInfo(Allocator * alloc,VkStructureType rootType,const VkFramebufferAttachmentImageInfo * from,VkFramebufferAttachmentImageInfo * to)4601 void deepcopy_VkFramebufferAttachmentImageInfo(Allocator* alloc, VkStructureType rootType,
4602                                                const VkFramebufferAttachmentImageInfo* from,
4603                                                VkFramebufferAttachmentImageInfo* to) {
4604     (void)alloc;
4605     (void)rootType;
4606     *to = *from;
4607     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4608         rootType = from->sType;
4609     }
4610     const void* from_pNext = from;
4611     size_t pNext_size = 0u;
4612     while (!pNext_size && from_pNext) {
4613         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4614         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4615     }
4616     to->pNext = nullptr;
4617     if (pNext_size) {
4618         to->pNext = (void*)alloc->alloc(pNext_size);
4619         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4620     }
4621     to->pViewFormats = nullptr;
4622     if (from->pViewFormats) {
4623         to->pViewFormats = (VkFormat*)alloc->dupArray(
4624             from->pViewFormats, from->viewFormatCount * sizeof(const VkFormat));
4625     }
4626 }
4627 
deepcopy_VkFramebufferAttachmentsCreateInfo(Allocator * alloc,VkStructureType rootType,const VkFramebufferAttachmentsCreateInfo * from,VkFramebufferAttachmentsCreateInfo * to)4628 void deepcopy_VkFramebufferAttachmentsCreateInfo(Allocator* alloc, VkStructureType rootType,
4629                                                  const VkFramebufferAttachmentsCreateInfo* from,
4630                                                  VkFramebufferAttachmentsCreateInfo* to) {
4631     (void)alloc;
4632     (void)rootType;
4633     *to = *from;
4634     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4635         rootType = from->sType;
4636     }
4637     const void* from_pNext = from;
4638     size_t pNext_size = 0u;
4639     while (!pNext_size && from_pNext) {
4640         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4641         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4642     }
4643     to->pNext = nullptr;
4644     if (pNext_size) {
4645         to->pNext = (void*)alloc->alloc(pNext_size);
4646         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4647     }
4648     if (from) {
4649         to->pAttachmentImageInfos = nullptr;
4650         if (from->pAttachmentImageInfos) {
4651             to->pAttachmentImageInfos = (VkFramebufferAttachmentImageInfo*)alloc->alloc(
4652                 from->attachmentImageInfoCount * sizeof(const VkFramebufferAttachmentImageInfo));
4653             to->attachmentImageInfoCount = from->attachmentImageInfoCount;
4654             for (uint32_t i = 0; i < (uint32_t)from->attachmentImageInfoCount; ++i) {
4655                 deepcopy_VkFramebufferAttachmentImageInfo(
4656                     alloc, rootType, from->pAttachmentImageInfos + i,
4657                     (VkFramebufferAttachmentImageInfo*)(to->pAttachmentImageInfos + i));
4658             }
4659         }
4660     }
4661 }
4662 
deepcopy_VkRenderPassAttachmentBeginInfo(Allocator * alloc,VkStructureType rootType,const VkRenderPassAttachmentBeginInfo * from,VkRenderPassAttachmentBeginInfo * to)4663 void deepcopy_VkRenderPassAttachmentBeginInfo(Allocator* alloc, VkStructureType rootType,
4664                                               const VkRenderPassAttachmentBeginInfo* from,
4665                                               VkRenderPassAttachmentBeginInfo* to) {
4666     (void)alloc;
4667     (void)rootType;
4668     *to = *from;
4669     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4670         rootType = from->sType;
4671     }
4672     const void* from_pNext = from;
4673     size_t pNext_size = 0u;
4674     while (!pNext_size && from_pNext) {
4675         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4676         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4677     }
4678     to->pNext = nullptr;
4679     if (pNext_size) {
4680         to->pNext = (void*)alloc->alloc(pNext_size);
4681         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4682     }
4683     to->pAttachments = nullptr;
4684     if (from->pAttachments) {
4685         to->pAttachments = (VkImageView*)alloc->dupArray(
4686             from->pAttachments, from->attachmentCount * sizeof(const VkImageView));
4687     }
4688 }
4689 
deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceUniformBufferStandardLayoutFeatures * from,VkPhysicalDeviceUniformBufferStandardLayoutFeatures * to)4690 void deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
4691     Allocator* alloc, VkStructureType rootType,
4692     const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* from,
4693     VkPhysicalDeviceUniformBufferStandardLayoutFeatures* to) {
4694     (void)alloc;
4695     (void)rootType;
4696     *to = *from;
4697     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4698         rootType = from->sType;
4699     }
4700     const void* from_pNext = from;
4701     size_t pNext_size = 0u;
4702     while (!pNext_size && from_pNext) {
4703         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4704         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4705     }
4706     to->pNext = nullptr;
4707     if (pNext_size) {
4708         to->pNext = (void*)alloc->alloc(pNext_size);
4709         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4710     }
4711 }
4712 
deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures * from,VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures * to)4713 void deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
4714     Allocator* alloc, VkStructureType rootType,
4715     const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* from,
4716     VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* to) {
4717     (void)alloc;
4718     (void)rootType;
4719     *to = *from;
4720     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4721         rootType = from->sType;
4722     }
4723     const void* from_pNext = from;
4724     size_t pNext_size = 0u;
4725     while (!pNext_size && from_pNext) {
4726         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4727         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4728     }
4729     to->pNext = nullptr;
4730     if (pNext_size) {
4731         to->pNext = (void*)alloc->alloc(pNext_size);
4732         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4733     }
4734 }
4735 
deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures * from,VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures * to)4736 void deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
4737     Allocator* alloc, VkStructureType rootType,
4738     const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* from,
4739     VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* to) {
4740     (void)alloc;
4741     (void)rootType;
4742     *to = *from;
4743     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4744         rootType = from->sType;
4745     }
4746     const void* from_pNext = from;
4747     size_t pNext_size = 0u;
4748     while (!pNext_size && from_pNext) {
4749         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4750         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4751     }
4752     to->pNext = nullptr;
4753     if (pNext_size) {
4754         to->pNext = (void*)alloc->alloc(pNext_size);
4755         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4756     }
4757 }
4758 
deepcopy_VkAttachmentReferenceStencilLayout(Allocator * alloc,VkStructureType rootType,const VkAttachmentReferenceStencilLayout * from,VkAttachmentReferenceStencilLayout * to)4759 void deepcopy_VkAttachmentReferenceStencilLayout(Allocator* alloc, VkStructureType rootType,
4760                                                  const VkAttachmentReferenceStencilLayout* from,
4761                                                  VkAttachmentReferenceStencilLayout* to) {
4762     (void)alloc;
4763     (void)rootType;
4764     *to = *from;
4765     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4766         rootType = from->sType;
4767     }
4768     const void* from_pNext = from;
4769     size_t pNext_size = 0u;
4770     while (!pNext_size && from_pNext) {
4771         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4772         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4773     }
4774     to->pNext = nullptr;
4775     if (pNext_size) {
4776         to->pNext = (void*)alloc->alloc(pNext_size);
4777         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4778     }
4779 }
4780 
deepcopy_VkAttachmentDescriptionStencilLayout(Allocator * alloc,VkStructureType rootType,const VkAttachmentDescriptionStencilLayout * from,VkAttachmentDescriptionStencilLayout * to)4781 void deepcopy_VkAttachmentDescriptionStencilLayout(Allocator* alloc, VkStructureType rootType,
4782                                                    const VkAttachmentDescriptionStencilLayout* from,
4783                                                    VkAttachmentDescriptionStencilLayout* to) {
4784     (void)alloc;
4785     (void)rootType;
4786     *to = *from;
4787     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4788         rootType = from->sType;
4789     }
4790     const void* from_pNext = from;
4791     size_t pNext_size = 0u;
4792     while (!pNext_size && from_pNext) {
4793         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4794         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4795     }
4796     to->pNext = nullptr;
4797     if (pNext_size) {
4798         to->pNext = (void*)alloc->alloc(pNext_size);
4799         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4800     }
4801 }
4802 
deepcopy_VkPhysicalDeviceHostQueryResetFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceHostQueryResetFeatures * from,VkPhysicalDeviceHostQueryResetFeatures * to)4803 void deepcopy_VkPhysicalDeviceHostQueryResetFeatures(
4804     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceHostQueryResetFeatures* from,
4805     VkPhysicalDeviceHostQueryResetFeatures* to) {
4806     (void)alloc;
4807     (void)rootType;
4808     *to = *from;
4809     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4810         rootType = from->sType;
4811     }
4812     const void* from_pNext = from;
4813     size_t pNext_size = 0u;
4814     while (!pNext_size && from_pNext) {
4815         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4816         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4817     }
4818     to->pNext = nullptr;
4819     if (pNext_size) {
4820         to->pNext = (void*)alloc->alloc(pNext_size);
4821         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4822     }
4823 }
4824 
deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTimelineSemaphoreFeatures * from,VkPhysicalDeviceTimelineSemaphoreFeatures * to)4825 void deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(
4826     Allocator* alloc, VkStructureType rootType,
4827     const VkPhysicalDeviceTimelineSemaphoreFeatures* from,
4828     VkPhysicalDeviceTimelineSemaphoreFeatures* to) {
4829     (void)alloc;
4830     (void)rootType;
4831     *to = *from;
4832     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4833         rootType = from->sType;
4834     }
4835     const void* from_pNext = from;
4836     size_t pNext_size = 0u;
4837     while (!pNext_size && from_pNext) {
4838         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4839         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4840     }
4841     to->pNext = nullptr;
4842     if (pNext_size) {
4843         to->pNext = (void*)alloc->alloc(pNext_size);
4844         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4845     }
4846 }
4847 
deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTimelineSemaphoreProperties * from,VkPhysicalDeviceTimelineSemaphoreProperties * to)4848 void deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(
4849     Allocator* alloc, VkStructureType rootType,
4850     const VkPhysicalDeviceTimelineSemaphoreProperties* from,
4851     VkPhysicalDeviceTimelineSemaphoreProperties* to) {
4852     (void)alloc;
4853     (void)rootType;
4854     *to = *from;
4855     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4856         rootType = from->sType;
4857     }
4858     const void* from_pNext = from;
4859     size_t pNext_size = 0u;
4860     while (!pNext_size && from_pNext) {
4861         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4862         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4863     }
4864     to->pNext = nullptr;
4865     if (pNext_size) {
4866         to->pNext = (void*)alloc->alloc(pNext_size);
4867         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4868     }
4869 }
4870 
deepcopy_VkSemaphoreTypeCreateInfo(Allocator * alloc,VkStructureType rootType,const VkSemaphoreTypeCreateInfo * from,VkSemaphoreTypeCreateInfo * to)4871 void deepcopy_VkSemaphoreTypeCreateInfo(Allocator* alloc, VkStructureType rootType,
4872                                         const VkSemaphoreTypeCreateInfo* from,
4873                                         VkSemaphoreTypeCreateInfo* to) {
4874     (void)alloc;
4875     (void)rootType;
4876     *to = *from;
4877     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4878         rootType = from->sType;
4879     }
4880     const void* from_pNext = from;
4881     size_t pNext_size = 0u;
4882     while (!pNext_size && from_pNext) {
4883         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4884         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4885     }
4886     to->pNext = nullptr;
4887     if (pNext_size) {
4888         to->pNext = (void*)alloc->alloc(pNext_size);
4889         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4890     }
4891 }
4892 
deepcopy_VkTimelineSemaphoreSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkTimelineSemaphoreSubmitInfo * from,VkTimelineSemaphoreSubmitInfo * to)4893 void deepcopy_VkTimelineSemaphoreSubmitInfo(Allocator* alloc, VkStructureType rootType,
4894                                             const VkTimelineSemaphoreSubmitInfo* from,
4895                                             VkTimelineSemaphoreSubmitInfo* to) {
4896     (void)alloc;
4897     (void)rootType;
4898     *to = *from;
4899     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4900         rootType = from->sType;
4901     }
4902     const void* from_pNext = from;
4903     size_t pNext_size = 0u;
4904     while (!pNext_size && from_pNext) {
4905         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4906         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4907     }
4908     to->pNext = nullptr;
4909     if (pNext_size) {
4910         to->pNext = (void*)alloc->alloc(pNext_size);
4911         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4912     }
4913     to->pWaitSemaphoreValues = nullptr;
4914     if (from->pWaitSemaphoreValues) {
4915         to->pWaitSemaphoreValues = (uint64_t*)alloc->dupArray(
4916             from->pWaitSemaphoreValues, from->waitSemaphoreValueCount * sizeof(const uint64_t));
4917     }
4918     to->pSignalSemaphoreValues = nullptr;
4919     if (from->pSignalSemaphoreValues) {
4920         to->pSignalSemaphoreValues = (uint64_t*)alloc->dupArray(
4921             from->pSignalSemaphoreValues, from->signalSemaphoreValueCount * sizeof(const uint64_t));
4922     }
4923 }
4924 
deepcopy_VkSemaphoreWaitInfo(Allocator * alloc,VkStructureType rootType,const VkSemaphoreWaitInfo * from,VkSemaphoreWaitInfo * to)4925 void deepcopy_VkSemaphoreWaitInfo(Allocator* alloc, VkStructureType rootType,
4926                                   const VkSemaphoreWaitInfo* from, VkSemaphoreWaitInfo* to) {
4927     (void)alloc;
4928     (void)rootType;
4929     *to = *from;
4930     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4931         rootType = from->sType;
4932     }
4933     const void* from_pNext = from;
4934     size_t pNext_size = 0u;
4935     while (!pNext_size && from_pNext) {
4936         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4937         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4938     }
4939     to->pNext = nullptr;
4940     if (pNext_size) {
4941         to->pNext = (void*)alloc->alloc(pNext_size);
4942         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4943     }
4944     to->pSemaphores = nullptr;
4945     if (from->pSemaphores) {
4946         to->pSemaphores = (VkSemaphore*)alloc->dupArray(
4947             from->pSemaphores, from->semaphoreCount * sizeof(const VkSemaphore));
4948     }
4949     to->pValues = nullptr;
4950     if (from->pValues) {
4951         to->pValues = (uint64_t*)alloc->dupArray(from->pValues,
4952                                                  from->semaphoreCount * sizeof(const uint64_t));
4953     }
4954 }
4955 
deepcopy_VkSemaphoreSignalInfo(Allocator * alloc,VkStructureType rootType,const VkSemaphoreSignalInfo * from,VkSemaphoreSignalInfo * to)4956 void deepcopy_VkSemaphoreSignalInfo(Allocator* alloc, VkStructureType rootType,
4957                                     const VkSemaphoreSignalInfo* from, VkSemaphoreSignalInfo* to) {
4958     (void)alloc;
4959     (void)rootType;
4960     *to = *from;
4961     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4962         rootType = from->sType;
4963     }
4964     const void* from_pNext = from;
4965     size_t pNext_size = 0u;
4966     while (!pNext_size && from_pNext) {
4967         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4968         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4969     }
4970     to->pNext = nullptr;
4971     if (pNext_size) {
4972         to->pNext = (void*)alloc->alloc(pNext_size);
4973         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4974     }
4975 }
4976 
deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceBufferDeviceAddressFeatures * from,VkPhysicalDeviceBufferDeviceAddressFeatures * to)4977 void deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(
4978     Allocator* alloc, VkStructureType rootType,
4979     const VkPhysicalDeviceBufferDeviceAddressFeatures* from,
4980     VkPhysicalDeviceBufferDeviceAddressFeatures* to) {
4981     (void)alloc;
4982     (void)rootType;
4983     *to = *from;
4984     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
4985         rootType = from->sType;
4986     }
4987     const void* from_pNext = from;
4988     size_t pNext_size = 0u;
4989     while (!pNext_size && from_pNext) {
4990         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
4991         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
4992     }
4993     to->pNext = nullptr;
4994     if (pNext_size) {
4995         to->pNext = (void*)alloc->alloc(pNext_size);
4996         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
4997     }
4998 }
4999 
deepcopy_VkBufferDeviceAddressInfo(Allocator * alloc,VkStructureType rootType,const VkBufferDeviceAddressInfo * from,VkBufferDeviceAddressInfo * to)5000 void deepcopy_VkBufferDeviceAddressInfo(Allocator* alloc, VkStructureType rootType,
5001                                         const VkBufferDeviceAddressInfo* from,
5002                                         VkBufferDeviceAddressInfo* to) {
5003     (void)alloc;
5004     (void)rootType;
5005     *to = *from;
5006     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5007         rootType = from->sType;
5008     }
5009     const void* from_pNext = from;
5010     size_t pNext_size = 0u;
5011     while (!pNext_size && from_pNext) {
5012         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5013         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5014     }
5015     to->pNext = nullptr;
5016     if (pNext_size) {
5017         to->pNext = (void*)alloc->alloc(pNext_size);
5018         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5019     }
5020 }
5021 
deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(Allocator * alloc,VkStructureType rootType,const VkBufferOpaqueCaptureAddressCreateInfo * from,VkBufferOpaqueCaptureAddressCreateInfo * to)5022 void deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(
5023     Allocator* alloc, VkStructureType rootType, const VkBufferOpaqueCaptureAddressCreateInfo* from,
5024     VkBufferOpaqueCaptureAddressCreateInfo* to) {
5025     (void)alloc;
5026     (void)rootType;
5027     *to = *from;
5028     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5029         rootType = from->sType;
5030     }
5031     const void* from_pNext = from;
5032     size_t pNext_size = 0u;
5033     while (!pNext_size && from_pNext) {
5034         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5035         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5036     }
5037     to->pNext = nullptr;
5038     if (pNext_size) {
5039         to->pNext = (void*)alloc->alloc(pNext_size);
5040         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5041     }
5042 }
5043 
deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryOpaqueCaptureAddressAllocateInfo * from,VkMemoryOpaqueCaptureAddressAllocateInfo * to)5044 void deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(
5045     Allocator* alloc, VkStructureType rootType,
5046     const VkMemoryOpaqueCaptureAddressAllocateInfo* from,
5047     VkMemoryOpaqueCaptureAddressAllocateInfo* to) {
5048     (void)alloc;
5049     (void)rootType;
5050     *to = *from;
5051     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5052         rootType = from->sType;
5053     }
5054     const void* from_pNext = from;
5055     size_t pNext_size = 0u;
5056     while (!pNext_size && from_pNext) {
5057         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5058         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5059     }
5060     to->pNext = nullptr;
5061     if (pNext_size) {
5062         to->pNext = (void*)alloc->alloc(pNext_size);
5063         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5064     }
5065 }
5066 
deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceMemoryOpaqueCaptureAddressInfo * from,VkDeviceMemoryOpaqueCaptureAddressInfo * to)5067 void deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(
5068     Allocator* alloc, VkStructureType rootType, const VkDeviceMemoryOpaqueCaptureAddressInfo* from,
5069     VkDeviceMemoryOpaqueCaptureAddressInfo* to) {
5070     (void)alloc;
5071     (void)rootType;
5072     *to = *from;
5073     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5074         rootType = from->sType;
5075     }
5076     const void* from_pNext = from;
5077     size_t pNext_size = 0u;
5078     while (!pNext_size && from_pNext) {
5079         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5080         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5081     }
5082     to->pNext = nullptr;
5083     if (pNext_size) {
5084         to->pNext = (void*)alloc->alloc(pNext_size);
5085         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5086     }
5087 }
5088 
5089 #endif
5090 #ifdef VK_VERSION_1_3
deepcopy_VkPhysicalDeviceVulkan13Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan13Features * from,VkPhysicalDeviceVulkan13Features * to)5091 void deepcopy_VkPhysicalDeviceVulkan13Features(Allocator* alloc, VkStructureType rootType,
5092                                                const VkPhysicalDeviceVulkan13Features* from,
5093                                                VkPhysicalDeviceVulkan13Features* to) {
5094     (void)alloc;
5095     (void)rootType;
5096     *to = *from;
5097     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5098         rootType = from->sType;
5099     }
5100     const void* from_pNext = from;
5101     size_t pNext_size = 0u;
5102     while (!pNext_size && from_pNext) {
5103         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5104         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5105     }
5106     to->pNext = nullptr;
5107     if (pNext_size) {
5108         to->pNext = (void*)alloc->alloc(pNext_size);
5109         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5110     }
5111 }
5112 
deepcopy_VkPhysicalDeviceVulkan13Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan13Properties * from,VkPhysicalDeviceVulkan13Properties * to)5113 void deepcopy_VkPhysicalDeviceVulkan13Properties(Allocator* alloc, VkStructureType rootType,
5114                                                  const VkPhysicalDeviceVulkan13Properties* from,
5115                                                  VkPhysicalDeviceVulkan13Properties* to) {
5116     (void)alloc;
5117     (void)rootType;
5118     *to = *from;
5119     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5120         rootType = from->sType;
5121     }
5122     const void* from_pNext = from;
5123     size_t pNext_size = 0u;
5124     while (!pNext_size && from_pNext) {
5125         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5126         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5127     }
5128     to->pNext = nullptr;
5129     if (pNext_size) {
5130         to->pNext = (void*)alloc->alloc(pNext_size);
5131         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5132     }
5133 }
5134 
deepcopy_VkPipelineCreationFeedback(Allocator * alloc,VkStructureType rootType,const VkPipelineCreationFeedback * from,VkPipelineCreationFeedback * to)5135 void deepcopy_VkPipelineCreationFeedback(Allocator* alloc, VkStructureType rootType,
5136                                          const VkPipelineCreationFeedback* from,
5137                                          VkPipelineCreationFeedback* to) {
5138     (void)alloc;
5139     (void)rootType;
5140     *to = *from;
5141 }
5142 
deepcopy_VkPipelineCreationFeedbackCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineCreationFeedbackCreateInfo * from,VkPipelineCreationFeedbackCreateInfo * to)5143 void deepcopy_VkPipelineCreationFeedbackCreateInfo(Allocator* alloc, VkStructureType rootType,
5144                                                    const VkPipelineCreationFeedbackCreateInfo* from,
5145                                                    VkPipelineCreationFeedbackCreateInfo* to) {
5146     (void)alloc;
5147     (void)rootType;
5148     *to = *from;
5149     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5150         rootType = from->sType;
5151     }
5152     const void* from_pNext = from;
5153     size_t pNext_size = 0u;
5154     while (!pNext_size && from_pNext) {
5155         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5156         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5157     }
5158     to->pNext = nullptr;
5159     if (pNext_size) {
5160         to->pNext = (void*)alloc->alloc(pNext_size);
5161         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5162     }
5163     to->pPipelineCreationFeedback = nullptr;
5164     if (from->pPipelineCreationFeedback) {
5165         to->pPipelineCreationFeedback =
5166             (VkPipelineCreationFeedback*)alloc->alloc(sizeof(VkPipelineCreationFeedback));
5167         deepcopy_VkPipelineCreationFeedback(
5168             alloc, rootType, from->pPipelineCreationFeedback,
5169             (VkPipelineCreationFeedback*)(to->pPipelineCreationFeedback));
5170     }
5171     if (from) {
5172         to->pPipelineStageCreationFeedbacks = nullptr;
5173         if (from->pPipelineStageCreationFeedbacks) {
5174             to->pPipelineStageCreationFeedbacks = (VkPipelineCreationFeedback*)alloc->alloc(
5175                 from->pipelineStageCreationFeedbackCount * sizeof(VkPipelineCreationFeedback));
5176             to->pipelineStageCreationFeedbackCount = from->pipelineStageCreationFeedbackCount;
5177             for (uint32_t i = 0; i < (uint32_t)from->pipelineStageCreationFeedbackCount; ++i) {
5178                 deepcopy_VkPipelineCreationFeedback(
5179                     alloc, rootType, from->pPipelineStageCreationFeedbacks + i,
5180                     (VkPipelineCreationFeedback*)(to->pPipelineStageCreationFeedbacks + i));
5181             }
5182         }
5183     }
5184 }
5185 
deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderTerminateInvocationFeatures * from,VkPhysicalDeviceShaderTerminateInvocationFeatures * to)5186 void deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeatures(
5187     Allocator* alloc, VkStructureType rootType,
5188     const VkPhysicalDeviceShaderTerminateInvocationFeatures* from,
5189     VkPhysicalDeviceShaderTerminateInvocationFeatures* to) {
5190     (void)alloc;
5191     (void)rootType;
5192     *to = *from;
5193     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5194         rootType = from->sType;
5195     }
5196     const void* from_pNext = from;
5197     size_t pNext_size = 0u;
5198     while (!pNext_size && from_pNext) {
5199         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5200         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5201     }
5202     to->pNext = nullptr;
5203     if (pNext_size) {
5204         to->pNext = (void*)alloc->alloc(pNext_size);
5205         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5206     }
5207 }
5208 
deepcopy_VkPhysicalDeviceToolProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceToolProperties * from,VkPhysicalDeviceToolProperties * to)5209 void deepcopy_VkPhysicalDeviceToolProperties(Allocator* alloc, VkStructureType rootType,
5210                                              const VkPhysicalDeviceToolProperties* from,
5211                                              VkPhysicalDeviceToolProperties* to) {
5212     (void)alloc;
5213     (void)rootType;
5214     *to = *from;
5215     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5216         rootType = from->sType;
5217     }
5218     const void* from_pNext = from;
5219     size_t pNext_size = 0u;
5220     while (!pNext_size && from_pNext) {
5221         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5222         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5223     }
5224     to->pNext = nullptr;
5225     if (pNext_size) {
5226         to->pNext = (void*)alloc->alloc(pNext_size);
5227         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5228     }
5229     memcpy(to->name, from->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
5230     memcpy(to->version, from->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
5231     memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
5232     memcpy(to->layer, from->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
5233 }
5234 
deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures * from,VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures * to)5235 void deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures(
5236     Allocator* alloc, VkStructureType rootType,
5237     const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures* from,
5238     VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures* to) {
5239     (void)alloc;
5240     (void)rootType;
5241     *to = *from;
5242     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5243         rootType = from->sType;
5244     }
5245     const void* from_pNext = from;
5246     size_t pNext_size = 0u;
5247     while (!pNext_size && from_pNext) {
5248         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5249         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5250     }
5251     to->pNext = nullptr;
5252     if (pNext_size) {
5253         to->pNext = (void*)alloc->alloc(pNext_size);
5254         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5255     }
5256 }
5257 
deepcopy_VkPhysicalDevicePrivateDataFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePrivateDataFeatures * from,VkPhysicalDevicePrivateDataFeatures * to)5258 void deepcopy_VkPhysicalDevicePrivateDataFeatures(Allocator* alloc, VkStructureType rootType,
5259                                                   const VkPhysicalDevicePrivateDataFeatures* from,
5260                                                   VkPhysicalDevicePrivateDataFeatures* to) {
5261     (void)alloc;
5262     (void)rootType;
5263     *to = *from;
5264     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5265         rootType = from->sType;
5266     }
5267     const void* from_pNext = from;
5268     size_t pNext_size = 0u;
5269     while (!pNext_size && from_pNext) {
5270         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5271         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5272     }
5273     to->pNext = nullptr;
5274     if (pNext_size) {
5275         to->pNext = (void*)alloc->alloc(pNext_size);
5276         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5277     }
5278 }
5279 
deepcopy_VkDevicePrivateDataCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDevicePrivateDataCreateInfo * from,VkDevicePrivateDataCreateInfo * to)5280 void deepcopy_VkDevicePrivateDataCreateInfo(Allocator* alloc, VkStructureType rootType,
5281                                             const VkDevicePrivateDataCreateInfo* from,
5282                                             VkDevicePrivateDataCreateInfo* to) {
5283     (void)alloc;
5284     (void)rootType;
5285     *to = *from;
5286     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5287         rootType = from->sType;
5288     }
5289     const void* from_pNext = from;
5290     size_t pNext_size = 0u;
5291     while (!pNext_size && from_pNext) {
5292         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5293         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5294     }
5295     to->pNext = nullptr;
5296     if (pNext_size) {
5297         to->pNext = (void*)alloc->alloc(pNext_size);
5298         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5299     }
5300 }
5301 
deepcopy_VkPrivateDataSlotCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPrivateDataSlotCreateInfo * from,VkPrivateDataSlotCreateInfo * to)5302 void deepcopy_VkPrivateDataSlotCreateInfo(Allocator* alloc, VkStructureType rootType,
5303                                           const VkPrivateDataSlotCreateInfo* from,
5304                                           VkPrivateDataSlotCreateInfo* to) {
5305     (void)alloc;
5306     (void)rootType;
5307     *to = *from;
5308     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5309         rootType = from->sType;
5310     }
5311     const void* from_pNext = from;
5312     size_t pNext_size = 0u;
5313     while (!pNext_size && from_pNext) {
5314         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5315         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5316     }
5317     to->pNext = nullptr;
5318     if (pNext_size) {
5319         to->pNext = (void*)alloc->alloc(pNext_size);
5320         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5321     }
5322 }
5323 
deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePipelineCreationCacheControlFeatures * from,VkPhysicalDevicePipelineCreationCacheControlFeatures * to)5324 void deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeatures(
5325     Allocator* alloc, VkStructureType rootType,
5326     const VkPhysicalDevicePipelineCreationCacheControlFeatures* from,
5327     VkPhysicalDevicePipelineCreationCacheControlFeatures* to) {
5328     (void)alloc;
5329     (void)rootType;
5330     *to = *from;
5331     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5332         rootType = from->sType;
5333     }
5334     const void* from_pNext = from;
5335     size_t pNext_size = 0u;
5336     while (!pNext_size && from_pNext) {
5337         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5338         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5339     }
5340     to->pNext = nullptr;
5341     if (pNext_size) {
5342         to->pNext = (void*)alloc->alloc(pNext_size);
5343         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5344     }
5345 }
5346 
deepcopy_VkMemoryBarrier2(Allocator * alloc,VkStructureType rootType,const VkMemoryBarrier2 * from,VkMemoryBarrier2 * to)5347 void deepcopy_VkMemoryBarrier2(Allocator* alloc, VkStructureType rootType,
5348                                const VkMemoryBarrier2* from, VkMemoryBarrier2* to) {
5349     (void)alloc;
5350     (void)rootType;
5351     *to = *from;
5352     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5353         rootType = from->sType;
5354     }
5355     const void* from_pNext = from;
5356     size_t pNext_size = 0u;
5357     while (!pNext_size && from_pNext) {
5358         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5359         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5360     }
5361     to->pNext = nullptr;
5362     if (pNext_size) {
5363         to->pNext = (void*)alloc->alloc(pNext_size);
5364         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5365     }
5366 }
5367 
deepcopy_VkBufferMemoryBarrier2(Allocator * alloc,VkStructureType rootType,const VkBufferMemoryBarrier2 * from,VkBufferMemoryBarrier2 * to)5368 void deepcopy_VkBufferMemoryBarrier2(Allocator* alloc, VkStructureType rootType,
5369                                      const VkBufferMemoryBarrier2* from,
5370                                      VkBufferMemoryBarrier2* to) {
5371     (void)alloc;
5372     (void)rootType;
5373     *to = *from;
5374     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5375         rootType = from->sType;
5376     }
5377     const void* from_pNext = from;
5378     size_t pNext_size = 0u;
5379     while (!pNext_size && from_pNext) {
5380         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5381         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5382     }
5383     to->pNext = nullptr;
5384     if (pNext_size) {
5385         to->pNext = (void*)alloc->alloc(pNext_size);
5386         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5387     }
5388 }
5389 
deepcopy_VkImageMemoryBarrier2(Allocator * alloc,VkStructureType rootType,const VkImageMemoryBarrier2 * from,VkImageMemoryBarrier2 * to)5390 void deepcopy_VkImageMemoryBarrier2(Allocator* alloc, VkStructureType rootType,
5391                                     const VkImageMemoryBarrier2* from, VkImageMemoryBarrier2* to) {
5392     (void)alloc;
5393     (void)rootType;
5394     *to = *from;
5395     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5396         rootType = from->sType;
5397     }
5398     const void* from_pNext = from;
5399     size_t pNext_size = 0u;
5400     while (!pNext_size && from_pNext) {
5401         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5402         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5403     }
5404     to->pNext = nullptr;
5405     if (pNext_size) {
5406         to->pNext = (void*)alloc->alloc(pNext_size);
5407         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5408     }
5409     deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
5410                                      (VkImageSubresourceRange*)(&to->subresourceRange));
5411 }
5412 
deepcopy_VkDependencyInfo(Allocator * alloc,VkStructureType rootType,const VkDependencyInfo * from,VkDependencyInfo * to)5413 void deepcopy_VkDependencyInfo(Allocator* alloc, VkStructureType rootType,
5414                                const VkDependencyInfo* from, VkDependencyInfo* to) {
5415     (void)alloc;
5416     (void)rootType;
5417     *to = *from;
5418     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5419         rootType = from->sType;
5420     }
5421     const void* from_pNext = from;
5422     size_t pNext_size = 0u;
5423     while (!pNext_size && from_pNext) {
5424         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5425         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5426     }
5427     to->pNext = nullptr;
5428     if (pNext_size) {
5429         to->pNext = (void*)alloc->alloc(pNext_size);
5430         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5431     }
5432     if (from) {
5433         to->pMemoryBarriers = nullptr;
5434         if (from->pMemoryBarriers) {
5435             to->pMemoryBarriers = (VkMemoryBarrier2*)alloc->alloc(from->memoryBarrierCount *
5436                                                                   sizeof(const VkMemoryBarrier2));
5437             to->memoryBarrierCount = from->memoryBarrierCount;
5438             for (uint32_t i = 0; i < (uint32_t)from->memoryBarrierCount; ++i) {
5439                 deepcopy_VkMemoryBarrier2(alloc, rootType, from->pMemoryBarriers + i,
5440                                           (VkMemoryBarrier2*)(to->pMemoryBarriers + i));
5441             }
5442         }
5443     }
5444     if (from) {
5445         to->pBufferMemoryBarriers = nullptr;
5446         if (from->pBufferMemoryBarriers) {
5447             to->pBufferMemoryBarriers = (VkBufferMemoryBarrier2*)alloc->alloc(
5448                 from->bufferMemoryBarrierCount * sizeof(const VkBufferMemoryBarrier2));
5449             to->bufferMemoryBarrierCount = from->bufferMemoryBarrierCount;
5450             for (uint32_t i = 0; i < (uint32_t)from->bufferMemoryBarrierCount; ++i) {
5451                 deepcopy_VkBufferMemoryBarrier2(
5452                     alloc, rootType, from->pBufferMemoryBarriers + i,
5453                     (VkBufferMemoryBarrier2*)(to->pBufferMemoryBarriers + i));
5454             }
5455         }
5456     }
5457     if (from) {
5458         to->pImageMemoryBarriers = nullptr;
5459         if (from->pImageMemoryBarriers) {
5460             to->pImageMemoryBarriers = (VkImageMemoryBarrier2*)alloc->alloc(
5461                 from->imageMemoryBarrierCount * sizeof(const VkImageMemoryBarrier2));
5462             to->imageMemoryBarrierCount = from->imageMemoryBarrierCount;
5463             for (uint32_t i = 0; i < (uint32_t)from->imageMemoryBarrierCount; ++i) {
5464                 deepcopy_VkImageMemoryBarrier2(
5465                     alloc, rootType, from->pImageMemoryBarriers + i,
5466                     (VkImageMemoryBarrier2*)(to->pImageMemoryBarriers + i));
5467             }
5468         }
5469     }
5470 }
5471 
deepcopy_VkSemaphoreSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkSemaphoreSubmitInfo * from,VkSemaphoreSubmitInfo * to)5472 void deepcopy_VkSemaphoreSubmitInfo(Allocator* alloc, VkStructureType rootType,
5473                                     const VkSemaphoreSubmitInfo* from, VkSemaphoreSubmitInfo* to) {
5474     (void)alloc;
5475     (void)rootType;
5476     *to = *from;
5477     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5478         rootType = from->sType;
5479     }
5480     const void* from_pNext = from;
5481     size_t pNext_size = 0u;
5482     while (!pNext_size && from_pNext) {
5483         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5484         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5485     }
5486     to->pNext = nullptr;
5487     if (pNext_size) {
5488         to->pNext = (void*)alloc->alloc(pNext_size);
5489         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5490     }
5491 }
5492 
deepcopy_VkCommandBufferSubmitInfo(Allocator * alloc,VkStructureType rootType,const VkCommandBufferSubmitInfo * from,VkCommandBufferSubmitInfo * to)5493 void deepcopy_VkCommandBufferSubmitInfo(Allocator* alloc, VkStructureType rootType,
5494                                         const VkCommandBufferSubmitInfo* from,
5495                                         VkCommandBufferSubmitInfo* to) {
5496     (void)alloc;
5497     (void)rootType;
5498     *to = *from;
5499     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5500         rootType = from->sType;
5501     }
5502     const void* from_pNext = from;
5503     size_t pNext_size = 0u;
5504     while (!pNext_size && from_pNext) {
5505         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5506         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5507     }
5508     to->pNext = nullptr;
5509     if (pNext_size) {
5510         to->pNext = (void*)alloc->alloc(pNext_size);
5511         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5512     }
5513 }
5514 
deepcopy_VkSubmitInfo2(Allocator * alloc,VkStructureType rootType,const VkSubmitInfo2 * from,VkSubmitInfo2 * to)5515 void deepcopy_VkSubmitInfo2(Allocator* alloc, VkStructureType rootType, const VkSubmitInfo2* from,
5516                             VkSubmitInfo2* to) {
5517     (void)alloc;
5518     (void)rootType;
5519     *to = *from;
5520     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5521         rootType = from->sType;
5522     }
5523     const void* from_pNext = from;
5524     size_t pNext_size = 0u;
5525     while (!pNext_size && from_pNext) {
5526         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5527         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5528     }
5529     to->pNext = nullptr;
5530     if (pNext_size) {
5531         to->pNext = (void*)alloc->alloc(pNext_size);
5532         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5533     }
5534     if (from) {
5535         to->pWaitSemaphoreInfos = nullptr;
5536         if (from->pWaitSemaphoreInfos) {
5537             to->pWaitSemaphoreInfos = (VkSemaphoreSubmitInfo*)alloc->alloc(
5538                 from->waitSemaphoreInfoCount * sizeof(const VkSemaphoreSubmitInfo));
5539             to->waitSemaphoreInfoCount = from->waitSemaphoreInfoCount;
5540             for (uint32_t i = 0; i < (uint32_t)from->waitSemaphoreInfoCount; ++i) {
5541                 deepcopy_VkSemaphoreSubmitInfo(
5542                     alloc, rootType, from->pWaitSemaphoreInfos + i,
5543                     (VkSemaphoreSubmitInfo*)(to->pWaitSemaphoreInfos + i));
5544             }
5545         }
5546     }
5547     if (from) {
5548         to->pCommandBufferInfos = nullptr;
5549         if (from->pCommandBufferInfos) {
5550             to->pCommandBufferInfos = (VkCommandBufferSubmitInfo*)alloc->alloc(
5551                 from->commandBufferInfoCount * sizeof(const VkCommandBufferSubmitInfo));
5552             to->commandBufferInfoCount = from->commandBufferInfoCount;
5553             for (uint32_t i = 0; i < (uint32_t)from->commandBufferInfoCount; ++i) {
5554                 deepcopy_VkCommandBufferSubmitInfo(
5555                     alloc, rootType, from->pCommandBufferInfos + i,
5556                     (VkCommandBufferSubmitInfo*)(to->pCommandBufferInfos + i));
5557             }
5558         }
5559     }
5560     if (from) {
5561         to->pSignalSemaphoreInfos = nullptr;
5562         if (from->pSignalSemaphoreInfos) {
5563             to->pSignalSemaphoreInfos = (VkSemaphoreSubmitInfo*)alloc->alloc(
5564                 from->signalSemaphoreInfoCount * sizeof(const VkSemaphoreSubmitInfo));
5565             to->signalSemaphoreInfoCount = from->signalSemaphoreInfoCount;
5566             for (uint32_t i = 0; i < (uint32_t)from->signalSemaphoreInfoCount; ++i) {
5567                 deepcopy_VkSemaphoreSubmitInfo(
5568                     alloc, rootType, from->pSignalSemaphoreInfos + i,
5569                     (VkSemaphoreSubmitInfo*)(to->pSignalSemaphoreInfos + i));
5570             }
5571         }
5572     }
5573 }
5574 
deepcopy_VkPhysicalDeviceSynchronization2Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSynchronization2Features * from,VkPhysicalDeviceSynchronization2Features * to)5575 void deepcopy_VkPhysicalDeviceSynchronization2Features(
5576     Allocator* alloc, VkStructureType rootType,
5577     const VkPhysicalDeviceSynchronization2Features* from,
5578     VkPhysicalDeviceSynchronization2Features* to) {
5579     (void)alloc;
5580     (void)rootType;
5581     *to = *from;
5582     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5583         rootType = from->sType;
5584     }
5585     const void* from_pNext = from;
5586     size_t pNext_size = 0u;
5587     while (!pNext_size && from_pNext) {
5588         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5589         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5590     }
5591     to->pNext = nullptr;
5592     if (pNext_size) {
5593         to->pNext = (void*)alloc->alloc(pNext_size);
5594         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5595     }
5596 }
5597 
deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures * from,VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures * to)5598 void deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(
5599     Allocator* alloc, VkStructureType rootType,
5600     const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures* from,
5601     VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures* to) {
5602     (void)alloc;
5603     (void)rootType;
5604     *to = *from;
5605     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5606         rootType = from->sType;
5607     }
5608     const void* from_pNext = from;
5609     size_t pNext_size = 0u;
5610     while (!pNext_size && from_pNext) {
5611         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5612         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5613     }
5614     to->pNext = nullptr;
5615     if (pNext_size) {
5616         to->pNext = (void*)alloc->alloc(pNext_size);
5617         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5618     }
5619 }
5620 
deepcopy_VkPhysicalDeviceImageRobustnessFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImageRobustnessFeatures * from,VkPhysicalDeviceImageRobustnessFeatures * to)5621 void deepcopy_VkPhysicalDeviceImageRobustnessFeatures(
5622     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceImageRobustnessFeatures* from,
5623     VkPhysicalDeviceImageRobustnessFeatures* to) {
5624     (void)alloc;
5625     (void)rootType;
5626     *to = *from;
5627     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5628         rootType = from->sType;
5629     }
5630     const void* from_pNext = from;
5631     size_t pNext_size = 0u;
5632     while (!pNext_size && from_pNext) {
5633         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5634         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5635     }
5636     to->pNext = nullptr;
5637     if (pNext_size) {
5638         to->pNext = (void*)alloc->alloc(pNext_size);
5639         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5640     }
5641 }
5642 
deepcopy_VkBufferCopy2(Allocator * alloc,VkStructureType rootType,const VkBufferCopy2 * from,VkBufferCopy2 * to)5643 void deepcopy_VkBufferCopy2(Allocator* alloc, VkStructureType rootType, const VkBufferCopy2* from,
5644                             VkBufferCopy2* to) {
5645     (void)alloc;
5646     (void)rootType;
5647     *to = *from;
5648     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5649         rootType = from->sType;
5650     }
5651     const void* from_pNext = from;
5652     size_t pNext_size = 0u;
5653     while (!pNext_size && from_pNext) {
5654         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5655         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5656     }
5657     to->pNext = nullptr;
5658     if (pNext_size) {
5659         to->pNext = (void*)alloc->alloc(pNext_size);
5660         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5661     }
5662 }
5663 
deepcopy_VkCopyBufferInfo2(Allocator * alloc,VkStructureType rootType,const VkCopyBufferInfo2 * from,VkCopyBufferInfo2 * to)5664 void deepcopy_VkCopyBufferInfo2(Allocator* alloc, VkStructureType rootType,
5665                                 const VkCopyBufferInfo2* from, VkCopyBufferInfo2* to) {
5666     (void)alloc;
5667     (void)rootType;
5668     *to = *from;
5669     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5670         rootType = from->sType;
5671     }
5672     const void* from_pNext = from;
5673     size_t pNext_size = 0u;
5674     while (!pNext_size && from_pNext) {
5675         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5676         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5677     }
5678     to->pNext = nullptr;
5679     if (pNext_size) {
5680         to->pNext = (void*)alloc->alloc(pNext_size);
5681         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5682     }
5683     if (from) {
5684         to->pRegions = nullptr;
5685         if (from->pRegions) {
5686             to->pRegions =
5687                 (VkBufferCopy2*)alloc->alloc(from->regionCount * sizeof(const VkBufferCopy2));
5688             to->regionCount = from->regionCount;
5689             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5690                 deepcopy_VkBufferCopy2(alloc, rootType, from->pRegions + i,
5691                                        (VkBufferCopy2*)(to->pRegions + i));
5692             }
5693         }
5694     }
5695 }
5696 
deepcopy_VkImageCopy2(Allocator * alloc,VkStructureType rootType,const VkImageCopy2 * from,VkImageCopy2 * to)5697 void deepcopy_VkImageCopy2(Allocator* alloc, VkStructureType rootType, const VkImageCopy2* from,
5698                            VkImageCopy2* to) {
5699     (void)alloc;
5700     (void)rootType;
5701     *to = *from;
5702     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5703         rootType = from->sType;
5704     }
5705     const void* from_pNext = from;
5706     size_t pNext_size = 0u;
5707     while (!pNext_size && from_pNext) {
5708         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5709         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5710     }
5711     to->pNext = nullptr;
5712     if (pNext_size) {
5713         to->pNext = (void*)alloc->alloc(pNext_size);
5714         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5715     }
5716     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
5717                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
5718     deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
5719     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
5720                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
5721     deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
5722     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
5723 }
5724 
deepcopy_VkCopyImageInfo2(Allocator * alloc,VkStructureType rootType,const VkCopyImageInfo2 * from,VkCopyImageInfo2 * to)5725 void deepcopy_VkCopyImageInfo2(Allocator* alloc, VkStructureType rootType,
5726                                const VkCopyImageInfo2* from, VkCopyImageInfo2* to) {
5727     (void)alloc;
5728     (void)rootType;
5729     *to = *from;
5730     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5731         rootType = from->sType;
5732     }
5733     const void* from_pNext = from;
5734     size_t pNext_size = 0u;
5735     while (!pNext_size && from_pNext) {
5736         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5737         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5738     }
5739     to->pNext = nullptr;
5740     if (pNext_size) {
5741         to->pNext = (void*)alloc->alloc(pNext_size);
5742         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5743     }
5744     if (from) {
5745         to->pRegions = nullptr;
5746         if (from->pRegions) {
5747             to->pRegions =
5748                 (VkImageCopy2*)alloc->alloc(from->regionCount * sizeof(const VkImageCopy2));
5749             to->regionCount = from->regionCount;
5750             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5751                 deepcopy_VkImageCopy2(alloc, rootType, from->pRegions + i,
5752                                       (VkImageCopy2*)(to->pRegions + i));
5753             }
5754         }
5755     }
5756 }
5757 
deepcopy_VkBufferImageCopy2(Allocator * alloc,VkStructureType rootType,const VkBufferImageCopy2 * from,VkBufferImageCopy2 * to)5758 void deepcopy_VkBufferImageCopy2(Allocator* alloc, VkStructureType rootType,
5759                                  const VkBufferImageCopy2* from, VkBufferImageCopy2* to) {
5760     (void)alloc;
5761     (void)rootType;
5762     *to = *from;
5763     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5764         rootType = from->sType;
5765     }
5766     const void* from_pNext = from;
5767     size_t pNext_size = 0u;
5768     while (!pNext_size && from_pNext) {
5769         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5770         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5771     }
5772     to->pNext = nullptr;
5773     if (pNext_size) {
5774         to->pNext = (void*)alloc->alloc(pNext_size);
5775         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5776     }
5777     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
5778                                       (VkImageSubresourceLayers*)(&to->imageSubresource));
5779     deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
5780     deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
5781 }
5782 
deepcopy_VkCopyBufferToImageInfo2(Allocator * alloc,VkStructureType rootType,const VkCopyBufferToImageInfo2 * from,VkCopyBufferToImageInfo2 * to)5783 void deepcopy_VkCopyBufferToImageInfo2(Allocator* alloc, VkStructureType rootType,
5784                                        const VkCopyBufferToImageInfo2* from,
5785                                        VkCopyBufferToImageInfo2* to) {
5786     (void)alloc;
5787     (void)rootType;
5788     *to = *from;
5789     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5790         rootType = from->sType;
5791     }
5792     const void* from_pNext = from;
5793     size_t pNext_size = 0u;
5794     while (!pNext_size && from_pNext) {
5795         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5796         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5797     }
5798     to->pNext = nullptr;
5799     if (pNext_size) {
5800         to->pNext = (void*)alloc->alloc(pNext_size);
5801         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5802     }
5803     if (from) {
5804         to->pRegions = nullptr;
5805         if (from->pRegions) {
5806             to->pRegions = (VkBufferImageCopy2*)alloc->alloc(from->regionCount *
5807                                                              sizeof(const VkBufferImageCopy2));
5808             to->regionCount = from->regionCount;
5809             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5810                 deepcopy_VkBufferImageCopy2(alloc, rootType, from->pRegions + i,
5811                                             (VkBufferImageCopy2*)(to->pRegions + i));
5812             }
5813         }
5814     }
5815 }
5816 
deepcopy_VkCopyImageToBufferInfo2(Allocator * alloc,VkStructureType rootType,const VkCopyImageToBufferInfo2 * from,VkCopyImageToBufferInfo2 * to)5817 void deepcopy_VkCopyImageToBufferInfo2(Allocator* alloc, VkStructureType rootType,
5818                                        const VkCopyImageToBufferInfo2* from,
5819                                        VkCopyImageToBufferInfo2* to) {
5820     (void)alloc;
5821     (void)rootType;
5822     *to = *from;
5823     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5824         rootType = from->sType;
5825     }
5826     const void* from_pNext = from;
5827     size_t pNext_size = 0u;
5828     while (!pNext_size && from_pNext) {
5829         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5830         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5831     }
5832     to->pNext = nullptr;
5833     if (pNext_size) {
5834         to->pNext = (void*)alloc->alloc(pNext_size);
5835         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5836     }
5837     if (from) {
5838         to->pRegions = nullptr;
5839         if (from->pRegions) {
5840             to->pRegions = (VkBufferImageCopy2*)alloc->alloc(from->regionCount *
5841                                                              sizeof(const VkBufferImageCopy2));
5842             to->regionCount = from->regionCount;
5843             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5844                 deepcopy_VkBufferImageCopy2(alloc, rootType, from->pRegions + i,
5845                                             (VkBufferImageCopy2*)(to->pRegions + i));
5846             }
5847         }
5848     }
5849 }
5850 
deepcopy_VkImageBlit2(Allocator * alloc,VkStructureType rootType,const VkImageBlit2 * from,VkImageBlit2 * to)5851 void deepcopy_VkImageBlit2(Allocator* alloc, VkStructureType rootType, const VkImageBlit2* from,
5852                            VkImageBlit2* to) {
5853     (void)alloc;
5854     (void)rootType;
5855     *to = *from;
5856     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5857         rootType = from->sType;
5858     }
5859     const void* from_pNext = from;
5860     size_t pNext_size = 0u;
5861     while (!pNext_size && from_pNext) {
5862         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5863         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5864     }
5865     to->pNext = nullptr;
5866     if (pNext_size) {
5867         to->pNext = (void*)alloc->alloc(pNext_size);
5868         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5869     }
5870     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
5871                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
5872     for (uint32_t i = 0; i < (uint32_t)2; ++i) {
5873         deepcopy_VkOffset3D(alloc, rootType, from->srcOffsets + i,
5874                             (VkOffset3D*)(to->srcOffsets + i));
5875     }
5876     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
5877                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
5878     for (uint32_t i = 0; i < (uint32_t)2; ++i) {
5879         deepcopy_VkOffset3D(alloc, rootType, from->dstOffsets + i,
5880                             (VkOffset3D*)(to->dstOffsets + i));
5881     }
5882 }
5883 
deepcopy_VkBlitImageInfo2(Allocator * alloc,VkStructureType rootType,const VkBlitImageInfo2 * from,VkBlitImageInfo2 * to)5884 void deepcopy_VkBlitImageInfo2(Allocator* alloc, VkStructureType rootType,
5885                                const VkBlitImageInfo2* from, VkBlitImageInfo2* to) {
5886     (void)alloc;
5887     (void)rootType;
5888     *to = *from;
5889     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5890         rootType = from->sType;
5891     }
5892     const void* from_pNext = from;
5893     size_t pNext_size = 0u;
5894     while (!pNext_size && from_pNext) {
5895         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5896         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5897     }
5898     to->pNext = nullptr;
5899     if (pNext_size) {
5900         to->pNext = (void*)alloc->alloc(pNext_size);
5901         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5902     }
5903     if (from) {
5904         to->pRegions = nullptr;
5905         if (from->pRegions) {
5906             to->pRegions =
5907                 (VkImageBlit2*)alloc->alloc(from->regionCount * sizeof(const VkImageBlit2));
5908             to->regionCount = from->regionCount;
5909             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5910                 deepcopy_VkImageBlit2(alloc, rootType, from->pRegions + i,
5911                                       (VkImageBlit2*)(to->pRegions + i));
5912             }
5913         }
5914     }
5915 }
5916 
deepcopy_VkImageResolve2(Allocator * alloc,VkStructureType rootType,const VkImageResolve2 * from,VkImageResolve2 * to)5917 void deepcopy_VkImageResolve2(Allocator* alloc, VkStructureType rootType,
5918                               const VkImageResolve2* from, VkImageResolve2* to) {
5919     (void)alloc;
5920     (void)rootType;
5921     *to = *from;
5922     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5923         rootType = from->sType;
5924     }
5925     const void* from_pNext = from;
5926     size_t pNext_size = 0u;
5927     while (!pNext_size && from_pNext) {
5928         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5929         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5930     }
5931     to->pNext = nullptr;
5932     if (pNext_size) {
5933         to->pNext = (void*)alloc->alloc(pNext_size);
5934         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5935     }
5936     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
5937                                       (VkImageSubresourceLayers*)(&to->srcSubresource));
5938     deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
5939     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
5940                                       (VkImageSubresourceLayers*)(&to->dstSubresource));
5941     deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
5942     deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
5943 }
5944 
deepcopy_VkResolveImageInfo2(Allocator * alloc,VkStructureType rootType,const VkResolveImageInfo2 * from,VkResolveImageInfo2 * to)5945 void deepcopy_VkResolveImageInfo2(Allocator* alloc, VkStructureType rootType,
5946                                   const VkResolveImageInfo2* from, VkResolveImageInfo2* to) {
5947     (void)alloc;
5948     (void)rootType;
5949     *to = *from;
5950     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5951         rootType = from->sType;
5952     }
5953     const void* from_pNext = from;
5954     size_t pNext_size = 0u;
5955     while (!pNext_size && from_pNext) {
5956         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5957         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5958     }
5959     to->pNext = nullptr;
5960     if (pNext_size) {
5961         to->pNext = (void*)alloc->alloc(pNext_size);
5962         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5963     }
5964     if (from) {
5965         to->pRegions = nullptr;
5966         if (from->pRegions) {
5967             to->pRegions =
5968                 (VkImageResolve2*)alloc->alloc(from->regionCount * sizeof(const VkImageResolve2));
5969             to->regionCount = from->regionCount;
5970             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
5971                 deepcopy_VkImageResolve2(alloc, rootType, from->pRegions + i,
5972                                          (VkImageResolve2*)(to->pRegions + i));
5973             }
5974         }
5975     }
5976 }
5977 
deepcopy_VkPhysicalDeviceSubgroupSizeControlFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSubgroupSizeControlFeatures * from,VkPhysicalDeviceSubgroupSizeControlFeatures * to)5978 void deepcopy_VkPhysicalDeviceSubgroupSizeControlFeatures(
5979     Allocator* alloc, VkStructureType rootType,
5980     const VkPhysicalDeviceSubgroupSizeControlFeatures* from,
5981     VkPhysicalDeviceSubgroupSizeControlFeatures* to) {
5982     (void)alloc;
5983     (void)rootType;
5984     *to = *from;
5985     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
5986         rootType = from->sType;
5987     }
5988     const void* from_pNext = from;
5989     size_t pNext_size = 0u;
5990     while (!pNext_size && from_pNext) {
5991         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
5992         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
5993     }
5994     to->pNext = nullptr;
5995     if (pNext_size) {
5996         to->pNext = (void*)alloc->alloc(pNext_size);
5997         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
5998     }
5999 }
6000 
deepcopy_VkPhysicalDeviceSubgroupSizeControlProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceSubgroupSizeControlProperties * from,VkPhysicalDeviceSubgroupSizeControlProperties * to)6001 void deepcopy_VkPhysicalDeviceSubgroupSizeControlProperties(
6002     Allocator* alloc, VkStructureType rootType,
6003     const VkPhysicalDeviceSubgroupSizeControlProperties* from,
6004     VkPhysicalDeviceSubgroupSizeControlProperties* to) {
6005     (void)alloc;
6006     (void)rootType;
6007     *to = *from;
6008     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6009         rootType = from->sType;
6010     }
6011     const void* from_pNext = from;
6012     size_t pNext_size = 0u;
6013     while (!pNext_size && from_pNext) {
6014         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6015         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6016     }
6017     to->pNext = nullptr;
6018     if (pNext_size) {
6019         to->pNext = (void*)alloc->alloc(pNext_size);
6020         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6021     }
6022 }
6023 
deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo * from,VkPipelineShaderStageRequiredSubgroupSizeCreateInfo * to)6024 void deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfo(
6025     Allocator* alloc, VkStructureType rootType,
6026     const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo* from,
6027     VkPipelineShaderStageRequiredSubgroupSizeCreateInfo* to) {
6028     (void)alloc;
6029     (void)rootType;
6030     *to = *from;
6031     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6032         rootType = from->sType;
6033     }
6034     const void* from_pNext = from;
6035     size_t pNext_size = 0u;
6036     while (!pNext_size && from_pNext) {
6037         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6038         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6039     }
6040     to->pNext = nullptr;
6041     if (pNext_size) {
6042         to->pNext = (void*)alloc->alloc(pNext_size);
6043         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6044     }
6045 }
6046 
deepcopy_VkPhysicalDeviceInlineUniformBlockFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceInlineUniformBlockFeatures * from,VkPhysicalDeviceInlineUniformBlockFeatures * to)6047 void deepcopy_VkPhysicalDeviceInlineUniformBlockFeatures(
6048     Allocator* alloc, VkStructureType rootType,
6049     const VkPhysicalDeviceInlineUniformBlockFeatures* from,
6050     VkPhysicalDeviceInlineUniformBlockFeatures* to) {
6051     (void)alloc;
6052     (void)rootType;
6053     *to = *from;
6054     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6055         rootType = from->sType;
6056     }
6057     const void* from_pNext = from;
6058     size_t pNext_size = 0u;
6059     while (!pNext_size && from_pNext) {
6060         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6061         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6062     }
6063     to->pNext = nullptr;
6064     if (pNext_size) {
6065         to->pNext = (void*)alloc->alloc(pNext_size);
6066         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6067     }
6068 }
6069 
deepcopy_VkPhysicalDeviceInlineUniformBlockProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceInlineUniformBlockProperties * from,VkPhysicalDeviceInlineUniformBlockProperties * to)6070 void deepcopy_VkPhysicalDeviceInlineUniformBlockProperties(
6071     Allocator* alloc, VkStructureType rootType,
6072     const VkPhysicalDeviceInlineUniformBlockProperties* from,
6073     VkPhysicalDeviceInlineUniformBlockProperties* to) {
6074     (void)alloc;
6075     (void)rootType;
6076     *to = *from;
6077     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6078         rootType = from->sType;
6079     }
6080     const void* from_pNext = from;
6081     size_t pNext_size = 0u;
6082     while (!pNext_size && from_pNext) {
6083         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6084         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6085     }
6086     to->pNext = nullptr;
6087     if (pNext_size) {
6088         to->pNext = (void*)alloc->alloc(pNext_size);
6089         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6090     }
6091 }
6092 
deepcopy_VkWriteDescriptorSetInlineUniformBlock(Allocator * alloc,VkStructureType rootType,const VkWriteDescriptorSetInlineUniformBlock * from,VkWriteDescriptorSetInlineUniformBlock * to)6093 void deepcopy_VkWriteDescriptorSetInlineUniformBlock(
6094     Allocator* alloc, VkStructureType rootType, const VkWriteDescriptorSetInlineUniformBlock* from,
6095     VkWriteDescriptorSetInlineUniformBlock* to) {
6096     (void)alloc;
6097     (void)rootType;
6098     *to = *from;
6099     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6100         rootType = from->sType;
6101     }
6102     const void* from_pNext = from;
6103     size_t pNext_size = 0u;
6104     while (!pNext_size && from_pNext) {
6105         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6106         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6107     }
6108     to->pNext = nullptr;
6109     if (pNext_size) {
6110         to->pNext = (void*)alloc->alloc(pNext_size);
6111         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6112     }
6113     to->pData = nullptr;
6114     if (from->pData) {
6115         to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
6116     }
6117 }
6118 
deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDescriptorPoolInlineUniformBlockCreateInfo * from,VkDescriptorPoolInlineUniformBlockCreateInfo * to)6119 void deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfo(
6120     Allocator* alloc, VkStructureType rootType,
6121     const VkDescriptorPoolInlineUniformBlockCreateInfo* from,
6122     VkDescriptorPoolInlineUniformBlockCreateInfo* to) {
6123     (void)alloc;
6124     (void)rootType;
6125     *to = *from;
6126     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6127         rootType = from->sType;
6128     }
6129     const void* from_pNext = from;
6130     size_t pNext_size = 0u;
6131     while (!pNext_size && from_pNext) {
6132         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6133         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6134     }
6135     to->pNext = nullptr;
6136     if (pNext_size) {
6137         to->pNext = (void*)alloc->alloc(pNext_size);
6138         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6139     }
6140 }
6141 
deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTextureCompressionASTCHDRFeatures * from,VkPhysicalDeviceTextureCompressionASTCHDRFeatures * to)6142 void deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeatures(
6143     Allocator* alloc, VkStructureType rootType,
6144     const VkPhysicalDeviceTextureCompressionASTCHDRFeatures* from,
6145     VkPhysicalDeviceTextureCompressionASTCHDRFeatures* to) {
6146     (void)alloc;
6147     (void)rootType;
6148     *to = *from;
6149     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6150         rootType = from->sType;
6151     }
6152     const void* from_pNext = from;
6153     size_t pNext_size = 0u;
6154     while (!pNext_size && from_pNext) {
6155         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6156         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6157     }
6158     to->pNext = nullptr;
6159     if (pNext_size) {
6160         to->pNext = (void*)alloc->alloc(pNext_size);
6161         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6162     }
6163 }
6164 
deepcopy_VkRenderingAttachmentInfo(Allocator * alloc,VkStructureType rootType,const VkRenderingAttachmentInfo * from,VkRenderingAttachmentInfo * to)6165 void deepcopy_VkRenderingAttachmentInfo(Allocator* alloc, VkStructureType rootType,
6166                                         const VkRenderingAttachmentInfo* from,
6167                                         VkRenderingAttachmentInfo* to) {
6168     (void)alloc;
6169     (void)rootType;
6170     *to = *from;
6171     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6172         rootType = from->sType;
6173     }
6174     const void* from_pNext = from;
6175     size_t pNext_size = 0u;
6176     while (!pNext_size && from_pNext) {
6177         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6178         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6179     }
6180     to->pNext = nullptr;
6181     if (pNext_size) {
6182         to->pNext = (void*)alloc->alloc(pNext_size);
6183         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6184     }
6185     deepcopy_VkClearValue(alloc, rootType, &from->clearValue, (VkClearValue*)(&to->clearValue));
6186 }
6187 
deepcopy_VkRenderingInfo(Allocator * alloc,VkStructureType rootType,const VkRenderingInfo * from,VkRenderingInfo * to)6188 void deepcopy_VkRenderingInfo(Allocator* alloc, VkStructureType rootType,
6189                               const VkRenderingInfo* from, VkRenderingInfo* to) {
6190     (void)alloc;
6191     (void)rootType;
6192     *to = *from;
6193     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6194         rootType = from->sType;
6195     }
6196     const void* from_pNext = from;
6197     size_t pNext_size = 0u;
6198     while (!pNext_size && from_pNext) {
6199         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6200         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6201     }
6202     to->pNext = nullptr;
6203     if (pNext_size) {
6204         to->pNext = (void*)alloc->alloc(pNext_size);
6205         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6206     }
6207     deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
6208     if (from) {
6209         to->pColorAttachments = nullptr;
6210         if (from->pColorAttachments) {
6211             to->pColorAttachments = (VkRenderingAttachmentInfo*)alloc->alloc(
6212                 from->colorAttachmentCount * sizeof(const VkRenderingAttachmentInfo));
6213             to->colorAttachmentCount = from->colorAttachmentCount;
6214             for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
6215                 deepcopy_VkRenderingAttachmentInfo(
6216                     alloc, rootType, from->pColorAttachments + i,
6217                     (VkRenderingAttachmentInfo*)(to->pColorAttachments + i));
6218             }
6219         }
6220     }
6221     to->pDepthAttachment = nullptr;
6222     if (from->pDepthAttachment) {
6223         to->pDepthAttachment =
6224             (VkRenderingAttachmentInfo*)alloc->alloc(sizeof(const VkRenderingAttachmentInfo));
6225         deepcopy_VkRenderingAttachmentInfo(alloc, rootType, from->pDepthAttachment,
6226                                            (VkRenderingAttachmentInfo*)(to->pDepthAttachment));
6227     }
6228     to->pStencilAttachment = nullptr;
6229     if (from->pStencilAttachment) {
6230         to->pStencilAttachment =
6231             (VkRenderingAttachmentInfo*)alloc->alloc(sizeof(const VkRenderingAttachmentInfo));
6232         deepcopy_VkRenderingAttachmentInfo(alloc, rootType, from->pStencilAttachment,
6233                                            (VkRenderingAttachmentInfo*)(to->pStencilAttachment));
6234     }
6235 }
6236 
deepcopy_VkPipelineRenderingCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineRenderingCreateInfo * from,VkPipelineRenderingCreateInfo * to)6237 void deepcopy_VkPipelineRenderingCreateInfo(Allocator* alloc, VkStructureType rootType,
6238                                             const VkPipelineRenderingCreateInfo* from,
6239                                             VkPipelineRenderingCreateInfo* to) {
6240     (void)alloc;
6241     (void)rootType;
6242     *to = *from;
6243     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6244         rootType = from->sType;
6245     }
6246     const void* from_pNext = from;
6247     size_t pNext_size = 0u;
6248     while (!pNext_size && from_pNext) {
6249         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6250         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6251     }
6252     to->pNext = nullptr;
6253     if (pNext_size) {
6254         to->pNext = (void*)alloc->alloc(pNext_size);
6255         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6256     }
6257     to->pColorAttachmentFormats = nullptr;
6258     if (from->pColorAttachmentFormats) {
6259         to->pColorAttachmentFormats = (VkFormat*)alloc->dupArray(
6260             from->pColorAttachmentFormats, from->colorAttachmentCount * sizeof(const VkFormat));
6261     }
6262 }
6263 
deepcopy_VkPhysicalDeviceDynamicRenderingFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDynamicRenderingFeatures * from,VkPhysicalDeviceDynamicRenderingFeatures * to)6264 void deepcopy_VkPhysicalDeviceDynamicRenderingFeatures(
6265     Allocator* alloc, VkStructureType rootType,
6266     const VkPhysicalDeviceDynamicRenderingFeatures* from,
6267     VkPhysicalDeviceDynamicRenderingFeatures* to) {
6268     (void)alloc;
6269     (void)rootType;
6270     *to = *from;
6271     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6272         rootType = from->sType;
6273     }
6274     const void* from_pNext = from;
6275     size_t pNext_size = 0u;
6276     while (!pNext_size && from_pNext) {
6277         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6278         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6279     }
6280     to->pNext = nullptr;
6281     if (pNext_size) {
6282         to->pNext = (void*)alloc->alloc(pNext_size);
6283         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6284     }
6285 }
6286 
deepcopy_VkCommandBufferInheritanceRenderingInfo(Allocator * alloc,VkStructureType rootType,const VkCommandBufferInheritanceRenderingInfo * from,VkCommandBufferInheritanceRenderingInfo * to)6287 void deepcopy_VkCommandBufferInheritanceRenderingInfo(
6288     Allocator* alloc, VkStructureType rootType, const VkCommandBufferInheritanceRenderingInfo* from,
6289     VkCommandBufferInheritanceRenderingInfo* to) {
6290     (void)alloc;
6291     (void)rootType;
6292     *to = *from;
6293     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6294         rootType = from->sType;
6295     }
6296     const void* from_pNext = from;
6297     size_t pNext_size = 0u;
6298     while (!pNext_size && from_pNext) {
6299         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6300         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6301     }
6302     to->pNext = nullptr;
6303     if (pNext_size) {
6304         to->pNext = (void*)alloc->alloc(pNext_size);
6305         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6306     }
6307     to->pColorAttachmentFormats = nullptr;
6308     if (from->pColorAttachmentFormats) {
6309         to->pColorAttachmentFormats = (VkFormat*)alloc->dupArray(
6310             from->pColorAttachmentFormats, from->colorAttachmentCount * sizeof(const VkFormat));
6311     }
6312 }
6313 
deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderIntegerDotProductFeatures * from,VkPhysicalDeviceShaderIntegerDotProductFeatures * to)6314 void deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeatures(
6315     Allocator* alloc, VkStructureType rootType,
6316     const VkPhysicalDeviceShaderIntegerDotProductFeatures* from,
6317     VkPhysicalDeviceShaderIntegerDotProductFeatures* to) {
6318     (void)alloc;
6319     (void)rootType;
6320     *to = *from;
6321     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6322         rootType = from->sType;
6323     }
6324     const void* from_pNext = from;
6325     size_t pNext_size = 0u;
6326     while (!pNext_size && from_pNext) {
6327         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6328         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6329     }
6330     to->pNext = nullptr;
6331     if (pNext_size) {
6332         to->pNext = (void*)alloc->alloc(pNext_size);
6333         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6334     }
6335 }
6336 
deepcopy_VkPhysicalDeviceShaderIntegerDotProductProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderIntegerDotProductProperties * from,VkPhysicalDeviceShaderIntegerDotProductProperties * to)6337 void deepcopy_VkPhysicalDeviceShaderIntegerDotProductProperties(
6338     Allocator* alloc, VkStructureType rootType,
6339     const VkPhysicalDeviceShaderIntegerDotProductProperties* from,
6340     VkPhysicalDeviceShaderIntegerDotProductProperties* to) {
6341     (void)alloc;
6342     (void)rootType;
6343     *to = *from;
6344     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6345         rootType = from->sType;
6346     }
6347     const void* from_pNext = from;
6348     size_t pNext_size = 0u;
6349     while (!pNext_size && from_pNext) {
6350         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6351         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6352     }
6353     to->pNext = nullptr;
6354     if (pNext_size) {
6355         to->pNext = (void*)alloc->alloc(pNext_size);
6356         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6357     }
6358 }
6359 
deepcopy_VkPhysicalDeviceTexelBufferAlignmentProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTexelBufferAlignmentProperties * from,VkPhysicalDeviceTexelBufferAlignmentProperties * to)6360 void deepcopy_VkPhysicalDeviceTexelBufferAlignmentProperties(
6361     Allocator* alloc, VkStructureType rootType,
6362     const VkPhysicalDeviceTexelBufferAlignmentProperties* from,
6363     VkPhysicalDeviceTexelBufferAlignmentProperties* to) {
6364     (void)alloc;
6365     (void)rootType;
6366     *to = *from;
6367     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6368         rootType = from->sType;
6369     }
6370     const void* from_pNext = from;
6371     size_t pNext_size = 0u;
6372     while (!pNext_size && from_pNext) {
6373         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6374         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6375     }
6376     to->pNext = nullptr;
6377     if (pNext_size) {
6378         to->pNext = (void*)alloc->alloc(pNext_size);
6379         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6380     }
6381 }
6382 
deepcopy_VkFormatProperties3(Allocator * alloc,VkStructureType rootType,const VkFormatProperties3 * from,VkFormatProperties3 * to)6383 void deepcopy_VkFormatProperties3(Allocator* alloc, VkStructureType rootType,
6384                                   const VkFormatProperties3* from, VkFormatProperties3* to) {
6385     (void)alloc;
6386     (void)rootType;
6387     *to = *from;
6388     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6389         rootType = from->sType;
6390     }
6391     const void* from_pNext = from;
6392     size_t pNext_size = 0u;
6393     while (!pNext_size && from_pNext) {
6394         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6395         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6396     }
6397     to->pNext = nullptr;
6398     if (pNext_size) {
6399         to->pNext = (void*)alloc->alloc(pNext_size);
6400         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6401     }
6402 }
6403 
deepcopy_VkPhysicalDeviceMaintenance4Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance4Features * from,VkPhysicalDeviceMaintenance4Features * to)6404 void deepcopy_VkPhysicalDeviceMaintenance4Features(Allocator* alloc, VkStructureType rootType,
6405                                                    const VkPhysicalDeviceMaintenance4Features* from,
6406                                                    VkPhysicalDeviceMaintenance4Features* to) {
6407     (void)alloc;
6408     (void)rootType;
6409     *to = *from;
6410     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6411         rootType = from->sType;
6412     }
6413     const void* from_pNext = from;
6414     size_t pNext_size = 0u;
6415     while (!pNext_size && from_pNext) {
6416         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6417         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6418     }
6419     to->pNext = nullptr;
6420     if (pNext_size) {
6421         to->pNext = (void*)alloc->alloc(pNext_size);
6422         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6423     }
6424 }
6425 
deepcopy_VkPhysicalDeviceMaintenance4Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance4Properties * from,VkPhysicalDeviceMaintenance4Properties * to)6426 void deepcopy_VkPhysicalDeviceMaintenance4Properties(
6427     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance4Properties* from,
6428     VkPhysicalDeviceMaintenance4Properties* to) {
6429     (void)alloc;
6430     (void)rootType;
6431     *to = *from;
6432     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6433         rootType = from->sType;
6434     }
6435     const void* from_pNext = from;
6436     size_t pNext_size = 0u;
6437     while (!pNext_size && from_pNext) {
6438         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6439         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6440     }
6441     to->pNext = nullptr;
6442     if (pNext_size) {
6443         to->pNext = (void*)alloc->alloc(pNext_size);
6444         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6445     }
6446 }
6447 
deepcopy_VkDeviceBufferMemoryRequirements(Allocator * alloc,VkStructureType rootType,const VkDeviceBufferMemoryRequirements * from,VkDeviceBufferMemoryRequirements * to)6448 void deepcopy_VkDeviceBufferMemoryRequirements(Allocator* alloc, VkStructureType rootType,
6449                                                const VkDeviceBufferMemoryRequirements* from,
6450                                                VkDeviceBufferMemoryRequirements* to) {
6451     (void)alloc;
6452     (void)rootType;
6453     *to = *from;
6454     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6455         rootType = from->sType;
6456     }
6457     const void* from_pNext = from;
6458     size_t pNext_size = 0u;
6459     while (!pNext_size && from_pNext) {
6460         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6461         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6462     }
6463     to->pNext = nullptr;
6464     if (pNext_size) {
6465         to->pNext = (void*)alloc->alloc(pNext_size);
6466         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6467     }
6468     to->pCreateInfo = nullptr;
6469     if (from->pCreateInfo) {
6470         to->pCreateInfo = (VkBufferCreateInfo*)alloc->alloc(sizeof(const VkBufferCreateInfo));
6471         deepcopy_VkBufferCreateInfo(alloc, rootType, from->pCreateInfo,
6472                                     (VkBufferCreateInfo*)(to->pCreateInfo));
6473     }
6474 }
6475 
deepcopy_VkDeviceImageMemoryRequirements(Allocator * alloc,VkStructureType rootType,const VkDeviceImageMemoryRequirements * from,VkDeviceImageMemoryRequirements * to)6476 void deepcopy_VkDeviceImageMemoryRequirements(Allocator* alloc, VkStructureType rootType,
6477                                               const VkDeviceImageMemoryRequirements* from,
6478                                               VkDeviceImageMemoryRequirements* to) {
6479     (void)alloc;
6480     (void)rootType;
6481     *to = *from;
6482     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6483         rootType = from->sType;
6484     }
6485     const void* from_pNext = from;
6486     size_t pNext_size = 0u;
6487     while (!pNext_size && from_pNext) {
6488         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6489         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6490     }
6491     to->pNext = nullptr;
6492     if (pNext_size) {
6493         to->pNext = (void*)alloc->alloc(pNext_size);
6494         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6495     }
6496     to->pCreateInfo = nullptr;
6497     if (from->pCreateInfo) {
6498         to->pCreateInfo = (VkImageCreateInfo*)alloc->alloc(sizeof(const VkImageCreateInfo));
6499         deepcopy_VkImageCreateInfo(alloc, rootType, from->pCreateInfo,
6500                                    (VkImageCreateInfo*)(to->pCreateInfo));
6501     }
6502 }
6503 
6504 #endif
6505 #ifdef VK_VERSION_1_4
deepcopy_VkPhysicalDeviceVulkan14Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan14Features * from,VkPhysicalDeviceVulkan14Features * to)6506 void deepcopy_VkPhysicalDeviceVulkan14Features(Allocator* alloc, VkStructureType rootType,
6507                                                const VkPhysicalDeviceVulkan14Features* from,
6508                                                VkPhysicalDeviceVulkan14Features* to) {
6509     (void)alloc;
6510     (void)rootType;
6511     *to = *from;
6512     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6513         rootType = from->sType;
6514     }
6515     const void* from_pNext = from;
6516     size_t pNext_size = 0u;
6517     while (!pNext_size && from_pNext) {
6518         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6519         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6520     }
6521     to->pNext = nullptr;
6522     if (pNext_size) {
6523         to->pNext = (void*)alloc->alloc(pNext_size);
6524         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6525     }
6526 }
6527 
deepcopy_VkPhysicalDeviceVulkan14Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVulkan14Properties * from,VkPhysicalDeviceVulkan14Properties * to)6528 void deepcopy_VkPhysicalDeviceVulkan14Properties(Allocator* alloc, VkStructureType rootType,
6529                                                  const VkPhysicalDeviceVulkan14Properties* from,
6530                                                  VkPhysicalDeviceVulkan14Properties* to) {
6531     (void)alloc;
6532     (void)rootType;
6533     *to = *from;
6534     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6535         rootType = from->sType;
6536     }
6537     const void* from_pNext = from;
6538     size_t pNext_size = 0u;
6539     while (!pNext_size && from_pNext) {
6540         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6541         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6542     }
6543     to->pNext = nullptr;
6544     if (pNext_size) {
6545         to->pNext = (void*)alloc->alloc(pNext_size);
6546         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6547     }
6548     to->pCopySrcLayouts = nullptr;
6549     if (from->pCopySrcLayouts) {
6550         to->pCopySrcLayouts = (VkImageLayout*)alloc->dupArray(
6551             from->pCopySrcLayouts, from->copySrcLayoutCount * sizeof(VkImageLayout));
6552     }
6553     to->pCopyDstLayouts = nullptr;
6554     if (from->pCopyDstLayouts) {
6555         to->pCopyDstLayouts = (VkImageLayout*)alloc->dupArray(
6556             from->pCopyDstLayouts, from->copyDstLayoutCount * sizeof(VkImageLayout));
6557     }
6558     memcpy(to->optimalTilingLayoutUUID, from->optimalTilingLayoutUUID,
6559            VK_UUID_SIZE * sizeof(uint8_t));
6560 }
6561 
deepcopy_VkDeviceQueueGlobalPriorityCreateInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceQueueGlobalPriorityCreateInfo * from,VkDeviceQueueGlobalPriorityCreateInfo * to)6562 void deepcopy_VkDeviceQueueGlobalPriorityCreateInfo(
6563     Allocator* alloc, VkStructureType rootType, const VkDeviceQueueGlobalPriorityCreateInfo* from,
6564     VkDeviceQueueGlobalPriorityCreateInfo* to) {
6565     (void)alloc;
6566     (void)rootType;
6567     *to = *from;
6568     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6569         rootType = from->sType;
6570     }
6571     const void* from_pNext = from;
6572     size_t pNext_size = 0u;
6573     while (!pNext_size && from_pNext) {
6574         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6575         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6576     }
6577     to->pNext = nullptr;
6578     if (pNext_size) {
6579         to->pNext = (void*)alloc->alloc(pNext_size);
6580         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6581     }
6582 }
6583 
deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceGlobalPriorityQueryFeatures * from,VkPhysicalDeviceGlobalPriorityQueryFeatures * to)6584 void deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeatures(
6585     Allocator* alloc, VkStructureType rootType,
6586     const VkPhysicalDeviceGlobalPriorityQueryFeatures* from,
6587     VkPhysicalDeviceGlobalPriorityQueryFeatures* to) {
6588     (void)alloc;
6589     (void)rootType;
6590     *to = *from;
6591     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6592         rootType = from->sType;
6593     }
6594     const void* from_pNext = from;
6595     size_t pNext_size = 0u;
6596     while (!pNext_size && from_pNext) {
6597         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6598         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6599     }
6600     to->pNext = nullptr;
6601     if (pNext_size) {
6602         to->pNext = (void*)alloc->alloc(pNext_size);
6603         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6604     }
6605 }
6606 
deepcopy_VkQueueFamilyGlobalPriorityProperties(Allocator * alloc,VkStructureType rootType,const VkQueueFamilyGlobalPriorityProperties * from,VkQueueFamilyGlobalPriorityProperties * to)6607 void deepcopy_VkQueueFamilyGlobalPriorityProperties(
6608     Allocator* alloc, VkStructureType rootType, const VkQueueFamilyGlobalPriorityProperties* from,
6609     VkQueueFamilyGlobalPriorityProperties* to) {
6610     (void)alloc;
6611     (void)rootType;
6612     *to = *from;
6613     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6614         rootType = from->sType;
6615     }
6616     const void* from_pNext = from;
6617     size_t pNext_size = 0u;
6618     while (!pNext_size && from_pNext) {
6619         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6620         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6621     }
6622     to->pNext = nullptr;
6623     if (pNext_size) {
6624         to->pNext = (void*)alloc->alloc(pNext_size);
6625         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6626     }
6627     memcpy(to->priorities, from->priorities,
6628            VK_MAX_GLOBAL_PRIORITY_SIZE * sizeof(VkQueueGlobalPriority));
6629 }
6630 
deepcopy_VkPhysicalDeviceShaderSubgroupRotateFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderSubgroupRotateFeatures * from,VkPhysicalDeviceShaderSubgroupRotateFeatures * to)6631 void deepcopy_VkPhysicalDeviceShaderSubgroupRotateFeatures(
6632     Allocator* alloc, VkStructureType rootType,
6633     const VkPhysicalDeviceShaderSubgroupRotateFeatures* from,
6634     VkPhysicalDeviceShaderSubgroupRotateFeatures* to) {
6635     (void)alloc;
6636     (void)rootType;
6637     *to = *from;
6638     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6639         rootType = from->sType;
6640     }
6641     const void* from_pNext = from;
6642     size_t pNext_size = 0u;
6643     while (!pNext_size && from_pNext) {
6644         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6645         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6646     }
6647     to->pNext = nullptr;
6648     if (pNext_size) {
6649         to->pNext = (void*)alloc->alloc(pNext_size);
6650         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6651     }
6652 }
6653 
deepcopy_VkPhysicalDeviceShaderFloatControls2Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderFloatControls2Features * from,VkPhysicalDeviceShaderFloatControls2Features * to)6654 void deepcopy_VkPhysicalDeviceShaderFloatControls2Features(
6655     Allocator* alloc, VkStructureType rootType,
6656     const VkPhysicalDeviceShaderFloatControls2Features* from,
6657     VkPhysicalDeviceShaderFloatControls2Features* to) {
6658     (void)alloc;
6659     (void)rootType;
6660     *to = *from;
6661     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6662         rootType = from->sType;
6663     }
6664     const void* from_pNext = from;
6665     size_t pNext_size = 0u;
6666     while (!pNext_size && from_pNext) {
6667         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6668         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6669     }
6670     to->pNext = nullptr;
6671     if (pNext_size) {
6672         to->pNext = (void*)alloc->alloc(pNext_size);
6673         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6674     }
6675 }
6676 
deepcopy_VkPhysicalDeviceShaderExpectAssumeFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceShaderExpectAssumeFeatures * from,VkPhysicalDeviceShaderExpectAssumeFeatures * to)6677 void deepcopy_VkPhysicalDeviceShaderExpectAssumeFeatures(
6678     Allocator* alloc, VkStructureType rootType,
6679     const VkPhysicalDeviceShaderExpectAssumeFeatures* from,
6680     VkPhysicalDeviceShaderExpectAssumeFeatures* to) {
6681     (void)alloc;
6682     (void)rootType;
6683     *to = *from;
6684     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6685         rootType = from->sType;
6686     }
6687     const void* from_pNext = from;
6688     size_t pNext_size = 0u;
6689     while (!pNext_size && from_pNext) {
6690         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6691         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6692     }
6693     to->pNext = nullptr;
6694     if (pNext_size) {
6695         to->pNext = (void*)alloc->alloc(pNext_size);
6696         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6697     }
6698 }
6699 
deepcopy_VkPhysicalDeviceLineRasterizationFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceLineRasterizationFeatures * from,VkPhysicalDeviceLineRasterizationFeatures * to)6700 void deepcopy_VkPhysicalDeviceLineRasterizationFeatures(
6701     Allocator* alloc, VkStructureType rootType,
6702     const VkPhysicalDeviceLineRasterizationFeatures* from,
6703     VkPhysicalDeviceLineRasterizationFeatures* to) {
6704     (void)alloc;
6705     (void)rootType;
6706     *to = *from;
6707     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6708         rootType = from->sType;
6709     }
6710     const void* from_pNext = from;
6711     size_t pNext_size = 0u;
6712     while (!pNext_size && from_pNext) {
6713         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6714         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6715     }
6716     to->pNext = nullptr;
6717     if (pNext_size) {
6718         to->pNext = (void*)alloc->alloc(pNext_size);
6719         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6720     }
6721 }
6722 
deepcopy_VkPhysicalDeviceLineRasterizationProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceLineRasterizationProperties * from,VkPhysicalDeviceLineRasterizationProperties * to)6723 void deepcopy_VkPhysicalDeviceLineRasterizationProperties(
6724     Allocator* alloc, VkStructureType rootType,
6725     const VkPhysicalDeviceLineRasterizationProperties* from,
6726     VkPhysicalDeviceLineRasterizationProperties* to) {
6727     (void)alloc;
6728     (void)rootType;
6729     *to = *from;
6730     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6731         rootType = from->sType;
6732     }
6733     const void* from_pNext = from;
6734     size_t pNext_size = 0u;
6735     while (!pNext_size && from_pNext) {
6736         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6737         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6738     }
6739     to->pNext = nullptr;
6740     if (pNext_size) {
6741         to->pNext = (void*)alloc->alloc(pNext_size);
6742         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6743     }
6744 }
6745 
deepcopy_VkPipelineRasterizationLineStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineRasterizationLineStateCreateInfo * from,VkPipelineRasterizationLineStateCreateInfo * to)6746 void deepcopy_VkPipelineRasterizationLineStateCreateInfo(
6747     Allocator* alloc, VkStructureType rootType,
6748     const VkPipelineRasterizationLineStateCreateInfo* from,
6749     VkPipelineRasterizationLineStateCreateInfo* to) {
6750     (void)alloc;
6751     (void)rootType;
6752     *to = *from;
6753     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6754         rootType = from->sType;
6755     }
6756     const void* from_pNext = from;
6757     size_t pNext_size = 0u;
6758     while (!pNext_size && from_pNext) {
6759         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6760         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6761     }
6762     to->pNext = nullptr;
6763     if (pNext_size) {
6764         to->pNext = (void*)alloc->alloc(pNext_size);
6765         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6766     }
6767 }
6768 
deepcopy_VkPhysicalDeviceVertexAttributeDivisorProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVertexAttributeDivisorProperties * from,VkPhysicalDeviceVertexAttributeDivisorProperties * to)6769 void deepcopy_VkPhysicalDeviceVertexAttributeDivisorProperties(
6770     Allocator* alloc, VkStructureType rootType,
6771     const VkPhysicalDeviceVertexAttributeDivisorProperties* from,
6772     VkPhysicalDeviceVertexAttributeDivisorProperties* to) {
6773     (void)alloc;
6774     (void)rootType;
6775     *to = *from;
6776     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6777         rootType = from->sType;
6778     }
6779     const void* from_pNext = from;
6780     size_t pNext_size = 0u;
6781     while (!pNext_size && from_pNext) {
6782         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6783         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6784     }
6785     to->pNext = nullptr;
6786     if (pNext_size) {
6787         to->pNext = (void*)alloc->alloc(pNext_size);
6788         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6789     }
6790 }
6791 
deepcopy_VkVertexInputBindingDivisorDescription(Allocator * alloc,VkStructureType rootType,const VkVertexInputBindingDivisorDescription * from,VkVertexInputBindingDivisorDescription * to)6792 void deepcopy_VkVertexInputBindingDivisorDescription(
6793     Allocator* alloc, VkStructureType rootType, const VkVertexInputBindingDivisorDescription* from,
6794     VkVertexInputBindingDivisorDescription* to) {
6795     (void)alloc;
6796     (void)rootType;
6797     *to = *from;
6798 }
6799 
deepcopy_VkPipelineVertexInputDivisorStateCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineVertexInputDivisorStateCreateInfo * from,VkPipelineVertexInputDivisorStateCreateInfo * to)6800 void deepcopy_VkPipelineVertexInputDivisorStateCreateInfo(
6801     Allocator* alloc, VkStructureType rootType,
6802     const VkPipelineVertexInputDivisorStateCreateInfo* from,
6803     VkPipelineVertexInputDivisorStateCreateInfo* to) {
6804     (void)alloc;
6805     (void)rootType;
6806     *to = *from;
6807     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6808         rootType = from->sType;
6809     }
6810     const void* from_pNext = from;
6811     size_t pNext_size = 0u;
6812     while (!pNext_size && from_pNext) {
6813         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6814         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6815     }
6816     to->pNext = nullptr;
6817     if (pNext_size) {
6818         to->pNext = (void*)alloc->alloc(pNext_size);
6819         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6820     }
6821     if (from) {
6822         to->pVertexBindingDivisors = nullptr;
6823         if (from->pVertexBindingDivisors) {
6824             to->pVertexBindingDivisors = (VkVertexInputBindingDivisorDescription*)alloc->alloc(
6825                 from->vertexBindingDivisorCount *
6826                 sizeof(const VkVertexInputBindingDivisorDescription));
6827             to->vertexBindingDivisorCount = from->vertexBindingDivisorCount;
6828             for (uint32_t i = 0; i < (uint32_t)from->vertexBindingDivisorCount; ++i) {
6829                 deepcopy_VkVertexInputBindingDivisorDescription(
6830                     alloc, rootType, from->pVertexBindingDivisors + i,
6831                     (VkVertexInputBindingDivisorDescription*)(to->pVertexBindingDivisors + i));
6832             }
6833         }
6834     }
6835 }
6836 
deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVertexAttributeDivisorFeatures * from,VkPhysicalDeviceVertexAttributeDivisorFeatures * to)6837 void deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeatures(
6838     Allocator* alloc, VkStructureType rootType,
6839     const VkPhysicalDeviceVertexAttributeDivisorFeatures* from,
6840     VkPhysicalDeviceVertexAttributeDivisorFeatures* to) {
6841     (void)alloc;
6842     (void)rootType;
6843     *to = *from;
6844     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6845         rootType = from->sType;
6846     }
6847     const void* from_pNext = from;
6848     size_t pNext_size = 0u;
6849     while (!pNext_size && from_pNext) {
6850         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6851         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6852     }
6853     to->pNext = nullptr;
6854     if (pNext_size) {
6855         to->pNext = (void*)alloc->alloc(pNext_size);
6856         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6857     }
6858 }
6859 
deepcopy_VkPhysicalDeviceIndexTypeUint8Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceIndexTypeUint8Features * from,VkPhysicalDeviceIndexTypeUint8Features * to)6860 void deepcopy_VkPhysicalDeviceIndexTypeUint8Features(
6861     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceIndexTypeUint8Features* from,
6862     VkPhysicalDeviceIndexTypeUint8Features* to) {
6863     (void)alloc;
6864     (void)rootType;
6865     *to = *from;
6866     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6867         rootType = from->sType;
6868     }
6869     const void* from_pNext = from;
6870     size_t pNext_size = 0u;
6871     while (!pNext_size && from_pNext) {
6872         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6873         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6874     }
6875     to->pNext = nullptr;
6876     if (pNext_size) {
6877         to->pNext = (void*)alloc->alloc(pNext_size);
6878         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6879     }
6880 }
6881 
deepcopy_VkMemoryMapInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryMapInfo * from,VkMemoryMapInfo * to)6882 void deepcopy_VkMemoryMapInfo(Allocator* alloc, VkStructureType rootType,
6883                               const VkMemoryMapInfo* from, VkMemoryMapInfo* to) {
6884     (void)alloc;
6885     (void)rootType;
6886     *to = *from;
6887     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6888         rootType = from->sType;
6889     }
6890     const void* from_pNext = from;
6891     size_t pNext_size = 0u;
6892     while (!pNext_size && from_pNext) {
6893         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6894         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6895     }
6896     to->pNext = nullptr;
6897     if (pNext_size) {
6898         to->pNext = (void*)alloc->alloc(pNext_size);
6899         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6900     }
6901 }
6902 
deepcopy_VkMemoryUnmapInfo(Allocator * alloc,VkStructureType rootType,const VkMemoryUnmapInfo * from,VkMemoryUnmapInfo * to)6903 void deepcopy_VkMemoryUnmapInfo(Allocator* alloc, VkStructureType rootType,
6904                                 const VkMemoryUnmapInfo* from, VkMemoryUnmapInfo* to) {
6905     (void)alloc;
6906     (void)rootType;
6907     *to = *from;
6908     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6909         rootType = from->sType;
6910     }
6911     const void* from_pNext = from;
6912     size_t pNext_size = 0u;
6913     while (!pNext_size && from_pNext) {
6914         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6915         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6916     }
6917     to->pNext = nullptr;
6918     if (pNext_size) {
6919         to->pNext = (void*)alloc->alloc(pNext_size);
6920         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6921     }
6922 }
6923 
deepcopy_VkPhysicalDeviceMaintenance5Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance5Features * from,VkPhysicalDeviceMaintenance5Features * to)6924 void deepcopy_VkPhysicalDeviceMaintenance5Features(Allocator* alloc, VkStructureType rootType,
6925                                                    const VkPhysicalDeviceMaintenance5Features* from,
6926                                                    VkPhysicalDeviceMaintenance5Features* to) {
6927     (void)alloc;
6928     (void)rootType;
6929     *to = *from;
6930     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6931         rootType = from->sType;
6932     }
6933     const void* from_pNext = from;
6934     size_t pNext_size = 0u;
6935     while (!pNext_size && from_pNext) {
6936         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6937         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6938     }
6939     to->pNext = nullptr;
6940     if (pNext_size) {
6941         to->pNext = (void*)alloc->alloc(pNext_size);
6942         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6943     }
6944 }
6945 
deepcopy_VkPhysicalDeviceMaintenance5Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance5Properties * from,VkPhysicalDeviceMaintenance5Properties * to)6946 void deepcopy_VkPhysicalDeviceMaintenance5Properties(
6947     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance5Properties* from,
6948     VkPhysicalDeviceMaintenance5Properties* to) {
6949     (void)alloc;
6950     (void)rootType;
6951     *to = *from;
6952     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6953         rootType = from->sType;
6954     }
6955     const void* from_pNext = from;
6956     size_t pNext_size = 0u;
6957     while (!pNext_size && from_pNext) {
6958         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6959         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6960     }
6961     to->pNext = nullptr;
6962     if (pNext_size) {
6963         to->pNext = (void*)alloc->alloc(pNext_size);
6964         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6965     }
6966 }
6967 
deepcopy_VkRenderingAreaInfo(Allocator * alloc,VkStructureType rootType,const VkRenderingAreaInfo * from,VkRenderingAreaInfo * to)6968 void deepcopy_VkRenderingAreaInfo(Allocator* alloc, VkStructureType rootType,
6969                                   const VkRenderingAreaInfo* from, VkRenderingAreaInfo* to) {
6970     (void)alloc;
6971     (void)rootType;
6972     *to = *from;
6973     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
6974         rootType = from->sType;
6975     }
6976     const void* from_pNext = from;
6977     size_t pNext_size = 0u;
6978     while (!pNext_size && from_pNext) {
6979         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
6980         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
6981     }
6982     to->pNext = nullptr;
6983     if (pNext_size) {
6984         to->pNext = (void*)alloc->alloc(pNext_size);
6985         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
6986     }
6987     to->pColorAttachmentFormats = nullptr;
6988     if (from->pColorAttachmentFormats) {
6989         to->pColorAttachmentFormats = (VkFormat*)alloc->dupArray(
6990             from->pColorAttachmentFormats, from->colorAttachmentCount * sizeof(const VkFormat));
6991     }
6992 }
6993 
deepcopy_VkImageSubresource2(Allocator * alloc,VkStructureType rootType,const VkImageSubresource2 * from,VkImageSubresource2 * to)6994 void deepcopy_VkImageSubresource2(Allocator* alloc, VkStructureType rootType,
6995                                   const VkImageSubresource2* from, VkImageSubresource2* to) {
6996     (void)alloc;
6997     (void)rootType;
6998     *to = *from;
6999     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7000         rootType = from->sType;
7001     }
7002     const void* from_pNext = from;
7003     size_t pNext_size = 0u;
7004     while (!pNext_size && from_pNext) {
7005         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7006         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7007     }
7008     to->pNext = nullptr;
7009     if (pNext_size) {
7010         to->pNext = (void*)alloc->alloc(pNext_size);
7011         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7012     }
7013     deepcopy_VkImageSubresource(alloc, rootType, &from->imageSubresource,
7014                                 (VkImageSubresource*)(&to->imageSubresource));
7015 }
7016 
deepcopy_VkDeviceImageSubresourceInfo(Allocator * alloc,VkStructureType rootType,const VkDeviceImageSubresourceInfo * from,VkDeviceImageSubresourceInfo * to)7017 void deepcopy_VkDeviceImageSubresourceInfo(Allocator* alloc, VkStructureType rootType,
7018                                            const VkDeviceImageSubresourceInfo* from,
7019                                            VkDeviceImageSubresourceInfo* to) {
7020     (void)alloc;
7021     (void)rootType;
7022     *to = *from;
7023     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7024         rootType = from->sType;
7025     }
7026     const void* from_pNext = from;
7027     size_t pNext_size = 0u;
7028     while (!pNext_size && from_pNext) {
7029         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7030         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7031     }
7032     to->pNext = nullptr;
7033     if (pNext_size) {
7034         to->pNext = (void*)alloc->alloc(pNext_size);
7035         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7036     }
7037     to->pCreateInfo = nullptr;
7038     if (from->pCreateInfo) {
7039         to->pCreateInfo = (VkImageCreateInfo*)alloc->alloc(sizeof(const VkImageCreateInfo));
7040         deepcopy_VkImageCreateInfo(alloc, rootType, from->pCreateInfo,
7041                                    (VkImageCreateInfo*)(to->pCreateInfo));
7042     }
7043     to->pSubresource = nullptr;
7044     if (from->pSubresource) {
7045         to->pSubresource = (VkImageSubresource2*)alloc->alloc(sizeof(const VkImageSubresource2));
7046         deepcopy_VkImageSubresource2(alloc, rootType, from->pSubresource,
7047                                      (VkImageSubresource2*)(to->pSubresource));
7048     }
7049 }
7050 
deepcopy_VkSubresourceLayout2(Allocator * alloc,VkStructureType rootType,const VkSubresourceLayout2 * from,VkSubresourceLayout2 * to)7051 void deepcopy_VkSubresourceLayout2(Allocator* alloc, VkStructureType rootType,
7052                                    const VkSubresourceLayout2* from, VkSubresourceLayout2* to) {
7053     (void)alloc;
7054     (void)rootType;
7055     *to = *from;
7056     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7057         rootType = from->sType;
7058     }
7059     const void* from_pNext = from;
7060     size_t pNext_size = 0u;
7061     while (!pNext_size && from_pNext) {
7062         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7063         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7064     }
7065     to->pNext = nullptr;
7066     if (pNext_size) {
7067         to->pNext = (void*)alloc->alloc(pNext_size);
7068         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7069     }
7070     deepcopy_VkSubresourceLayout(alloc, rootType, &from->subresourceLayout,
7071                                  (VkSubresourceLayout*)(&to->subresourceLayout));
7072 }
7073 
deepcopy_VkPipelineCreateFlags2CreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineCreateFlags2CreateInfo * from,VkPipelineCreateFlags2CreateInfo * to)7074 void deepcopy_VkPipelineCreateFlags2CreateInfo(Allocator* alloc, VkStructureType rootType,
7075                                                const VkPipelineCreateFlags2CreateInfo* from,
7076                                                VkPipelineCreateFlags2CreateInfo* to) {
7077     (void)alloc;
7078     (void)rootType;
7079     *to = *from;
7080     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7081         rootType = from->sType;
7082     }
7083     const void* from_pNext = from;
7084     size_t pNext_size = 0u;
7085     while (!pNext_size && from_pNext) {
7086         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7087         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7088     }
7089     to->pNext = nullptr;
7090     if (pNext_size) {
7091         to->pNext = (void*)alloc->alloc(pNext_size);
7092         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7093     }
7094 }
7095 
deepcopy_VkBufferUsageFlags2CreateInfo(Allocator * alloc,VkStructureType rootType,const VkBufferUsageFlags2CreateInfo * from,VkBufferUsageFlags2CreateInfo * to)7096 void deepcopy_VkBufferUsageFlags2CreateInfo(Allocator* alloc, VkStructureType rootType,
7097                                             const VkBufferUsageFlags2CreateInfo* from,
7098                                             VkBufferUsageFlags2CreateInfo* to) {
7099     (void)alloc;
7100     (void)rootType;
7101     *to = *from;
7102     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7103         rootType = from->sType;
7104     }
7105     const void* from_pNext = from;
7106     size_t pNext_size = 0u;
7107     while (!pNext_size && from_pNext) {
7108         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7109         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7110     }
7111     to->pNext = nullptr;
7112     if (pNext_size) {
7113         to->pNext = (void*)alloc->alloc(pNext_size);
7114         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7115     }
7116 }
7117 
deepcopy_VkPhysicalDevicePushDescriptorProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePushDescriptorProperties * from,VkPhysicalDevicePushDescriptorProperties * to)7118 void deepcopy_VkPhysicalDevicePushDescriptorProperties(
7119     Allocator* alloc, VkStructureType rootType,
7120     const VkPhysicalDevicePushDescriptorProperties* from,
7121     VkPhysicalDevicePushDescriptorProperties* to) {
7122     (void)alloc;
7123     (void)rootType;
7124     *to = *from;
7125     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7126         rootType = from->sType;
7127     }
7128     const void* from_pNext = from;
7129     size_t pNext_size = 0u;
7130     while (!pNext_size && from_pNext) {
7131         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7132         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7133     }
7134     to->pNext = nullptr;
7135     if (pNext_size) {
7136         to->pNext = (void*)alloc->alloc(pNext_size);
7137         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7138     }
7139 }
7140 
deepcopy_VkPhysicalDeviceDynamicRenderingLocalReadFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDynamicRenderingLocalReadFeatures * from,VkPhysicalDeviceDynamicRenderingLocalReadFeatures * to)7141 void deepcopy_VkPhysicalDeviceDynamicRenderingLocalReadFeatures(
7142     Allocator* alloc, VkStructureType rootType,
7143     const VkPhysicalDeviceDynamicRenderingLocalReadFeatures* from,
7144     VkPhysicalDeviceDynamicRenderingLocalReadFeatures* to) {
7145     (void)alloc;
7146     (void)rootType;
7147     *to = *from;
7148     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7149         rootType = from->sType;
7150     }
7151     const void* from_pNext = from;
7152     size_t pNext_size = 0u;
7153     while (!pNext_size && from_pNext) {
7154         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7155         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7156     }
7157     to->pNext = nullptr;
7158     if (pNext_size) {
7159         to->pNext = (void*)alloc->alloc(pNext_size);
7160         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7161     }
7162 }
7163 
deepcopy_VkRenderingAttachmentLocationInfo(Allocator * alloc,VkStructureType rootType,const VkRenderingAttachmentLocationInfo * from,VkRenderingAttachmentLocationInfo * to)7164 void deepcopy_VkRenderingAttachmentLocationInfo(Allocator* alloc, VkStructureType rootType,
7165                                                 const VkRenderingAttachmentLocationInfo* from,
7166                                                 VkRenderingAttachmentLocationInfo* to) {
7167     (void)alloc;
7168     (void)rootType;
7169     *to = *from;
7170     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7171         rootType = from->sType;
7172     }
7173     const void* from_pNext = from;
7174     size_t pNext_size = 0u;
7175     while (!pNext_size && from_pNext) {
7176         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7177         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7178     }
7179     to->pNext = nullptr;
7180     if (pNext_size) {
7181         to->pNext = (void*)alloc->alloc(pNext_size);
7182         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7183     }
7184     to->pColorAttachmentLocations = nullptr;
7185     if (from->pColorAttachmentLocations) {
7186         to->pColorAttachmentLocations = (uint32_t*)alloc->dupArray(
7187             from->pColorAttachmentLocations, from->colorAttachmentCount * sizeof(const uint32_t));
7188     }
7189 }
7190 
deepcopy_VkRenderingInputAttachmentIndexInfo(Allocator * alloc,VkStructureType rootType,const VkRenderingInputAttachmentIndexInfo * from,VkRenderingInputAttachmentIndexInfo * to)7191 void deepcopy_VkRenderingInputAttachmentIndexInfo(Allocator* alloc, VkStructureType rootType,
7192                                                   const VkRenderingInputAttachmentIndexInfo* from,
7193                                                   VkRenderingInputAttachmentIndexInfo* to) {
7194     (void)alloc;
7195     (void)rootType;
7196     *to = *from;
7197     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7198         rootType = from->sType;
7199     }
7200     const void* from_pNext = from;
7201     size_t pNext_size = 0u;
7202     while (!pNext_size && from_pNext) {
7203         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7204         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7205     }
7206     to->pNext = nullptr;
7207     if (pNext_size) {
7208         to->pNext = (void*)alloc->alloc(pNext_size);
7209         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7210     }
7211     to->pColorAttachmentInputIndices = nullptr;
7212     if (from->pColorAttachmentInputIndices) {
7213         to->pColorAttachmentInputIndices =
7214             (uint32_t*)alloc->dupArray(from->pColorAttachmentInputIndices,
7215                                        from->colorAttachmentCount * sizeof(const uint32_t));
7216     }
7217     to->pDepthInputAttachmentIndex = nullptr;
7218     if (from->pDepthInputAttachmentIndex) {
7219         to->pDepthInputAttachmentIndex =
7220             (uint32_t*)alloc->dupArray(from->pDepthInputAttachmentIndex, sizeof(const uint32_t));
7221     }
7222     to->pStencilInputAttachmentIndex = nullptr;
7223     if (from->pStencilInputAttachmentIndex) {
7224         to->pStencilInputAttachmentIndex =
7225             (uint32_t*)alloc->dupArray(from->pStencilInputAttachmentIndex, sizeof(const uint32_t));
7226     }
7227 }
7228 
deepcopy_VkPhysicalDeviceMaintenance6Features(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance6Features * from,VkPhysicalDeviceMaintenance6Features * to)7229 void deepcopy_VkPhysicalDeviceMaintenance6Features(Allocator* alloc, VkStructureType rootType,
7230                                                    const VkPhysicalDeviceMaintenance6Features* from,
7231                                                    VkPhysicalDeviceMaintenance6Features* to) {
7232     (void)alloc;
7233     (void)rootType;
7234     *to = *from;
7235     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7236         rootType = from->sType;
7237     }
7238     const void* from_pNext = from;
7239     size_t pNext_size = 0u;
7240     while (!pNext_size && from_pNext) {
7241         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7242         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7243     }
7244     to->pNext = nullptr;
7245     if (pNext_size) {
7246         to->pNext = (void*)alloc->alloc(pNext_size);
7247         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7248     }
7249 }
7250 
deepcopy_VkPhysicalDeviceMaintenance6Properties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceMaintenance6Properties * from,VkPhysicalDeviceMaintenance6Properties * to)7251 void deepcopy_VkPhysicalDeviceMaintenance6Properties(
7252     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance6Properties* from,
7253     VkPhysicalDeviceMaintenance6Properties* to) {
7254     (void)alloc;
7255     (void)rootType;
7256     *to = *from;
7257     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7258         rootType = from->sType;
7259     }
7260     const void* from_pNext = from;
7261     size_t pNext_size = 0u;
7262     while (!pNext_size && from_pNext) {
7263         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7264         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7265     }
7266     to->pNext = nullptr;
7267     if (pNext_size) {
7268         to->pNext = (void*)alloc->alloc(pNext_size);
7269         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7270     }
7271 }
7272 
deepcopy_VkBindMemoryStatus(Allocator * alloc,VkStructureType rootType,const VkBindMemoryStatus * from,VkBindMemoryStatus * to)7273 void deepcopy_VkBindMemoryStatus(Allocator* alloc, VkStructureType rootType,
7274                                  const VkBindMemoryStatus* from, VkBindMemoryStatus* to) {
7275     (void)alloc;
7276     (void)rootType;
7277     *to = *from;
7278     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7279         rootType = from->sType;
7280     }
7281     const void* from_pNext = from;
7282     size_t pNext_size = 0u;
7283     while (!pNext_size && from_pNext) {
7284         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7285         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7286     }
7287     to->pNext = nullptr;
7288     if (pNext_size) {
7289         to->pNext = (void*)alloc->alloc(pNext_size);
7290         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7291     }
7292     to->pResult = nullptr;
7293     if (from->pResult) {
7294         to->pResult = (VkResult*)alloc->dupArray(from->pResult, sizeof(VkResult));
7295     }
7296 }
7297 
deepcopy_VkBindDescriptorSetsInfo(Allocator * alloc,VkStructureType rootType,const VkBindDescriptorSetsInfo * from,VkBindDescriptorSetsInfo * to)7298 void deepcopy_VkBindDescriptorSetsInfo(Allocator* alloc, VkStructureType rootType,
7299                                        const VkBindDescriptorSetsInfo* from,
7300                                        VkBindDescriptorSetsInfo* to) {
7301     (void)alloc;
7302     (void)rootType;
7303     *to = *from;
7304     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7305         rootType = from->sType;
7306     }
7307     const void* from_pNext = from;
7308     size_t pNext_size = 0u;
7309     while (!pNext_size && from_pNext) {
7310         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7311         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7312     }
7313     to->pNext = nullptr;
7314     if (pNext_size) {
7315         to->pNext = (void*)alloc->alloc(pNext_size);
7316         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7317     }
7318     to->pDescriptorSets = nullptr;
7319     if (from->pDescriptorSets) {
7320         to->pDescriptorSets = (VkDescriptorSet*)alloc->dupArray(
7321             from->pDescriptorSets, from->descriptorSetCount * sizeof(const VkDescriptorSet));
7322     }
7323     to->pDynamicOffsets = nullptr;
7324     if (from->pDynamicOffsets) {
7325         to->pDynamicOffsets = (uint32_t*)alloc->dupArray(
7326             from->pDynamicOffsets, from->dynamicOffsetCount * sizeof(const uint32_t));
7327     }
7328 }
7329 
deepcopy_VkPushConstantsInfo(Allocator * alloc,VkStructureType rootType,const VkPushConstantsInfo * from,VkPushConstantsInfo * to)7330 void deepcopy_VkPushConstantsInfo(Allocator* alloc, VkStructureType rootType,
7331                                   const VkPushConstantsInfo* from, VkPushConstantsInfo* to) {
7332     (void)alloc;
7333     (void)rootType;
7334     *to = *from;
7335     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7336         rootType = from->sType;
7337     }
7338     const void* from_pNext = from;
7339     size_t pNext_size = 0u;
7340     while (!pNext_size && from_pNext) {
7341         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7342         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7343     }
7344     to->pNext = nullptr;
7345     if (pNext_size) {
7346         to->pNext = (void*)alloc->alloc(pNext_size);
7347         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7348     }
7349     to->pValues = nullptr;
7350     if (from->pValues) {
7351         to->pValues = (void*)alloc->dupArray(from->pValues, from->size * sizeof(const uint8_t));
7352     }
7353 }
7354 
deepcopy_VkPushDescriptorSetInfo(Allocator * alloc,VkStructureType rootType,const VkPushDescriptorSetInfo * from,VkPushDescriptorSetInfo * to)7355 void deepcopy_VkPushDescriptorSetInfo(Allocator* alloc, VkStructureType rootType,
7356                                       const VkPushDescriptorSetInfo* from,
7357                                       VkPushDescriptorSetInfo* to) {
7358     (void)alloc;
7359     (void)rootType;
7360     *to = *from;
7361     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7362         rootType = from->sType;
7363     }
7364     const void* from_pNext = from;
7365     size_t pNext_size = 0u;
7366     while (!pNext_size && from_pNext) {
7367         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7368         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7369     }
7370     to->pNext = nullptr;
7371     if (pNext_size) {
7372         to->pNext = (void*)alloc->alloc(pNext_size);
7373         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7374     }
7375     if (from) {
7376         to->pDescriptorWrites = nullptr;
7377         if (from->pDescriptorWrites) {
7378             to->pDescriptorWrites = (VkWriteDescriptorSet*)alloc->alloc(
7379                 from->descriptorWriteCount * sizeof(const VkWriteDescriptorSet));
7380             to->descriptorWriteCount = from->descriptorWriteCount;
7381             for (uint32_t i = 0; i < (uint32_t)from->descriptorWriteCount; ++i) {
7382                 deepcopy_VkWriteDescriptorSet(alloc, rootType, from->pDescriptorWrites + i,
7383                                               (VkWriteDescriptorSet*)(to->pDescriptorWrites + i));
7384             }
7385         }
7386     }
7387 }
7388 
deepcopy_VkPushDescriptorSetWithTemplateInfo(Allocator * alloc,VkStructureType rootType,const VkPushDescriptorSetWithTemplateInfo * from,VkPushDescriptorSetWithTemplateInfo * to)7389 void deepcopy_VkPushDescriptorSetWithTemplateInfo(Allocator* alloc, VkStructureType rootType,
7390                                                   const VkPushDescriptorSetWithTemplateInfo* from,
7391                                                   VkPushDescriptorSetWithTemplateInfo* to) {
7392     (void)alloc;
7393     (void)rootType;
7394     *to = *from;
7395     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7396         rootType = from->sType;
7397     }
7398     const void* from_pNext = from;
7399     size_t pNext_size = 0u;
7400     while (!pNext_size && from_pNext) {
7401         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7402         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7403     }
7404     to->pNext = nullptr;
7405     if (pNext_size) {
7406         to->pNext = (void*)alloc->alloc(pNext_size);
7407         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7408     }
7409     to->pData = nullptr;
7410     if (from->pData) {
7411         to->pData = (void*)alloc->dupArray(from->pData, sizeof(const uint8_t));
7412     }
7413 }
7414 
deepcopy_VkPhysicalDevicePipelineProtectedAccessFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePipelineProtectedAccessFeatures * from,VkPhysicalDevicePipelineProtectedAccessFeatures * to)7415 void deepcopy_VkPhysicalDevicePipelineProtectedAccessFeatures(
7416     Allocator* alloc, VkStructureType rootType,
7417     const VkPhysicalDevicePipelineProtectedAccessFeatures* from,
7418     VkPhysicalDevicePipelineProtectedAccessFeatures* to) {
7419     (void)alloc;
7420     (void)rootType;
7421     *to = *from;
7422     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7423         rootType = from->sType;
7424     }
7425     const void* from_pNext = from;
7426     size_t pNext_size = 0u;
7427     while (!pNext_size && from_pNext) {
7428         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7429         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7430     }
7431     to->pNext = nullptr;
7432     if (pNext_size) {
7433         to->pNext = (void*)alloc->alloc(pNext_size);
7434         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7435     }
7436 }
7437 
deepcopy_VkPhysicalDevicePipelineRobustnessFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePipelineRobustnessFeatures * from,VkPhysicalDevicePipelineRobustnessFeatures * to)7438 void deepcopy_VkPhysicalDevicePipelineRobustnessFeatures(
7439     Allocator* alloc, VkStructureType rootType,
7440     const VkPhysicalDevicePipelineRobustnessFeatures* from,
7441     VkPhysicalDevicePipelineRobustnessFeatures* to) {
7442     (void)alloc;
7443     (void)rootType;
7444     *to = *from;
7445     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7446         rootType = from->sType;
7447     }
7448     const void* from_pNext = from;
7449     size_t pNext_size = 0u;
7450     while (!pNext_size && from_pNext) {
7451         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7452         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7453     }
7454     to->pNext = nullptr;
7455     if (pNext_size) {
7456         to->pNext = (void*)alloc->alloc(pNext_size);
7457         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7458     }
7459 }
7460 
deepcopy_VkPhysicalDevicePipelineRobustnessProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePipelineRobustnessProperties * from,VkPhysicalDevicePipelineRobustnessProperties * to)7461 void deepcopy_VkPhysicalDevicePipelineRobustnessProperties(
7462     Allocator* alloc, VkStructureType rootType,
7463     const VkPhysicalDevicePipelineRobustnessProperties* from,
7464     VkPhysicalDevicePipelineRobustnessProperties* to) {
7465     (void)alloc;
7466     (void)rootType;
7467     *to = *from;
7468     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7469         rootType = from->sType;
7470     }
7471     const void* from_pNext = from;
7472     size_t pNext_size = 0u;
7473     while (!pNext_size && from_pNext) {
7474         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7475         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7476     }
7477     to->pNext = nullptr;
7478     if (pNext_size) {
7479         to->pNext = (void*)alloc->alloc(pNext_size);
7480         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7481     }
7482 }
7483 
deepcopy_VkPipelineRobustnessCreateInfo(Allocator * alloc,VkStructureType rootType,const VkPipelineRobustnessCreateInfo * from,VkPipelineRobustnessCreateInfo * to)7484 void deepcopy_VkPipelineRobustnessCreateInfo(Allocator* alloc, VkStructureType rootType,
7485                                              const VkPipelineRobustnessCreateInfo* from,
7486                                              VkPipelineRobustnessCreateInfo* to) {
7487     (void)alloc;
7488     (void)rootType;
7489     *to = *from;
7490     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7491         rootType = from->sType;
7492     }
7493     const void* from_pNext = from;
7494     size_t pNext_size = 0u;
7495     while (!pNext_size && from_pNext) {
7496         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7497         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7498     }
7499     to->pNext = nullptr;
7500     if (pNext_size) {
7501         to->pNext = (void*)alloc->alloc(pNext_size);
7502         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7503     }
7504 }
7505 
deepcopy_VkPhysicalDeviceHostImageCopyFeatures(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceHostImageCopyFeatures * from,VkPhysicalDeviceHostImageCopyFeatures * to)7506 void deepcopy_VkPhysicalDeviceHostImageCopyFeatures(
7507     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceHostImageCopyFeatures* from,
7508     VkPhysicalDeviceHostImageCopyFeatures* to) {
7509     (void)alloc;
7510     (void)rootType;
7511     *to = *from;
7512     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7513         rootType = from->sType;
7514     }
7515     const void* from_pNext = from;
7516     size_t pNext_size = 0u;
7517     while (!pNext_size && from_pNext) {
7518         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7519         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7520     }
7521     to->pNext = nullptr;
7522     if (pNext_size) {
7523         to->pNext = (void*)alloc->alloc(pNext_size);
7524         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7525     }
7526 }
7527 
deepcopy_VkPhysicalDeviceHostImageCopyProperties(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceHostImageCopyProperties * from,VkPhysicalDeviceHostImageCopyProperties * to)7528 void deepcopy_VkPhysicalDeviceHostImageCopyProperties(
7529     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceHostImageCopyProperties* from,
7530     VkPhysicalDeviceHostImageCopyProperties* to) {
7531     (void)alloc;
7532     (void)rootType;
7533     *to = *from;
7534     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7535         rootType = from->sType;
7536     }
7537     const void* from_pNext = from;
7538     size_t pNext_size = 0u;
7539     while (!pNext_size && from_pNext) {
7540         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7541         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7542     }
7543     to->pNext = nullptr;
7544     if (pNext_size) {
7545         to->pNext = (void*)alloc->alloc(pNext_size);
7546         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7547     }
7548     to->pCopySrcLayouts = nullptr;
7549     if (from->pCopySrcLayouts) {
7550         to->pCopySrcLayouts = (VkImageLayout*)alloc->dupArray(
7551             from->pCopySrcLayouts, from->copySrcLayoutCount * sizeof(VkImageLayout));
7552     }
7553     to->pCopyDstLayouts = nullptr;
7554     if (from->pCopyDstLayouts) {
7555         to->pCopyDstLayouts = (VkImageLayout*)alloc->dupArray(
7556             from->pCopyDstLayouts, from->copyDstLayoutCount * sizeof(VkImageLayout));
7557     }
7558     memcpy(to->optimalTilingLayoutUUID, from->optimalTilingLayoutUUID,
7559            VK_UUID_SIZE * sizeof(uint8_t));
7560 }
7561 
deepcopy_VkMemoryToImageCopy(Allocator * alloc,VkStructureType rootType,const VkMemoryToImageCopy * from,VkMemoryToImageCopy * to)7562 void deepcopy_VkMemoryToImageCopy(Allocator* alloc, VkStructureType rootType,
7563                                   const VkMemoryToImageCopy* from, VkMemoryToImageCopy* to) {
7564     (void)alloc;
7565     (void)rootType;
7566     *to = *from;
7567     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7568         rootType = from->sType;
7569     }
7570     const void* from_pNext = from;
7571     size_t pNext_size = 0u;
7572     while (!pNext_size && from_pNext) {
7573         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7574         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7575     }
7576     to->pNext = nullptr;
7577     if (pNext_size) {
7578         to->pNext = (void*)alloc->alloc(pNext_size);
7579         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7580     }
7581     to->pHostPointer = nullptr;
7582     if (from->pHostPointer) {
7583         to->pHostPointer = (void*)alloc->dupArray(from->pHostPointer, sizeof(const uint8_t));
7584     }
7585     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
7586                                       (VkImageSubresourceLayers*)(&to->imageSubresource));
7587     deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
7588     deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
7589 }
7590 
deepcopy_VkImageToMemoryCopy(Allocator * alloc,VkStructureType rootType,const VkImageToMemoryCopy * from,VkImageToMemoryCopy * to)7591 void deepcopy_VkImageToMemoryCopy(Allocator* alloc, VkStructureType rootType,
7592                                   const VkImageToMemoryCopy* from, VkImageToMemoryCopy* to) {
7593     (void)alloc;
7594     (void)rootType;
7595     *to = *from;
7596     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7597         rootType = from->sType;
7598     }
7599     const void* from_pNext = from;
7600     size_t pNext_size = 0u;
7601     while (!pNext_size && from_pNext) {
7602         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7603         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7604     }
7605     to->pNext = nullptr;
7606     if (pNext_size) {
7607         to->pNext = (void*)alloc->alloc(pNext_size);
7608         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7609     }
7610     to->pHostPointer = nullptr;
7611     if (from->pHostPointer) {
7612         to->pHostPointer = (void*)alloc->dupArray(from->pHostPointer, sizeof(uint8_t));
7613     }
7614     deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
7615                                       (VkImageSubresourceLayers*)(&to->imageSubresource));
7616     deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
7617     deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
7618 }
7619 
deepcopy_VkCopyMemoryToImageInfo(Allocator * alloc,VkStructureType rootType,const VkCopyMemoryToImageInfo * from,VkCopyMemoryToImageInfo * to)7620 void deepcopy_VkCopyMemoryToImageInfo(Allocator* alloc, VkStructureType rootType,
7621                                       const VkCopyMemoryToImageInfo* from,
7622                                       VkCopyMemoryToImageInfo* to) {
7623     (void)alloc;
7624     (void)rootType;
7625     *to = *from;
7626     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7627         rootType = from->sType;
7628     }
7629     const void* from_pNext = from;
7630     size_t pNext_size = 0u;
7631     while (!pNext_size && from_pNext) {
7632         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7633         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7634     }
7635     to->pNext = nullptr;
7636     if (pNext_size) {
7637         to->pNext = (void*)alloc->alloc(pNext_size);
7638         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7639     }
7640     if (from) {
7641         to->pRegions = nullptr;
7642         if (from->pRegions) {
7643             to->pRegions = (VkMemoryToImageCopy*)alloc->alloc(from->regionCount *
7644                                                               sizeof(const VkMemoryToImageCopy));
7645             to->regionCount = from->regionCount;
7646             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
7647                 deepcopy_VkMemoryToImageCopy(alloc, rootType, from->pRegions + i,
7648                                              (VkMemoryToImageCopy*)(to->pRegions + i));
7649             }
7650         }
7651     }
7652 }
7653 
deepcopy_VkCopyImageToMemoryInfo(Allocator * alloc,VkStructureType rootType,const VkCopyImageToMemoryInfo * from,VkCopyImageToMemoryInfo * to)7654 void deepcopy_VkCopyImageToMemoryInfo(Allocator* alloc, VkStructureType rootType,
7655                                       const VkCopyImageToMemoryInfo* from,
7656                                       VkCopyImageToMemoryInfo* to) {
7657     (void)alloc;
7658     (void)rootType;
7659     *to = *from;
7660     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7661         rootType = from->sType;
7662     }
7663     const void* from_pNext = from;
7664     size_t pNext_size = 0u;
7665     while (!pNext_size && from_pNext) {
7666         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7667         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7668     }
7669     to->pNext = nullptr;
7670     if (pNext_size) {
7671         to->pNext = (void*)alloc->alloc(pNext_size);
7672         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7673     }
7674     if (from) {
7675         to->pRegions = nullptr;
7676         if (from->pRegions) {
7677             to->pRegions = (VkImageToMemoryCopy*)alloc->alloc(from->regionCount *
7678                                                               sizeof(const VkImageToMemoryCopy));
7679             to->regionCount = from->regionCount;
7680             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
7681                 deepcopy_VkImageToMemoryCopy(alloc, rootType, from->pRegions + i,
7682                                              (VkImageToMemoryCopy*)(to->pRegions + i));
7683             }
7684         }
7685     }
7686 }
7687 
deepcopy_VkCopyImageToImageInfo(Allocator * alloc,VkStructureType rootType,const VkCopyImageToImageInfo * from,VkCopyImageToImageInfo * to)7688 void deepcopy_VkCopyImageToImageInfo(Allocator* alloc, VkStructureType rootType,
7689                                      const VkCopyImageToImageInfo* from,
7690                                      VkCopyImageToImageInfo* to) {
7691     (void)alloc;
7692     (void)rootType;
7693     *to = *from;
7694     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7695         rootType = from->sType;
7696     }
7697     const void* from_pNext = from;
7698     size_t pNext_size = 0u;
7699     while (!pNext_size && from_pNext) {
7700         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7701         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7702     }
7703     to->pNext = nullptr;
7704     if (pNext_size) {
7705         to->pNext = (void*)alloc->alloc(pNext_size);
7706         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7707     }
7708     if (from) {
7709         to->pRegions = nullptr;
7710         if (from->pRegions) {
7711             to->pRegions =
7712                 (VkImageCopy2*)alloc->alloc(from->regionCount * sizeof(const VkImageCopy2));
7713             to->regionCount = from->regionCount;
7714             for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
7715                 deepcopy_VkImageCopy2(alloc, rootType, from->pRegions + i,
7716                                       (VkImageCopy2*)(to->pRegions + i));
7717             }
7718         }
7719     }
7720 }
7721 
deepcopy_VkHostImageLayoutTransitionInfo(Allocator * alloc,VkStructureType rootType,const VkHostImageLayoutTransitionInfo * from,VkHostImageLayoutTransitionInfo * to)7722 void deepcopy_VkHostImageLayoutTransitionInfo(Allocator* alloc, VkStructureType rootType,
7723                                               const VkHostImageLayoutTransitionInfo* from,
7724                                               VkHostImageLayoutTransitionInfo* to) {
7725     (void)alloc;
7726     (void)rootType;
7727     *to = *from;
7728     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7729         rootType = from->sType;
7730     }
7731     const void* from_pNext = from;
7732     size_t pNext_size = 0u;
7733     while (!pNext_size && from_pNext) {
7734         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7735         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7736     }
7737     to->pNext = nullptr;
7738     if (pNext_size) {
7739         to->pNext = (void*)alloc->alloc(pNext_size);
7740         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7741     }
7742     deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
7743                                      (VkImageSubresourceRange*)(&to->subresourceRange));
7744 }
7745 
deepcopy_VkSubresourceHostMemcpySize(Allocator * alloc,VkStructureType rootType,const VkSubresourceHostMemcpySize * from,VkSubresourceHostMemcpySize * to)7746 void deepcopy_VkSubresourceHostMemcpySize(Allocator* alloc, VkStructureType rootType,
7747                                           const VkSubresourceHostMemcpySize* from,
7748                                           VkSubresourceHostMemcpySize* to) {
7749     (void)alloc;
7750     (void)rootType;
7751     *to = *from;
7752     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7753         rootType = from->sType;
7754     }
7755     const void* from_pNext = from;
7756     size_t pNext_size = 0u;
7757     while (!pNext_size && from_pNext) {
7758         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7759         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7760     }
7761     to->pNext = nullptr;
7762     if (pNext_size) {
7763         to->pNext = (void*)alloc->alloc(pNext_size);
7764         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7765     }
7766 }
7767 
deepcopy_VkHostImageCopyDevicePerformanceQuery(Allocator * alloc,VkStructureType rootType,const VkHostImageCopyDevicePerformanceQuery * from,VkHostImageCopyDevicePerformanceQuery * to)7768 void deepcopy_VkHostImageCopyDevicePerformanceQuery(
7769     Allocator* alloc, VkStructureType rootType, const VkHostImageCopyDevicePerformanceQuery* from,
7770     VkHostImageCopyDevicePerformanceQuery* to) {
7771     (void)alloc;
7772     (void)rootType;
7773     *to = *from;
7774     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7775         rootType = from->sType;
7776     }
7777     const void* from_pNext = from;
7778     size_t pNext_size = 0u;
7779     while (!pNext_size && from_pNext) {
7780         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7781         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7782     }
7783     to->pNext = nullptr;
7784     if (pNext_size) {
7785         to->pNext = (void*)alloc->alloc(pNext_size);
7786         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7787     }
7788 }
7789 
7790 #endif
7791 #ifdef VK_KHR_external_semaphore_fd
deepcopy_VkImportSemaphoreFdInfoKHR(Allocator * alloc,VkStructureType rootType,const VkImportSemaphoreFdInfoKHR * from,VkImportSemaphoreFdInfoKHR * to)7792 void deepcopy_VkImportSemaphoreFdInfoKHR(Allocator* alloc, VkStructureType rootType,
7793                                          const VkImportSemaphoreFdInfoKHR* from,
7794                                          VkImportSemaphoreFdInfoKHR* to) {
7795     (void)alloc;
7796     (void)rootType;
7797     *to = *from;
7798     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7799         rootType = from->sType;
7800     }
7801     const void* from_pNext = from;
7802     size_t pNext_size = 0u;
7803     while (!pNext_size && from_pNext) {
7804         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7805         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7806     }
7807     to->pNext = nullptr;
7808     if (pNext_size) {
7809         to->pNext = (void*)alloc->alloc(pNext_size);
7810         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7811     }
7812 }
7813 
deepcopy_VkSemaphoreGetFdInfoKHR(Allocator * alloc,VkStructureType rootType,const VkSemaphoreGetFdInfoKHR * from,VkSemaphoreGetFdInfoKHR * to)7814 void deepcopy_VkSemaphoreGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
7815                                       const VkSemaphoreGetFdInfoKHR* from,
7816                                       VkSemaphoreGetFdInfoKHR* to) {
7817     (void)alloc;
7818     (void)rootType;
7819     *to = *from;
7820     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7821         rootType = from->sType;
7822     }
7823     const void* from_pNext = from;
7824     size_t pNext_size = 0u;
7825     while (!pNext_size && from_pNext) {
7826         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7827         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7828     }
7829     to->pNext = nullptr;
7830     if (pNext_size) {
7831         to->pNext = (void*)alloc->alloc(pNext_size);
7832         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7833     }
7834 }
7835 
7836 #endif
7837 #ifdef VK_KHR_incremental_present
deepcopy_VkRectLayerKHR(Allocator * alloc,VkStructureType rootType,const VkRectLayerKHR * from,VkRectLayerKHR * to)7838 void deepcopy_VkRectLayerKHR(Allocator* alloc, VkStructureType rootType, const VkRectLayerKHR* from,
7839                              VkRectLayerKHR* to) {
7840     (void)alloc;
7841     (void)rootType;
7842     *to = *from;
7843     deepcopy_VkOffset2D(alloc, rootType, &from->offset, (VkOffset2D*)(&to->offset));
7844     deepcopy_VkExtent2D(alloc, rootType, &from->extent, (VkExtent2D*)(&to->extent));
7845 }
7846 
deepcopy_VkPresentRegionKHR(Allocator * alloc,VkStructureType rootType,const VkPresentRegionKHR * from,VkPresentRegionKHR * to)7847 void deepcopy_VkPresentRegionKHR(Allocator* alloc, VkStructureType rootType,
7848                                  const VkPresentRegionKHR* from, VkPresentRegionKHR* to) {
7849     (void)alloc;
7850     (void)rootType;
7851     *to = *from;
7852     if (from) {
7853         to->pRectangles = nullptr;
7854         if (from->pRectangles) {
7855             to->pRectangles =
7856                 (VkRectLayerKHR*)alloc->alloc(from->rectangleCount * sizeof(const VkRectLayerKHR));
7857             to->rectangleCount = from->rectangleCount;
7858             for (uint32_t i = 0; i < (uint32_t)from->rectangleCount; ++i) {
7859                 deepcopy_VkRectLayerKHR(alloc, rootType, from->pRectangles + i,
7860                                         (VkRectLayerKHR*)(to->pRectangles + i));
7861             }
7862         }
7863     }
7864 }
7865 
deepcopy_VkPresentRegionsKHR(Allocator * alloc,VkStructureType rootType,const VkPresentRegionsKHR * from,VkPresentRegionsKHR * to)7866 void deepcopy_VkPresentRegionsKHR(Allocator* alloc, VkStructureType rootType,
7867                                   const VkPresentRegionsKHR* from, VkPresentRegionsKHR* to) {
7868     (void)alloc;
7869     (void)rootType;
7870     *to = *from;
7871     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7872         rootType = from->sType;
7873     }
7874     const void* from_pNext = from;
7875     size_t pNext_size = 0u;
7876     while (!pNext_size && from_pNext) {
7877         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7878         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7879     }
7880     to->pNext = nullptr;
7881     if (pNext_size) {
7882         to->pNext = (void*)alloc->alloc(pNext_size);
7883         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7884     }
7885     if (from) {
7886         to->pRegions = nullptr;
7887         if (from->pRegions) {
7888             to->pRegions = (VkPresentRegionKHR*)alloc->alloc(from->swapchainCount *
7889                                                              sizeof(const VkPresentRegionKHR));
7890             to->swapchainCount = from->swapchainCount;
7891             for (uint32_t i = 0; i < (uint32_t)from->swapchainCount; ++i) {
7892                 deepcopy_VkPresentRegionKHR(alloc, rootType, from->pRegions + i,
7893                                             (VkPresentRegionKHR*)(to->pRegions + i));
7894             }
7895         }
7896     }
7897 }
7898 
7899 #endif
7900 #ifdef VK_KHR_external_fence_fd
deepcopy_VkImportFenceFdInfoKHR(Allocator * alloc,VkStructureType rootType,const VkImportFenceFdInfoKHR * from,VkImportFenceFdInfoKHR * to)7901 void deepcopy_VkImportFenceFdInfoKHR(Allocator* alloc, VkStructureType rootType,
7902                                      const VkImportFenceFdInfoKHR* from,
7903                                      VkImportFenceFdInfoKHR* to) {
7904     (void)alloc;
7905     (void)rootType;
7906     *to = *from;
7907     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7908         rootType = from->sType;
7909     }
7910     const void* from_pNext = from;
7911     size_t pNext_size = 0u;
7912     while (!pNext_size && from_pNext) {
7913         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7914         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7915     }
7916     to->pNext = nullptr;
7917     if (pNext_size) {
7918         to->pNext = (void*)alloc->alloc(pNext_size);
7919         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7920     }
7921 }
7922 
deepcopy_VkFenceGetFdInfoKHR(Allocator * alloc,VkStructureType rootType,const VkFenceGetFdInfoKHR * from,VkFenceGetFdInfoKHR * to)7923 void deepcopy_VkFenceGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
7924                                   const VkFenceGetFdInfoKHR* from, VkFenceGetFdInfoKHR* to) {
7925     (void)alloc;
7926     (void)rootType;
7927     *to = *from;
7928     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7929         rootType = from->sType;
7930     }
7931     const void* from_pNext = from;
7932     size_t pNext_size = 0u;
7933     while (!pNext_size && from_pNext) {
7934         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7935         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7936     }
7937     to->pNext = nullptr;
7938     if (pNext_size) {
7939         to->pNext = (void*)alloc->alloc(pNext_size);
7940         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7941     }
7942 }
7943 
7944 #endif
7945 #ifdef VK_KHR_pipeline_executable_properties
deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR * from,VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR * to)7946 void deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
7947     Allocator* alloc, VkStructureType rootType,
7948     const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* from,
7949     VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* to) {
7950     (void)alloc;
7951     (void)rootType;
7952     *to = *from;
7953     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7954         rootType = from->sType;
7955     }
7956     const void* from_pNext = from;
7957     size_t pNext_size = 0u;
7958     while (!pNext_size && from_pNext) {
7959         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7960         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7961     }
7962     to->pNext = nullptr;
7963     if (pNext_size) {
7964         to->pNext = (void*)alloc->alloc(pNext_size);
7965         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7966     }
7967 }
7968 
deepcopy_VkPipelineInfoKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineInfoKHR * from,VkPipelineInfoKHR * to)7969 void deepcopy_VkPipelineInfoKHR(Allocator* alloc, VkStructureType rootType,
7970                                 const VkPipelineInfoKHR* from, VkPipelineInfoKHR* to) {
7971     (void)alloc;
7972     (void)rootType;
7973     *to = *from;
7974     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7975         rootType = from->sType;
7976     }
7977     const void* from_pNext = from;
7978     size_t pNext_size = 0u;
7979     while (!pNext_size && from_pNext) {
7980         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
7981         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
7982     }
7983     to->pNext = nullptr;
7984     if (pNext_size) {
7985         to->pNext = (void*)alloc->alloc(pNext_size);
7986         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
7987     }
7988 }
7989 
deepcopy_VkPipelineExecutablePropertiesKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineExecutablePropertiesKHR * from,VkPipelineExecutablePropertiesKHR * to)7990 void deepcopy_VkPipelineExecutablePropertiesKHR(Allocator* alloc, VkStructureType rootType,
7991                                                 const VkPipelineExecutablePropertiesKHR* from,
7992                                                 VkPipelineExecutablePropertiesKHR* to) {
7993     (void)alloc;
7994     (void)rootType;
7995     *to = *from;
7996     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
7997         rootType = from->sType;
7998     }
7999     const void* from_pNext = from;
8000     size_t pNext_size = 0u;
8001     while (!pNext_size && from_pNext) {
8002         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8003         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8004     }
8005     to->pNext = nullptr;
8006     if (pNext_size) {
8007         to->pNext = (void*)alloc->alloc(pNext_size);
8008         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8009     }
8010     memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8011     memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8012 }
8013 
deepcopy_VkPipelineExecutableInfoKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineExecutableInfoKHR * from,VkPipelineExecutableInfoKHR * to)8014 void deepcopy_VkPipelineExecutableInfoKHR(Allocator* alloc, VkStructureType rootType,
8015                                           const VkPipelineExecutableInfoKHR* from,
8016                                           VkPipelineExecutableInfoKHR* to) {
8017     (void)alloc;
8018     (void)rootType;
8019     *to = *from;
8020     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8021         rootType = from->sType;
8022     }
8023     const void* from_pNext = from;
8024     size_t pNext_size = 0u;
8025     while (!pNext_size && from_pNext) {
8026         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8027         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8028     }
8029     to->pNext = nullptr;
8030     if (pNext_size) {
8031         to->pNext = (void*)alloc->alloc(pNext_size);
8032         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8033     }
8034 }
8035 
deepcopy_VkPipelineExecutableStatisticValueKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineExecutableStatisticValueKHR * from,VkPipelineExecutableStatisticValueKHR * to)8036 void deepcopy_VkPipelineExecutableStatisticValueKHR(
8037     Allocator* alloc, VkStructureType rootType, const VkPipelineExecutableStatisticValueKHR* from,
8038     VkPipelineExecutableStatisticValueKHR* to) {
8039     (void)alloc;
8040     (void)rootType;
8041     *to = *from;
8042 }
8043 
deepcopy_VkPipelineExecutableStatisticKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineExecutableStatisticKHR * from,VkPipelineExecutableStatisticKHR * to)8044 void deepcopy_VkPipelineExecutableStatisticKHR(Allocator* alloc, VkStructureType rootType,
8045                                                const VkPipelineExecutableStatisticKHR* from,
8046                                                VkPipelineExecutableStatisticKHR* to) {
8047     (void)alloc;
8048     (void)rootType;
8049     *to = *from;
8050     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8051         rootType = from->sType;
8052     }
8053     const void* from_pNext = from;
8054     size_t pNext_size = 0u;
8055     while (!pNext_size && from_pNext) {
8056         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8057         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8058     }
8059     to->pNext = nullptr;
8060     if (pNext_size) {
8061         to->pNext = (void*)alloc->alloc(pNext_size);
8062         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8063     }
8064     memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8065     memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8066     deepcopy_VkPipelineExecutableStatisticValueKHR(
8067         alloc, rootType, &from->value, (VkPipelineExecutableStatisticValueKHR*)(&to->value));
8068 }
8069 
deepcopy_VkPipelineExecutableInternalRepresentationKHR(Allocator * alloc,VkStructureType rootType,const VkPipelineExecutableInternalRepresentationKHR * from,VkPipelineExecutableInternalRepresentationKHR * to)8070 void deepcopy_VkPipelineExecutableInternalRepresentationKHR(
8071     Allocator* alloc, VkStructureType rootType,
8072     const VkPipelineExecutableInternalRepresentationKHR* from,
8073     VkPipelineExecutableInternalRepresentationKHR* to) {
8074     (void)alloc;
8075     (void)rootType;
8076     *to = *from;
8077     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8078         rootType = from->sType;
8079     }
8080     const void* from_pNext = from;
8081     size_t pNext_size = 0u;
8082     while (!pNext_size && from_pNext) {
8083         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8084         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8085     }
8086     to->pNext = nullptr;
8087     if (pNext_size) {
8088         to->pNext = (void*)alloc->alloc(pNext_size);
8089         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8090     }
8091     memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8092     memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
8093     to->pData = nullptr;
8094     if (from->pData) {
8095         to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(uint8_t));
8096     }
8097 }
8098 
8099 #endif
8100 #ifdef VK_ANDROID_native_buffer
deepcopy_VkNativeBufferUsage2ANDROID(Allocator * alloc,VkStructureType rootType,const VkNativeBufferUsage2ANDROID * from,VkNativeBufferUsage2ANDROID * to)8101 void deepcopy_VkNativeBufferUsage2ANDROID(Allocator* alloc, VkStructureType rootType,
8102                                           const VkNativeBufferUsage2ANDROID* from,
8103                                           VkNativeBufferUsage2ANDROID* to) {
8104     (void)alloc;
8105     (void)rootType;
8106     *to = *from;
8107 }
8108 
deepcopy_VkNativeBufferANDROID(Allocator * alloc,VkStructureType rootType,const VkNativeBufferANDROID * from,VkNativeBufferANDROID * to)8109 void deepcopy_VkNativeBufferANDROID(Allocator* alloc, VkStructureType rootType,
8110                                     const VkNativeBufferANDROID* from, VkNativeBufferANDROID* to) {
8111     (void)alloc;
8112     (void)rootType;
8113     *to = *from;
8114     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8115         rootType = from->sType;
8116     }
8117     const void* from_pNext = from;
8118     size_t pNext_size = 0u;
8119     while (!pNext_size && from_pNext) {
8120         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8121         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8122     }
8123     to->pNext = nullptr;
8124     if (pNext_size) {
8125         to->pNext = (void*)alloc->alloc(pNext_size);
8126         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8127     }
8128     to->handle = nullptr;
8129     if (from->handle) {
8130         to->handle = (uint32_t*)alloc->dupArray(from->handle, sizeof(const uint32_t));
8131     }
8132     deepcopy_VkNativeBufferUsage2ANDROID(alloc, rootType, &from->usage2,
8133                                          (VkNativeBufferUsage2ANDROID*)(&to->usage2));
8134 }
8135 
deepcopy_VkSwapchainImageCreateInfoANDROID(Allocator * alloc,VkStructureType rootType,const VkSwapchainImageCreateInfoANDROID * from,VkSwapchainImageCreateInfoANDROID * to)8136 void deepcopy_VkSwapchainImageCreateInfoANDROID(Allocator* alloc, VkStructureType rootType,
8137                                                 const VkSwapchainImageCreateInfoANDROID* from,
8138                                                 VkSwapchainImageCreateInfoANDROID* to) {
8139     (void)alloc;
8140     (void)rootType;
8141     *to = *from;
8142     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8143         rootType = from->sType;
8144     }
8145     const void* from_pNext = from;
8146     size_t pNext_size = 0u;
8147     while (!pNext_size && from_pNext) {
8148         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8149         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8150     }
8151     to->pNext = nullptr;
8152     if (pNext_size) {
8153         to->pNext = (void*)alloc->alloc(pNext_size);
8154         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8155     }
8156 }
8157 
deepcopy_VkPhysicalDevicePresentationPropertiesANDROID(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePresentationPropertiesANDROID * from,VkPhysicalDevicePresentationPropertiesANDROID * to)8158 void deepcopy_VkPhysicalDevicePresentationPropertiesANDROID(
8159     Allocator* alloc, VkStructureType rootType,
8160     const VkPhysicalDevicePresentationPropertiesANDROID* from,
8161     VkPhysicalDevicePresentationPropertiesANDROID* to) {
8162     (void)alloc;
8163     (void)rootType;
8164     *to = *from;
8165     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8166         rootType = from->sType;
8167     }
8168     const void* from_pNext = from;
8169     size_t pNext_size = 0u;
8170     while (!pNext_size && from_pNext) {
8171         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8172         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8173     }
8174     to->pNext = nullptr;
8175     if (pNext_size) {
8176         to->pNext = (void*)alloc->alloc(pNext_size);
8177         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8178     }
8179 }
8180 
8181 #endif
8182 #ifdef VK_EXT_transform_feedback
deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTransformFeedbackFeaturesEXT * from,VkPhysicalDeviceTransformFeedbackFeaturesEXT * to)8183 void deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
8184     Allocator* alloc, VkStructureType rootType,
8185     const VkPhysicalDeviceTransformFeedbackFeaturesEXT* from,
8186     VkPhysicalDeviceTransformFeedbackFeaturesEXT* to) {
8187     (void)alloc;
8188     (void)rootType;
8189     *to = *from;
8190     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8191         rootType = from->sType;
8192     }
8193     const void* from_pNext = from;
8194     size_t pNext_size = 0u;
8195     while (!pNext_size && from_pNext) {
8196         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8197         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8198     }
8199     to->pNext = nullptr;
8200     if (pNext_size) {
8201         to->pNext = (void*)alloc->alloc(pNext_size);
8202         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8203     }
8204 }
8205 
deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTransformFeedbackPropertiesEXT * from,VkPhysicalDeviceTransformFeedbackPropertiesEXT * to)8206 void deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
8207     Allocator* alloc, VkStructureType rootType,
8208     const VkPhysicalDeviceTransformFeedbackPropertiesEXT* from,
8209     VkPhysicalDeviceTransformFeedbackPropertiesEXT* to) {
8210     (void)alloc;
8211     (void)rootType;
8212     *to = *from;
8213     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8214         rootType = from->sType;
8215     }
8216     const void* from_pNext = from;
8217     size_t pNext_size = 0u;
8218     while (!pNext_size && from_pNext) {
8219         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8220         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8221     }
8222     to->pNext = nullptr;
8223     if (pNext_size) {
8224         to->pNext = (void*)alloc->alloc(pNext_size);
8225         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8226     }
8227 }
8228 
deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkPipelineRasterizationStateStreamCreateInfoEXT * from,VkPipelineRasterizationStateStreamCreateInfoEXT * to)8229 void deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(
8230     Allocator* alloc, VkStructureType rootType,
8231     const VkPipelineRasterizationStateStreamCreateInfoEXT* from,
8232     VkPipelineRasterizationStateStreamCreateInfoEXT* to) {
8233     (void)alloc;
8234     (void)rootType;
8235     *to = *from;
8236     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8237         rootType = from->sType;
8238     }
8239     const void* from_pNext = from;
8240     size_t pNext_size = 0u;
8241     while (!pNext_size && from_pNext) {
8242         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8243         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8244     }
8245     to->pNext = nullptr;
8246     if (pNext_size) {
8247         to->pNext = (void*)alloc->alloc(pNext_size);
8248         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8249     }
8250 }
8251 
8252 #endif
8253 #ifdef VK_EXT_depth_clip_enable
deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDepthClipEnableFeaturesEXT * from,VkPhysicalDeviceDepthClipEnableFeaturesEXT * to)8254 void deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
8255     Allocator* alloc, VkStructureType rootType,
8256     const VkPhysicalDeviceDepthClipEnableFeaturesEXT* from,
8257     VkPhysicalDeviceDepthClipEnableFeaturesEXT* to) {
8258     (void)alloc;
8259     (void)rootType;
8260     *to = *from;
8261     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8262         rootType = from->sType;
8263     }
8264     const void* from_pNext = from;
8265     size_t pNext_size = 0u;
8266     while (!pNext_size && from_pNext) {
8267         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8268         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8269     }
8270     to->pNext = nullptr;
8271     if (pNext_size) {
8272         to->pNext = (void*)alloc->alloc(pNext_size);
8273         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8274     }
8275 }
8276 
deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkPipelineRasterizationDepthClipStateCreateInfoEXT * from,VkPipelineRasterizationDepthClipStateCreateInfoEXT * to)8277 void deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
8278     Allocator* alloc, VkStructureType rootType,
8279     const VkPipelineRasterizationDepthClipStateCreateInfoEXT* from,
8280     VkPipelineRasterizationDepthClipStateCreateInfoEXT* to) {
8281     (void)alloc;
8282     (void)rootType;
8283     *to = *from;
8284     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8285         rootType = from->sType;
8286     }
8287     const void* from_pNext = from;
8288     size_t pNext_size = 0u;
8289     while (!pNext_size && from_pNext) {
8290         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8291         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8292     }
8293     to->pNext = nullptr;
8294     if (pNext_size) {
8295         to->pNext = (void*)alloc->alloc(pNext_size);
8296         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8297     }
8298 }
8299 
8300 #endif
8301 #ifdef VK_EXT_image_drm_format_modifier
deepcopy_VkDrmFormatModifierPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkDrmFormatModifierPropertiesEXT * from,VkDrmFormatModifierPropertiesEXT * to)8302 void deepcopy_VkDrmFormatModifierPropertiesEXT(Allocator* alloc, VkStructureType rootType,
8303                                                const VkDrmFormatModifierPropertiesEXT* from,
8304                                                VkDrmFormatModifierPropertiesEXT* to) {
8305     (void)alloc;
8306     (void)rootType;
8307     *to = *from;
8308 }
8309 
deepcopy_VkDrmFormatModifierPropertiesListEXT(Allocator * alloc,VkStructureType rootType,const VkDrmFormatModifierPropertiesListEXT * from,VkDrmFormatModifierPropertiesListEXT * to)8310 void deepcopy_VkDrmFormatModifierPropertiesListEXT(Allocator* alloc, VkStructureType rootType,
8311                                                    const VkDrmFormatModifierPropertiesListEXT* from,
8312                                                    VkDrmFormatModifierPropertiesListEXT* to) {
8313     (void)alloc;
8314     (void)rootType;
8315     *to = *from;
8316     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8317         rootType = from->sType;
8318     }
8319     const void* from_pNext = from;
8320     size_t pNext_size = 0u;
8321     while (!pNext_size && from_pNext) {
8322         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8323         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8324     }
8325     to->pNext = nullptr;
8326     if (pNext_size) {
8327         to->pNext = (void*)alloc->alloc(pNext_size);
8328         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8329     }
8330     if (from) {
8331         to->pDrmFormatModifierProperties = nullptr;
8332         if (from->pDrmFormatModifierProperties) {
8333             to->pDrmFormatModifierProperties = (VkDrmFormatModifierPropertiesEXT*)alloc->alloc(
8334                 from->drmFormatModifierCount * sizeof(VkDrmFormatModifierPropertiesEXT));
8335             to->drmFormatModifierCount = from->drmFormatModifierCount;
8336             for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierCount; ++i) {
8337                 deepcopy_VkDrmFormatModifierPropertiesEXT(
8338                     alloc, rootType, from->pDrmFormatModifierProperties + i,
8339                     (VkDrmFormatModifierPropertiesEXT*)(to->pDrmFormatModifierProperties + i));
8340             }
8341         }
8342     }
8343 }
8344 
deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImageDrmFormatModifierInfoEXT * from,VkPhysicalDeviceImageDrmFormatModifierInfoEXT * to)8345 void deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
8346     Allocator* alloc, VkStructureType rootType,
8347     const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* from,
8348     VkPhysicalDeviceImageDrmFormatModifierInfoEXT* to) {
8349     (void)alloc;
8350     (void)rootType;
8351     *to = *from;
8352     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8353         rootType = from->sType;
8354     }
8355     const void* from_pNext = from;
8356     size_t pNext_size = 0u;
8357     while (!pNext_size && from_pNext) {
8358         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8359         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8360     }
8361     to->pNext = nullptr;
8362     if (pNext_size) {
8363         to->pNext = (void*)alloc->alloc(pNext_size);
8364         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8365     }
8366     to->pQueueFamilyIndices = nullptr;
8367     if (from->pQueueFamilyIndices) {
8368         to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
8369             from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
8370     }
8371 }
8372 
deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkImageDrmFormatModifierListCreateInfoEXT * from,VkImageDrmFormatModifierListCreateInfoEXT * to)8373 void deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(
8374     Allocator* alloc, VkStructureType rootType,
8375     const VkImageDrmFormatModifierListCreateInfoEXT* from,
8376     VkImageDrmFormatModifierListCreateInfoEXT* to) {
8377     (void)alloc;
8378     (void)rootType;
8379     *to = *from;
8380     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8381         rootType = from->sType;
8382     }
8383     const void* from_pNext = from;
8384     size_t pNext_size = 0u;
8385     while (!pNext_size && from_pNext) {
8386         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8387         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8388     }
8389     to->pNext = nullptr;
8390     if (pNext_size) {
8391         to->pNext = (void*)alloc->alloc(pNext_size);
8392         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8393     }
8394     to->pDrmFormatModifiers = nullptr;
8395     if (from->pDrmFormatModifiers) {
8396         to->pDrmFormatModifiers = (uint64_t*)alloc->dupArray(
8397             from->pDrmFormatModifiers, from->drmFormatModifierCount * sizeof(const uint64_t));
8398     }
8399 }
8400 
deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkImageDrmFormatModifierExplicitCreateInfoEXT * from,VkImageDrmFormatModifierExplicitCreateInfoEXT * to)8401 void deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(
8402     Allocator* alloc, VkStructureType rootType,
8403     const VkImageDrmFormatModifierExplicitCreateInfoEXT* from,
8404     VkImageDrmFormatModifierExplicitCreateInfoEXT* to) {
8405     (void)alloc;
8406     (void)rootType;
8407     *to = *from;
8408     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8409         rootType = from->sType;
8410     }
8411     const void* from_pNext = from;
8412     size_t pNext_size = 0u;
8413     while (!pNext_size && from_pNext) {
8414         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8415         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8416     }
8417     to->pNext = nullptr;
8418     if (pNext_size) {
8419         to->pNext = (void*)alloc->alloc(pNext_size);
8420         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8421     }
8422     if (from) {
8423         to->pPlaneLayouts = nullptr;
8424         if (from->pPlaneLayouts) {
8425             to->pPlaneLayouts = (VkSubresourceLayout*)alloc->alloc(
8426                 from->drmFormatModifierPlaneCount * sizeof(const VkSubresourceLayout));
8427             to->drmFormatModifierPlaneCount = from->drmFormatModifierPlaneCount;
8428             for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierPlaneCount; ++i) {
8429                 deepcopy_VkSubresourceLayout(alloc, rootType, from->pPlaneLayouts + i,
8430                                              (VkSubresourceLayout*)(to->pPlaneLayouts + i));
8431             }
8432         }
8433     }
8434 }
8435 
deepcopy_VkImageDrmFormatModifierPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkImageDrmFormatModifierPropertiesEXT * from,VkImageDrmFormatModifierPropertiesEXT * to)8436 void deepcopy_VkImageDrmFormatModifierPropertiesEXT(
8437     Allocator* alloc, VkStructureType rootType, const VkImageDrmFormatModifierPropertiesEXT* from,
8438     VkImageDrmFormatModifierPropertiesEXT* to) {
8439     (void)alloc;
8440     (void)rootType;
8441     *to = *from;
8442     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8443         rootType = from->sType;
8444     }
8445     const void* from_pNext = from;
8446     size_t pNext_size = 0u;
8447     while (!pNext_size && from_pNext) {
8448         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8449         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8450     }
8451     to->pNext = nullptr;
8452     if (pNext_size) {
8453         to->pNext = (void*)alloc->alloc(pNext_size);
8454         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8455     }
8456 }
8457 
deepcopy_VkDrmFormatModifierProperties2EXT(Allocator * alloc,VkStructureType rootType,const VkDrmFormatModifierProperties2EXT * from,VkDrmFormatModifierProperties2EXT * to)8458 void deepcopy_VkDrmFormatModifierProperties2EXT(Allocator* alloc, VkStructureType rootType,
8459                                                 const VkDrmFormatModifierProperties2EXT* from,
8460                                                 VkDrmFormatModifierProperties2EXT* to) {
8461     (void)alloc;
8462     (void)rootType;
8463     *to = *from;
8464 }
8465 
deepcopy_VkDrmFormatModifierPropertiesList2EXT(Allocator * alloc,VkStructureType rootType,const VkDrmFormatModifierPropertiesList2EXT * from,VkDrmFormatModifierPropertiesList2EXT * to)8466 void deepcopy_VkDrmFormatModifierPropertiesList2EXT(
8467     Allocator* alloc, VkStructureType rootType, const VkDrmFormatModifierPropertiesList2EXT* from,
8468     VkDrmFormatModifierPropertiesList2EXT* to) {
8469     (void)alloc;
8470     (void)rootType;
8471     *to = *from;
8472     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8473         rootType = from->sType;
8474     }
8475     const void* from_pNext = from;
8476     size_t pNext_size = 0u;
8477     while (!pNext_size && from_pNext) {
8478         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8479         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8480     }
8481     to->pNext = nullptr;
8482     if (pNext_size) {
8483         to->pNext = (void*)alloc->alloc(pNext_size);
8484         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8485     }
8486     if (from) {
8487         to->pDrmFormatModifierProperties = nullptr;
8488         if (from->pDrmFormatModifierProperties) {
8489             to->pDrmFormatModifierProperties = (VkDrmFormatModifierProperties2EXT*)alloc->alloc(
8490                 from->drmFormatModifierCount * sizeof(VkDrmFormatModifierProperties2EXT));
8491             to->drmFormatModifierCount = from->drmFormatModifierCount;
8492             for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierCount; ++i) {
8493                 deepcopy_VkDrmFormatModifierProperties2EXT(
8494                     alloc, rootType, from->pDrmFormatModifierProperties + i,
8495                     (VkDrmFormatModifierProperties2EXT*)(to->pDrmFormatModifierProperties + i));
8496             }
8497         }
8498     }
8499 }
8500 
8501 #endif
8502 #ifdef VK_EXT_vertex_attribute_divisor
deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT * from,VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT * to)8503 void deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
8504     Allocator* alloc, VkStructureType rootType,
8505     const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* from,
8506     VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* to) {
8507     (void)alloc;
8508     (void)rootType;
8509     *to = *from;
8510     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8511         rootType = from->sType;
8512     }
8513     const void* from_pNext = from;
8514     size_t pNext_size = 0u;
8515     while (!pNext_size && from_pNext) {
8516         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8517         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8518     }
8519     to->pNext = nullptr;
8520     if (pNext_size) {
8521         to->pNext = (void*)alloc->alloc(pNext_size);
8522         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8523     }
8524 }
8525 
8526 #endif
8527 #ifdef VK_EXT_fragment_density_map
deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceFragmentDensityMapFeaturesEXT * from,VkPhysicalDeviceFragmentDensityMapFeaturesEXT * to)8528 void deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
8529     Allocator* alloc, VkStructureType rootType,
8530     const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* from,
8531     VkPhysicalDeviceFragmentDensityMapFeaturesEXT* to) {
8532     (void)alloc;
8533     (void)rootType;
8534     *to = *from;
8535     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8536         rootType = from->sType;
8537     }
8538     const void* from_pNext = from;
8539     size_t pNext_size = 0u;
8540     while (!pNext_size && from_pNext) {
8541         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8542         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8543     }
8544     to->pNext = nullptr;
8545     if (pNext_size) {
8546         to->pNext = (void*)alloc->alloc(pNext_size);
8547         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8548     }
8549 }
8550 
deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceFragmentDensityMapPropertiesEXT * from,VkPhysicalDeviceFragmentDensityMapPropertiesEXT * to)8551 void deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
8552     Allocator* alloc, VkStructureType rootType,
8553     const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* from,
8554     VkPhysicalDeviceFragmentDensityMapPropertiesEXT* to) {
8555     (void)alloc;
8556     (void)rootType;
8557     *to = *from;
8558     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8559         rootType = from->sType;
8560     }
8561     const void* from_pNext = from;
8562     size_t pNext_size = 0u;
8563     while (!pNext_size && from_pNext) {
8564         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8565         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8566     }
8567     to->pNext = nullptr;
8568     if (pNext_size) {
8569         to->pNext = (void*)alloc->alloc(pNext_size);
8570         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8571     }
8572     deepcopy_VkExtent2D(alloc, rootType, &from->minFragmentDensityTexelSize,
8573                         (VkExtent2D*)(&to->minFragmentDensityTexelSize));
8574     deepcopy_VkExtent2D(alloc, rootType, &from->maxFragmentDensityTexelSize,
8575                         (VkExtent2D*)(&to->maxFragmentDensityTexelSize));
8576 }
8577 
deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkRenderPassFragmentDensityMapCreateInfoEXT * from,VkRenderPassFragmentDensityMapCreateInfoEXT * to)8578 void deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
8579     Allocator* alloc, VkStructureType rootType,
8580     const VkRenderPassFragmentDensityMapCreateInfoEXT* from,
8581     VkRenderPassFragmentDensityMapCreateInfoEXT* to) {
8582     (void)alloc;
8583     (void)rootType;
8584     *to = *from;
8585     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8586         rootType = from->sType;
8587     }
8588     const void* from_pNext = from;
8589     size_t pNext_size = 0u;
8590     while (!pNext_size && from_pNext) {
8591         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8592         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8593     }
8594     to->pNext = nullptr;
8595     if (pNext_size) {
8596         to->pNext = (void*)alloc->alloc(pNext_size);
8597         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8598     }
8599     deepcopy_VkAttachmentReference(alloc, rootType, &from->fragmentDensityMapAttachment,
8600                                    (VkAttachmentReference*)(&to->fragmentDensityMapAttachment));
8601 }
8602 
deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(Allocator * alloc,VkStructureType rootType,const VkRenderingFragmentDensityMapAttachmentInfoEXT * from,VkRenderingFragmentDensityMapAttachmentInfoEXT * to)8603 void deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(
8604     Allocator* alloc, VkStructureType rootType,
8605     const VkRenderingFragmentDensityMapAttachmentInfoEXT* from,
8606     VkRenderingFragmentDensityMapAttachmentInfoEXT* to) {
8607     (void)alloc;
8608     (void)rootType;
8609     *to = *from;
8610     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8611         rootType = from->sType;
8612     }
8613     const void* from_pNext = from;
8614     size_t pNext_size = 0u;
8615     while (!pNext_size && from_pNext) {
8616         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8617         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8618     }
8619     to->pNext = nullptr;
8620     if (pNext_size) {
8621         to->pNext = (void*)alloc->alloc(pNext_size);
8622         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8623     }
8624 }
8625 
8626 #endif
8627 #ifdef VK_EXT_provoking_vertex
deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProvokingVertexFeaturesEXT * from,VkPhysicalDeviceProvokingVertexFeaturesEXT * to)8628 void deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(
8629     Allocator* alloc, VkStructureType rootType,
8630     const VkPhysicalDeviceProvokingVertexFeaturesEXT* from,
8631     VkPhysicalDeviceProvokingVertexFeaturesEXT* to) {
8632     (void)alloc;
8633     (void)rootType;
8634     *to = *from;
8635     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8636         rootType = from->sType;
8637     }
8638     const void* from_pNext = from;
8639     size_t pNext_size = 0u;
8640     while (!pNext_size && from_pNext) {
8641         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8642         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8643     }
8644     to->pNext = nullptr;
8645     if (pNext_size) {
8646         to->pNext = (void*)alloc->alloc(pNext_size);
8647         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8648     }
8649 }
8650 
deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceProvokingVertexPropertiesEXT * from,VkPhysicalDeviceProvokingVertexPropertiesEXT * to)8651 void deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(
8652     Allocator* alloc, VkStructureType rootType,
8653     const VkPhysicalDeviceProvokingVertexPropertiesEXT* from,
8654     VkPhysicalDeviceProvokingVertexPropertiesEXT* to) {
8655     (void)alloc;
8656     (void)rootType;
8657     *to = *from;
8658     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8659         rootType = from->sType;
8660     }
8661     const void* from_pNext = from;
8662     size_t pNext_size = 0u;
8663     while (!pNext_size && from_pNext) {
8664         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8665         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8666     }
8667     to->pNext = nullptr;
8668     if (pNext_size) {
8669         to->pNext = (void*)alloc->alloc(pNext_size);
8670         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8671     }
8672 }
8673 
deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT * from,VkPipelineRasterizationProvokingVertexStateCreateInfoEXT * to)8674 void deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
8675     Allocator* alloc, VkStructureType rootType,
8676     const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* from,
8677     VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* to) {
8678     (void)alloc;
8679     (void)rootType;
8680     *to = *from;
8681     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8682         rootType = from->sType;
8683     }
8684     const void* from_pNext = from;
8685     size_t pNext_size = 0u;
8686     while (!pNext_size && from_pNext) {
8687         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8688         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8689     }
8690     to->pNext = nullptr;
8691     if (pNext_size) {
8692         to->pNext = (void*)alloc->alloc(pNext_size);
8693         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8694     }
8695 }
8696 
8697 #endif
8698 #ifdef VK_EXT_extended_dynamic_state
deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT * from,VkPhysicalDeviceExtendedDynamicStateFeaturesEXT * to)8699 void deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
8700     Allocator* alloc, VkStructureType rootType,
8701     const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* from,
8702     VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* to) {
8703     (void)alloc;
8704     (void)rootType;
8705     *to = *from;
8706     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8707         rootType = from->sType;
8708     }
8709     const void* from_pNext = from;
8710     size_t pNext_size = 0u;
8711     while (!pNext_size && from_pNext) {
8712         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8713         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8714     }
8715     to->pNext = nullptr;
8716     if (pNext_size) {
8717         to->pNext = (void*)alloc->alloc(pNext_size);
8718         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8719     }
8720 }
8721 
8722 #endif
8723 #ifdef VK_EXT_texel_buffer_alignment
deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT * from,VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT * to)8724 void deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
8725     Allocator* alloc, VkStructureType rootType,
8726     const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* from,
8727     VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* to) {
8728     (void)alloc;
8729     (void)rootType;
8730     *to = *from;
8731     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8732         rootType = from->sType;
8733     }
8734     const void* from_pNext = from;
8735     size_t pNext_size = 0u;
8736     while (!pNext_size && from_pNext) {
8737         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8738         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8739     }
8740     to->pNext = nullptr;
8741     if (pNext_size) {
8742         to->pNext = (void*)alloc->alloc(pNext_size);
8743         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8744     }
8745 }
8746 
8747 #endif
8748 #ifdef VK_EXT_device_memory_report
deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT * from,VkPhysicalDeviceDeviceMemoryReportFeaturesEXT * to)8749 void deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
8750     Allocator* alloc, VkStructureType rootType,
8751     const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* from,
8752     VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* to) {
8753     (void)alloc;
8754     (void)rootType;
8755     *to = *from;
8756     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8757         rootType = from->sType;
8758     }
8759     const void* from_pNext = from;
8760     size_t pNext_size = 0u;
8761     while (!pNext_size && from_pNext) {
8762         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8763         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8764     }
8765     to->pNext = nullptr;
8766     if (pNext_size) {
8767         to->pNext = (void*)alloc->alloc(pNext_size);
8768         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8769     }
8770 }
8771 
deepcopy_VkDeviceMemoryReportCallbackDataEXT(Allocator * alloc,VkStructureType rootType,const VkDeviceMemoryReportCallbackDataEXT * from,VkDeviceMemoryReportCallbackDataEXT * to)8772 void deepcopy_VkDeviceMemoryReportCallbackDataEXT(Allocator* alloc, VkStructureType rootType,
8773                                                   const VkDeviceMemoryReportCallbackDataEXT* from,
8774                                                   VkDeviceMemoryReportCallbackDataEXT* to) {
8775     (void)alloc;
8776     (void)rootType;
8777     *to = *from;
8778     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8779         rootType = from->sType;
8780     }
8781     const void* from_pNext = from;
8782     size_t pNext_size = 0u;
8783     while (!pNext_size && from_pNext) {
8784         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8785         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8786     }
8787     to->pNext = nullptr;
8788     if (pNext_size) {
8789         to->pNext = (void*)alloc->alloc(pNext_size);
8790         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8791     }
8792 }
8793 
deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkDeviceDeviceMemoryReportCreateInfoEXT * from,VkDeviceDeviceMemoryReportCreateInfoEXT * to)8794 void deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(
8795     Allocator* alloc, VkStructureType rootType, const VkDeviceDeviceMemoryReportCreateInfoEXT* from,
8796     VkDeviceDeviceMemoryReportCreateInfoEXT* to) {
8797     (void)alloc;
8798     (void)rootType;
8799     *to = *from;
8800     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8801         rootType = from->sType;
8802     }
8803     const void* from_pNext = from;
8804     size_t pNext_size = 0u;
8805     while (!pNext_size && from_pNext) {
8806         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8807         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8808     }
8809     to->pNext = nullptr;
8810     if (pNext_size) {
8811         to->pNext = (void*)alloc->alloc(pNext_size);
8812         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8813     }
8814     to->pUserData = nullptr;
8815     if (from->pUserData) {
8816         to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
8817     }
8818 }
8819 
8820 #endif
8821 #ifdef VK_EXT_robustness2
deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceRobustness2FeaturesEXT * from,VkPhysicalDeviceRobustness2FeaturesEXT * to)8822 void deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(
8823     Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceRobustness2FeaturesEXT* from,
8824     VkPhysicalDeviceRobustness2FeaturesEXT* to) {
8825     (void)alloc;
8826     (void)rootType;
8827     *to = *from;
8828     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8829         rootType = from->sType;
8830     }
8831     const void* from_pNext = from;
8832     size_t pNext_size = 0u;
8833     while (!pNext_size && from_pNext) {
8834         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8835         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8836     }
8837     to->pNext = nullptr;
8838     if (pNext_size) {
8839         to->pNext = (void*)alloc->alloc(pNext_size);
8840         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8841     }
8842 }
8843 
deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceRobustness2PropertiesEXT * from,VkPhysicalDeviceRobustness2PropertiesEXT * to)8844 void deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(
8845     Allocator* alloc, VkStructureType rootType,
8846     const VkPhysicalDeviceRobustness2PropertiesEXT* from,
8847     VkPhysicalDeviceRobustness2PropertiesEXT* to) {
8848     (void)alloc;
8849     (void)rootType;
8850     *to = *from;
8851     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8852         rootType = from->sType;
8853     }
8854     const void* from_pNext = from;
8855     size_t pNext_size = 0u;
8856     while (!pNext_size && from_pNext) {
8857         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8858         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8859     }
8860     to->pNext = nullptr;
8861     if (pNext_size) {
8862         to->pNext = (void*)alloc->alloc(pNext_size);
8863         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8864     }
8865 }
8866 
8867 #endif
8868 #ifdef VK_EXT_custom_border_color
deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkSamplerCustomBorderColorCreateInfoEXT * from,VkSamplerCustomBorderColorCreateInfoEXT * to)8869 void deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(
8870     Allocator* alloc, VkStructureType rootType, const VkSamplerCustomBorderColorCreateInfoEXT* from,
8871     VkSamplerCustomBorderColorCreateInfoEXT* to) {
8872     (void)alloc;
8873     (void)rootType;
8874     *to = *from;
8875     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8876         rootType = from->sType;
8877     }
8878     const void* from_pNext = from;
8879     size_t pNext_size = 0u;
8880     while (!pNext_size && from_pNext) {
8881         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8882         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8883     }
8884     to->pNext = nullptr;
8885     if (pNext_size) {
8886         to->pNext = (void*)alloc->alloc(pNext_size);
8887         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8888     }
8889     deepcopy_VkClearColorValue(alloc, rootType, &from->customBorderColor,
8890                                (VkClearColorValue*)(&to->customBorderColor));
8891 }
8892 
deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceCustomBorderColorPropertiesEXT * from,VkPhysicalDeviceCustomBorderColorPropertiesEXT * to)8893 void deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
8894     Allocator* alloc, VkStructureType rootType,
8895     const VkPhysicalDeviceCustomBorderColorPropertiesEXT* from,
8896     VkPhysicalDeviceCustomBorderColorPropertiesEXT* to) {
8897     (void)alloc;
8898     (void)rootType;
8899     *to = *from;
8900     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8901         rootType = from->sType;
8902     }
8903     const void* from_pNext = from;
8904     size_t pNext_size = 0u;
8905     while (!pNext_size && from_pNext) {
8906         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8907         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8908     }
8909     to->pNext = nullptr;
8910     if (pNext_size) {
8911         to->pNext = (void*)alloc->alloc(pNext_size);
8912         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8913     }
8914 }
8915 
deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceCustomBorderColorFeaturesEXT * from,VkPhysicalDeviceCustomBorderColorFeaturesEXT * to)8916 void deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
8917     Allocator* alloc, VkStructureType rootType,
8918     const VkPhysicalDeviceCustomBorderColorFeaturesEXT* from,
8919     VkPhysicalDeviceCustomBorderColorFeaturesEXT* to) {
8920     (void)alloc;
8921     (void)rootType;
8922     *to = *from;
8923     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8924         rootType = from->sType;
8925     }
8926     const void* from_pNext = from;
8927     size_t pNext_size = 0u;
8928     while (!pNext_size && from_pNext) {
8929         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8930         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8931     }
8932     to->pNext = nullptr;
8933     if (pNext_size) {
8934         to->pNext = (void*)alloc->alloc(pNext_size);
8935         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8936     }
8937 }
8938 
8939 #endif
8940 #ifdef VK_EXT_graphics_pipeline_library
deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT * from,VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT * to)8941 void deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT(
8942     Allocator* alloc, VkStructureType rootType,
8943     const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT* from,
8944     VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT* to) {
8945     (void)alloc;
8946     (void)rootType;
8947     *to = *from;
8948     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8949         rootType = from->sType;
8950     }
8951     const void* from_pNext = from;
8952     size_t pNext_size = 0u;
8953     while (!pNext_size && from_pNext) {
8954         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8955         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8956     }
8957     to->pNext = nullptr;
8958     if (pNext_size) {
8959         to->pNext = (void*)alloc->alloc(pNext_size);
8960         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8961     }
8962 }
8963 
deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT * from,VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT * to)8964 void deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT(
8965     Allocator* alloc, VkStructureType rootType,
8966     const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT* from,
8967     VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT* to) {
8968     (void)alloc;
8969     (void)rootType;
8970     *to = *from;
8971     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8972         rootType = from->sType;
8973     }
8974     const void* from_pNext = from;
8975     size_t pNext_size = 0u;
8976     while (!pNext_size && from_pNext) {
8977         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
8978         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
8979     }
8980     to->pNext = nullptr;
8981     if (pNext_size) {
8982         to->pNext = (void*)alloc->alloc(pNext_size);
8983         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
8984     }
8985 }
8986 
deepcopy_VkGraphicsPipelineLibraryCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkGraphicsPipelineLibraryCreateInfoEXT * from,VkGraphicsPipelineLibraryCreateInfoEXT * to)8987 void deepcopy_VkGraphicsPipelineLibraryCreateInfoEXT(
8988     Allocator* alloc, VkStructureType rootType, const VkGraphicsPipelineLibraryCreateInfoEXT* from,
8989     VkGraphicsPipelineLibraryCreateInfoEXT* to) {
8990     (void)alloc;
8991     (void)rootType;
8992     *to = *from;
8993     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
8994         rootType = from->sType;
8995     }
8996     const void* from_pNext = from;
8997     size_t pNext_size = 0u;
8998     while (!pNext_size && from_pNext) {
8999         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9000         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9001     }
9002     to->pNext = nullptr;
9003     if (pNext_size) {
9004         to->pNext = (void*)alloc->alloc(pNext_size);
9005         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9006     }
9007 }
9008 
9009 #endif
9010 #ifdef VK_EXT_ycbcr_2plane_444_formats
deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT * from,VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT * to)9011 void deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
9012     Allocator* alloc, VkStructureType rootType,
9013     const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* from,
9014     VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* to) {
9015     (void)alloc;
9016     (void)rootType;
9017     *to = *from;
9018     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9019         rootType = from->sType;
9020     }
9021     const void* from_pNext = from;
9022     size_t pNext_size = 0u;
9023     while (!pNext_size && from_pNext) {
9024         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9025         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9026     }
9027     to->pNext = nullptr;
9028     if (pNext_size) {
9029         to->pNext = (void*)alloc->alloc(pNext_size);
9030         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9031     }
9032 }
9033 
9034 #endif
9035 #ifdef VK_EXT_image_compression_control
deepcopy_VkPhysicalDeviceImageCompressionControlFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImageCompressionControlFeaturesEXT * from,VkPhysicalDeviceImageCompressionControlFeaturesEXT * to)9036 void deepcopy_VkPhysicalDeviceImageCompressionControlFeaturesEXT(
9037     Allocator* alloc, VkStructureType rootType,
9038     const VkPhysicalDeviceImageCompressionControlFeaturesEXT* from,
9039     VkPhysicalDeviceImageCompressionControlFeaturesEXT* to) {
9040     (void)alloc;
9041     (void)rootType;
9042     *to = *from;
9043     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9044         rootType = from->sType;
9045     }
9046     const void* from_pNext = from;
9047     size_t pNext_size = 0u;
9048     while (!pNext_size && from_pNext) {
9049         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9050         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9051     }
9052     to->pNext = nullptr;
9053     if (pNext_size) {
9054         to->pNext = (void*)alloc->alloc(pNext_size);
9055         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9056     }
9057 }
9058 
deepcopy_VkImageCompressionControlEXT(Allocator * alloc,VkStructureType rootType,const VkImageCompressionControlEXT * from,VkImageCompressionControlEXT * to)9059 void deepcopy_VkImageCompressionControlEXT(Allocator* alloc, VkStructureType rootType,
9060                                            const VkImageCompressionControlEXT* from,
9061                                            VkImageCompressionControlEXT* to) {
9062     (void)alloc;
9063     (void)rootType;
9064     *to = *from;
9065     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9066         rootType = from->sType;
9067     }
9068     const void* from_pNext = from;
9069     size_t pNext_size = 0u;
9070     while (!pNext_size && from_pNext) {
9071         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9072         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9073     }
9074     to->pNext = nullptr;
9075     if (pNext_size) {
9076         to->pNext = (void*)alloc->alloc(pNext_size);
9077         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9078     }
9079     to->pFixedRateFlags = nullptr;
9080     if (from->pFixedRateFlags) {
9081         to->pFixedRateFlags = (VkImageCompressionFixedRateFlagsEXT*)alloc->dupArray(
9082             from->pFixedRateFlags,
9083             from->compressionControlPlaneCount * sizeof(VkImageCompressionFixedRateFlagsEXT));
9084     }
9085 }
9086 
deepcopy_VkImageCompressionPropertiesEXT(Allocator * alloc,VkStructureType rootType,const VkImageCompressionPropertiesEXT * from,VkImageCompressionPropertiesEXT * to)9087 void deepcopy_VkImageCompressionPropertiesEXT(Allocator* alloc, VkStructureType rootType,
9088                                               const VkImageCompressionPropertiesEXT* from,
9089                                               VkImageCompressionPropertiesEXT* to) {
9090     (void)alloc;
9091     (void)rootType;
9092     *to = *from;
9093     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9094         rootType = from->sType;
9095     }
9096     const void* from_pNext = from;
9097     size_t pNext_size = 0u;
9098     while (!pNext_size && from_pNext) {
9099         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9100         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9101     }
9102     to->pNext = nullptr;
9103     if (pNext_size) {
9104         to->pNext = (void*)alloc->alloc(pNext_size);
9105         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9106     }
9107 }
9108 
9109 #endif
9110 #ifdef VK_EXT_4444_formats
deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevice4444FormatsFeaturesEXT * from,VkPhysicalDevice4444FormatsFeaturesEXT * to)9111 void deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(
9112     Allocator* alloc, VkStructureType rootType, const VkPhysicalDevice4444FormatsFeaturesEXT* from,
9113     VkPhysicalDevice4444FormatsFeaturesEXT* to) {
9114     (void)alloc;
9115     (void)rootType;
9116     *to = *from;
9117     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9118         rootType = from->sType;
9119     }
9120     const void* from_pNext = from;
9121     size_t pNext_size = 0u;
9122     while (!pNext_size && from_pNext) {
9123         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9124         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9125     }
9126     to->pNext = nullptr;
9127     if (pNext_size) {
9128         to->pNext = (void*)alloc->alloc(pNext_size);
9129         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9130     }
9131 }
9132 
9133 #endif
9134 #ifdef VK_EXT_primitive_topology_list_restart
deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT * from,VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT * to)9135 void deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
9136     Allocator* alloc, VkStructureType rootType,
9137     const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* from,
9138     VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* to) {
9139     (void)alloc;
9140     (void)rootType;
9141     *to = *from;
9142     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9143         rootType = from->sType;
9144     }
9145     const void* from_pNext = from;
9146     size_t pNext_size = 0u;
9147     while (!pNext_size && from_pNext) {
9148         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9149         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9150     }
9151     to->pNext = nullptr;
9152     if (pNext_size) {
9153         to->pNext = (void*)alloc->alloc(pNext_size);
9154         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9155     }
9156 }
9157 
9158 #endif
9159 #ifdef VK_EXT_extended_dynamic_state2
deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT * from,VkPhysicalDeviceExtendedDynamicState2FeaturesEXT * to)9160 void deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
9161     Allocator* alloc, VkStructureType rootType,
9162     const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* from,
9163     VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* to) {
9164     (void)alloc;
9165     (void)rootType;
9166     *to = *from;
9167     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9168         rootType = from->sType;
9169     }
9170     const void* from_pNext = from;
9171     size_t pNext_size = 0u;
9172     while (!pNext_size && from_pNext) {
9173         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9174         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9175     }
9176     to->pNext = nullptr;
9177     if (pNext_size) {
9178         to->pNext = (void*)alloc->alloc(pNext_size);
9179         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9180     }
9181 }
9182 
9183 #endif
9184 #ifdef VK_EXT_color_write_enable
deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceColorWriteEnableFeaturesEXT * from,VkPhysicalDeviceColorWriteEnableFeaturesEXT * to)9185 void deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
9186     Allocator* alloc, VkStructureType rootType,
9187     const VkPhysicalDeviceColorWriteEnableFeaturesEXT* from,
9188     VkPhysicalDeviceColorWriteEnableFeaturesEXT* to) {
9189     (void)alloc;
9190     (void)rootType;
9191     *to = *from;
9192     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9193         rootType = from->sType;
9194     }
9195     const void* from_pNext = from;
9196     size_t pNext_size = 0u;
9197     while (!pNext_size && from_pNext) {
9198         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9199         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9200     }
9201     to->pNext = nullptr;
9202     if (pNext_size) {
9203         to->pNext = (void*)alloc->alloc(pNext_size);
9204         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9205     }
9206 }
9207 
deepcopy_VkPipelineColorWriteCreateInfoEXT(Allocator * alloc,VkStructureType rootType,const VkPipelineColorWriteCreateInfoEXT * from,VkPipelineColorWriteCreateInfoEXT * to)9208 void deepcopy_VkPipelineColorWriteCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
9209                                                 const VkPipelineColorWriteCreateInfoEXT* from,
9210                                                 VkPipelineColorWriteCreateInfoEXT* to) {
9211     (void)alloc;
9212     (void)rootType;
9213     *to = *from;
9214     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9215         rootType = from->sType;
9216     }
9217     const void* from_pNext = from;
9218     size_t pNext_size = 0u;
9219     while (!pNext_size && from_pNext) {
9220         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9221         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9222     }
9223     to->pNext = nullptr;
9224     if (pNext_size) {
9225         to->pNext = (void*)alloc->alloc(pNext_size);
9226         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9227     }
9228     to->pColorWriteEnables = nullptr;
9229     if (from->pColorWriteEnables) {
9230         to->pColorWriteEnables = (VkBool32*)alloc->dupArray(
9231             from->pColorWriteEnables, from->attachmentCount * sizeof(const VkBool32));
9232     }
9233 }
9234 
9235 #endif
9236 #ifdef VK_GOOGLE_gfxstream
deepcopy_VkImportColorBufferGOOGLE(Allocator * alloc,VkStructureType rootType,const VkImportColorBufferGOOGLE * from,VkImportColorBufferGOOGLE * to)9237 void deepcopy_VkImportColorBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
9238                                         const VkImportColorBufferGOOGLE* from,
9239                                         VkImportColorBufferGOOGLE* to) {
9240     (void)alloc;
9241     (void)rootType;
9242     *to = *from;
9243     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9244         rootType = from->sType;
9245     }
9246     const void* from_pNext = from;
9247     size_t pNext_size = 0u;
9248     while (!pNext_size && from_pNext) {
9249         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9250         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9251     }
9252     to->pNext = nullptr;
9253     if (pNext_size) {
9254         to->pNext = (void*)alloc->alloc(pNext_size);
9255         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9256     }
9257 }
9258 
deepcopy_VkImportBufferGOOGLE(Allocator * alloc,VkStructureType rootType,const VkImportBufferGOOGLE * from,VkImportBufferGOOGLE * to)9259 void deepcopy_VkImportBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
9260                                    const VkImportBufferGOOGLE* from, VkImportBufferGOOGLE* to) {
9261     (void)alloc;
9262     (void)rootType;
9263     *to = *from;
9264     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9265         rootType = from->sType;
9266     }
9267     const void* from_pNext = from;
9268     size_t pNext_size = 0u;
9269     while (!pNext_size && from_pNext) {
9270         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9271         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9272     }
9273     to->pNext = nullptr;
9274     if (pNext_size) {
9275         to->pNext = (void*)alloc->alloc(pNext_size);
9276         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9277     }
9278 }
9279 
deepcopy_VkCreateBlobGOOGLE(Allocator * alloc,VkStructureType rootType,const VkCreateBlobGOOGLE * from,VkCreateBlobGOOGLE * to)9280 void deepcopy_VkCreateBlobGOOGLE(Allocator* alloc, VkStructureType rootType,
9281                                  const VkCreateBlobGOOGLE* from, VkCreateBlobGOOGLE* to) {
9282     (void)alloc;
9283     (void)rootType;
9284     *to = *from;
9285     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9286         rootType = from->sType;
9287     }
9288     const void* from_pNext = from;
9289     size_t pNext_size = 0u;
9290     while (!pNext_size && from_pNext) {
9291         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9292         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9293     }
9294     to->pNext = nullptr;
9295     if (pNext_size) {
9296         to->pNext = (void*)alloc->alloc(pNext_size);
9297         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9298     }
9299 }
9300 
9301 #endif
9302 #ifdef VK_EXT_image_compression_control_swapchain
deepcopy_VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT(Allocator * alloc,VkStructureType rootType,const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT * from,VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT * to)9303 void deepcopy_VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT(
9304     Allocator* alloc, VkStructureType rootType,
9305     const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT* from,
9306     VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT* to) {
9307     (void)alloc;
9308     (void)rootType;
9309     *to = *from;
9310     if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
9311         rootType = from->sType;
9312     }
9313     const void* from_pNext = from;
9314     size_t pNext_size = 0u;
9315     while (!pNext_size && from_pNext) {
9316         from_pNext = static_cast<const VkBaseOutStructure*>(from_pNext)->pNext;
9317         pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
9318     }
9319     to->pNext = nullptr;
9320     if (pNext_size) {
9321         to->pNext = (void*)alloc->alloc(pNext_size);
9322         deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
9323     }
9324 }
9325 
9326 #endif
deepcopy_extension_struct(Allocator * alloc,VkStructureType rootType,const void * structExtension,void * structExtension_out)9327 void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
9328                                const void* structExtension, void* structExtension_out) {
9329     if (!structExtension) {
9330         return;
9331     }
9332     uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
9333     switch (structType) {
9334 #ifdef VK_VERSION_1_0
9335         case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: {
9336             deepcopy_VkShaderModuleCreateInfo(
9337                 alloc, rootType, reinterpret_cast<const VkShaderModuleCreateInfo*>(structExtension),
9338                 reinterpret_cast<VkShaderModuleCreateInfo*>(structExtension_out));
9339             break;
9340         }
9341         case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: {
9342             deepcopy_VkPipelineLayoutCreateInfo(
9343                 alloc, rootType,
9344                 reinterpret_cast<const VkPipelineLayoutCreateInfo*>(structExtension),
9345                 reinterpret_cast<VkPipelineLayoutCreateInfo*>(structExtension_out));
9346             break;
9347         }
9348 #endif
9349 #ifdef VK_VERSION_1_1
9350         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
9351             deepcopy_VkPhysicalDeviceSubgroupProperties(
9352                 alloc, rootType,
9353                 reinterpret_cast<const VkPhysicalDeviceSubgroupProperties*>(structExtension),
9354                 reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
9355             break;
9356         }
9357         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
9358             deepcopy_VkPhysicalDevice16BitStorageFeatures(
9359                 alloc, rootType,
9360                 reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(structExtension),
9361                 reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
9362             break;
9363         }
9364         case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
9365             deepcopy_VkMemoryDedicatedRequirements(
9366                 alloc, rootType,
9367                 reinterpret_cast<const VkMemoryDedicatedRequirements*>(structExtension),
9368                 reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
9369             break;
9370         }
9371         case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
9372             deepcopy_VkMemoryDedicatedAllocateInfo(
9373                 alloc, rootType,
9374                 reinterpret_cast<const VkMemoryDedicatedAllocateInfo*>(structExtension),
9375                 reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
9376             break;
9377         }
9378         case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
9379             deepcopy_VkMemoryAllocateFlagsInfo(
9380                 alloc, rootType,
9381                 reinterpret_cast<const VkMemoryAllocateFlagsInfo*>(structExtension),
9382                 reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
9383             break;
9384         }
9385         case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
9386             deepcopy_VkDeviceGroupRenderPassBeginInfo(
9387                 alloc, rootType,
9388                 reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo*>(structExtension),
9389                 reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
9390             break;
9391         }
9392         case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
9393             deepcopy_VkDeviceGroupCommandBufferBeginInfo(
9394                 alloc, rootType,
9395                 reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo*>(structExtension),
9396                 reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
9397             break;
9398         }
9399         case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
9400             deepcopy_VkDeviceGroupSubmitInfo(
9401                 alloc, rootType, reinterpret_cast<const VkDeviceGroupSubmitInfo*>(structExtension),
9402                 reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
9403             break;
9404         }
9405         case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
9406             deepcopy_VkDeviceGroupBindSparseInfo(
9407                 alloc, rootType,
9408                 reinterpret_cast<const VkDeviceGroupBindSparseInfo*>(structExtension),
9409                 reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
9410             break;
9411         }
9412         case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
9413             deepcopy_VkBindBufferMemoryDeviceGroupInfo(
9414                 alloc, rootType,
9415                 reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo*>(structExtension),
9416                 reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
9417             break;
9418         }
9419         case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
9420             deepcopy_VkBindImageMemoryDeviceGroupInfo(
9421                 alloc, rootType,
9422                 reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo*>(structExtension),
9423                 reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
9424             break;
9425         }
9426         case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
9427             deepcopy_VkDeviceGroupDeviceCreateInfo(
9428                 alloc, rootType,
9429                 reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(structExtension),
9430                 reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
9431             break;
9432         }
9433         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
9434             deepcopy_VkPhysicalDeviceFeatures2(
9435                 alloc, rootType,
9436                 reinterpret_cast<const VkPhysicalDeviceFeatures2*>(structExtension),
9437                 reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
9438             break;
9439         }
9440         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
9441             deepcopy_VkPhysicalDevicePointClippingProperties(
9442                 alloc, rootType,
9443                 reinterpret_cast<const VkPhysicalDevicePointClippingProperties*>(structExtension),
9444                 reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
9445             break;
9446         }
9447         case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
9448             deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(
9449                 alloc, rootType,
9450                 reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(
9451                     structExtension),
9452                 reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
9453                     structExtension_out));
9454             break;
9455         }
9456         case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
9457             deepcopy_VkImageViewUsageCreateInfo(
9458                 alloc, rootType,
9459                 reinterpret_cast<const VkImageViewUsageCreateInfo*>(structExtension),
9460                 reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
9461             break;
9462         }
9463         case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
9464             deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(
9465                 alloc, rootType,
9466                 reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo*>(
9467                     structExtension),
9468                 reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
9469                     structExtension_out));
9470             break;
9471         }
9472         case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
9473             deepcopy_VkRenderPassMultiviewCreateInfo(
9474                 alloc, rootType,
9475                 reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(structExtension),
9476                 reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
9477             break;
9478         }
9479         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
9480             deepcopy_VkPhysicalDeviceMultiviewFeatures(
9481                 alloc, rootType,
9482                 reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(structExtension),
9483                 reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
9484             break;
9485         }
9486         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
9487             deepcopy_VkPhysicalDeviceMultiviewProperties(
9488                 alloc, rootType,
9489                 reinterpret_cast<const VkPhysicalDeviceMultiviewProperties*>(structExtension),
9490                 reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
9491             break;
9492         }
9493         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
9494             deepcopy_VkPhysicalDeviceVariablePointersFeatures(
9495                 alloc, rootType,
9496                 reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(structExtension),
9497                 reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
9498             break;
9499         }
9500         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
9501             deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(
9502                 alloc, rootType,
9503                 reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension),
9504                 reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
9505             break;
9506         }
9507         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
9508             deepcopy_VkPhysicalDeviceProtectedMemoryProperties(
9509                 alloc, rootType,
9510                 reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties*>(structExtension),
9511                 reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
9512             break;
9513         }
9514         case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
9515             deepcopy_VkProtectedSubmitInfo(
9516                 alloc, rootType, reinterpret_cast<const VkProtectedSubmitInfo*>(structExtension),
9517                 reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
9518             break;
9519         }
9520         case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
9521             deepcopy_VkSamplerYcbcrConversionInfo(
9522                 alloc, rootType,
9523                 reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(structExtension),
9524                 reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
9525             break;
9526         }
9527         case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
9528             deepcopy_VkBindImagePlaneMemoryInfo(
9529                 alloc, rootType,
9530                 reinterpret_cast<const VkBindImagePlaneMemoryInfo*>(structExtension),
9531                 reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
9532             break;
9533         }
9534         case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
9535             deepcopy_VkImagePlaneMemoryRequirementsInfo(
9536                 alloc, rootType,
9537                 reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo*>(structExtension),
9538                 reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
9539             break;
9540         }
9541         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
9542             deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
9543                 alloc, rootType,
9544                 reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
9545                     structExtension),
9546                 reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
9547                     structExtension_out));
9548             break;
9549         }
9550         case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
9551             deepcopy_VkSamplerYcbcrConversionImageFormatProperties(
9552                 alloc, rootType,
9553                 reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties*>(
9554                     structExtension),
9555                 reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
9556                     structExtension_out));
9557             break;
9558         }
9559         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
9560             deepcopy_VkPhysicalDeviceExternalImageFormatInfo(
9561                 alloc, rootType,
9562                 reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(structExtension),
9563                 reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
9564             break;
9565         }
9566         case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
9567             deepcopy_VkExternalImageFormatProperties(
9568                 alloc, rootType,
9569                 reinterpret_cast<const VkExternalImageFormatProperties*>(structExtension),
9570                 reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
9571             break;
9572         }
9573         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
9574             deepcopy_VkPhysicalDeviceIDProperties(
9575                 alloc, rootType,
9576                 reinterpret_cast<const VkPhysicalDeviceIDProperties*>(structExtension),
9577                 reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
9578             break;
9579         }
9580         case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
9581             deepcopy_VkExternalMemoryImageCreateInfo(
9582                 alloc, rootType,
9583                 reinterpret_cast<const VkExternalMemoryImageCreateInfo*>(structExtension),
9584                 reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
9585             break;
9586         }
9587         case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
9588             deepcopy_VkExternalMemoryBufferCreateInfo(
9589                 alloc, rootType,
9590                 reinterpret_cast<const VkExternalMemoryBufferCreateInfo*>(structExtension),
9591                 reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
9592             break;
9593         }
9594         case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
9595             deepcopy_VkExportMemoryAllocateInfo(
9596                 alloc, rootType,
9597                 reinterpret_cast<const VkExportMemoryAllocateInfo*>(structExtension),
9598                 reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
9599             break;
9600         }
9601         case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
9602             deepcopy_VkExportFenceCreateInfo(
9603                 alloc, rootType, reinterpret_cast<const VkExportFenceCreateInfo*>(structExtension),
9604                 reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
9605             break;
9606         }
9607         case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
9608             deepcopy_VkExportSemaphoreCreateInfo(
9609                 alloc, rootType,
9610                 reinterpret_cast<const VkExportSemaphoreCreateInfo*>(structExtension),
9611                 reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
9612             break;
9613         }
9614         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
9615             deepcopy_VkPhysicalDeviceMaintenance3Properties(
9616                 alloc, rootType,
9617                 reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties*>(structExtension),
9618                 reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
9619             break;
9620         }
9621         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
9622             deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(
9623                 alloc, rootType,
9624                 reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(
9625                     structExtension),
9626                 reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
9627                     structExtension_out));
9628             break;
9629         }
9630 #endif
9631 #ifdef VK_VERSION_1_2
9632         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
9633             deepcopy_VkPhysicalDeviceVulkan11Features(
9634                 alloc, rootType,
9635                 reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(structExtension),
9636                 reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
9637             break;
9638         }
9639         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
9640             deepcopy_VkPhysicalDeviceVulkan11Properties(
9641                 alloc, rootType,
9642                 reinterpret_cast<const VkPhysicalDeviceVulkan11Properties*>(structExtension),
9643                 reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
9644             break;
9645         }
9646         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
9647             deepcopy_VkPhysicalDeviceVulkan12Features(
9648                 alloc, rootType,
9649                 reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(structExtension),
9650                 reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
9651             break;
9652         }
9653         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
9654             deepcopy_VkPhysicalDeviceVulkan12Properties(
9655                 alloc, rootType,
9656                 reinterpret_cast<const VkPhysicalDeviceVulkan12Properties*>(structExtension),
9657                 reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
9658             break;
9659         }
9660         case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
9661             deepcopy_VkImageFormatListCreateInfo(
9662                 alloc, rootType,
9663                 reinterpret_cast<const VkImageFormatListCreateInfo*>(structExtension),
9664                 reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
9665             break;
9666         }
9667         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
9668             deepcopy_VkPhysicalDevice8BitStorageFeatures(
9669                 alloc, rootType,
9670                 reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(structExtension),
9671                 reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
9672             break;
9673         }
9674         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
9675             deepcopy_VkPhysicalDeviceDriverProperties(
9676                 alloc, rootType,
9677                 reinterpret_cast<const VkPhysicalDeviceDriverProperties*>(structExtension),
9678                 reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
9679             break;
9680         }
9681         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
9682             deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(
9683                 alloc, rootType,
9684                 reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension),
9685                 reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
9686             break;
9687         }
9688         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
9689             deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(
9690                 alloc, rootType,
9691                 reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension),
9692                 reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
9693             break;
9694         }
9695         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
9696             deepcopy_VkPhysicalDeviceFloatControlsProperties(
9697                 alloc, rootType,
9698                 reinterpret_cast<const VkPhysicalDeviceFloatControlsProperties*>(structExtension),
9699                 reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
9700             break;
9701         }
9702         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
9703             deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(
9704                 alloc, rootType,
9705                 reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
9706                     structExtension),
9707                 reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
9708                     structExtension_out));
9709             break;
9710         }
9711         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
9712             deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(
9713                 alloc, rootType,
9714                 reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(
9715                     structExtension),
9716                 reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
9717             break;
9718         }
9719         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
9720             deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(
9721                 alloc, rootType,
9722                 reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingProperties*>(
9723                     structExtension),
9724                 reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
9725                     structExtension_out));
9726             break;
9727         }
9728         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
9729             deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(
9730                 alloc, rootType,
9731                 reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
9732                     structExtension),
9733                 reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
9734                     structExtension_out));
9735             break;
9736         }
9737         case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
9738             deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(
9739                 alloc, rootType,
9740                 reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
9741                     structExtension),
9742                 reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
9743                     structExtension_out));
9744             break;
9745         }
9746         case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
9747             deepcopy_VkSubpassDescriptionDepthStencilResolve(
9748                 alloc, rootType,
9749                 reinterpret_cast<const VkSubpassDescriptionDepthStencilResolve*>(structExtension),
9750                 reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
9751             break;
9752         }
9753         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
9754             deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(
9755                 alloc, rootType,
9756                 reinterpret_cast<const VkPhysicalDeviceDepthStencilResolveProperties*>(
9757                     structExtension),
9758                 reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
9759                     structExtension_out));
9760             break;
9761         }
9762         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
9763             deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(
9764                 alloc, rootType,
9765                 reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension),
9766                 reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
9767             break;
9768         }
9769         case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
9770             deepcopy_VkImageStencilUsageCreateInfo(
9771                 alloc, rootType,
9772                 reinterpret_cast<const VkImageStencilUsageCreateInfo*>(structExtension),
9773                 reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
9774             break;
9775         }
9776         case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
9777             deepcopy_VkSamplerReductionModeCreateInfo(
9778                 alloc, rootType,
9779                 reinterpret_cast<const VkSamplerReductionModeCreateInfo*>(structExtension),
9780                 reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
9781             break;
9782         }
9783         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
9784             deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(
9785                 alloc, rootType,
9786                 reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
9787                     structExtension),
9788                 reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
9789                     structExtension_out));
9790             break;
9791         }
9792         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
9793             deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(
9794                 alloc, rootType,
9795                 reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension),
9796                 reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
9797             break;
9798         }
9799         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
9800             deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(
9801                 alloc, rootType,
9802                 reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(
9803                     structExtension),
9804                 reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
9805                     structExtension_out));
9806             break;
9807         }
9808         case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
9809             deepcopy_VkFramebufferAttachmentsCreateInfo(
9810                 alloc, rootType,
9811                 reinterpret_cast<const VkFramebufferAttachmentsCreateInfo*>(structExtension),
9812                 reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
9813             break;
9814         }
9815         case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
9816             deepcopy_VkRenderPassAttachmentBeginInfo(
9817                 alloc, rootType,
9818                 reinterpret_cast<const VkRenderPassAttachmentBeginInfo*>(structExtension),
9819                 reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
9820             break;
9821         }
9822         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
9823             deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
9824                 alloc, rootType,
9825                 reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
9826                     structExtension),
9827                 reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
9828                     structExtension_out));
9829             break;
9830         }
9831         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
9832             deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
9833                 alloc, rootType,
9834                 reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
9835                     structExtension),
9836                 reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
9837                     structExtension_out));
9838             break;
9839         }
9840         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
9841             deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
9842                 alloc, rootType,
9843                 reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
9844                     structExtension),
9845                 reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
9846                     structExtension_out));
9847             break;
9848         }
9849         case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
9850             deepcopy_VkAttachmentReferenceStencilLayout(
9851                 alloc, rootType,
9852                 reinterpret_cast<const VkAttachmentReferenceStencilLayout*>(structExtension),
9853                 reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
9854             break;
9855         }
9856         case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
9857             deepcopy_VkAttachmentDescriptionStencilLayout(
9858                 alloc, rootType,
9859                 reinterpret_cast<const VkAttachmentDescriptionStencilLayout*>(structExtension),
9860                 reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
9861             break;
9862         }
9863         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
9864             deepcopy_VkPhysicalDeviceHostQueryResetFeatures(
9865                 alloc, rootType,
9866                 reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(structExtension),
9867                 reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
9868             break;
9869         }
9870         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
9871             deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(
9872                 alloc, rootType,
9873                 reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension),
9874                 reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
9875             break;
9876         }
9877         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
9878             deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(
9879                 alloc, rootType,
9880                 reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreProperties*>(
9881                     structExtension),
9882                 reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
9883                     structExtension_out));
9884             break;
9885         }
9886         case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
9887             deepcopy_VkSemaphoreTypeCreateInfo(
9888                 alloc, rootType,
9889                 reinterpret_cast<const VkSemaphoreTypeCreateInfo*>(structExtension),
9890                 reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
9891             break;
9892         }
9893         case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
9894             deepcopy_VkTimelineSemaphoreSubmitInfo(
9895                 alloc, rootType,
9896                 reinterpret_cast<const VkTimelineSemaphoreSubmitInfo*>(structExtension),
9897                 reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
9898             break;
9899         }
9900         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
9901             deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(
9902                 alloc, rootType,
9903                 reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(
9904                     structExtension),
9905                 reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
9906                     structExtension_out));
9907             break;
9908         }
9909         case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
9910             deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(
9911                 alloc, rootType,
9912                 reinterpret_cast<const VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension),
9913                 reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
9914             break;
9915         }
9916         case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
9917             deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(
9918                 alloc, rootType,
9919                 reinterpret_cast<const VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension),
9920                 reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
9921             break;
9922         }
9923 #endif
9924 #ifdef VK_VERSION_1_3
9925         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: {
9926             deepcopy_VkPhysicalDeviceVulkan13Features(
9927                 alloc, rootType,
9928                 reinterpret_cast<const VkPhysicalDeviceVulkan13Features*>(structExtension),
9929                 reinterpret_cast<VkPhysicalDeviceVulkan13Features*>(structExtension_out));
9930             break;
9931         }
9932         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: {
9933             deepcopy_VkPhysicalDeviceVulkan13Properties(
9934                 alloc, rootType,
9935                 reinterpret_cast<const VkPhysicalDeviceVulkan13Properties*>(structExtension),
9936                 reinterpret_cast<VkPhysicalDeviceVulkan13Properties*>(structExtension_out));
9937             break;
9938         }
9939         case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: {
9940             deepcopy_VkPipelineCreationFeedbackCreateInfo(
9941                 alloc, rootType,
9942                 reinterpret_cast<const VkPipelineCreationFeedbackCreateInfo*>(structExtension),
9943                 reinterpret_cast<VkPipelineCreationFeedbackCreateInfo*>(structExtension_out));
9944             break;
9945         }
9946         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: {
9947             deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeatures(
9948                 alloc, rootType,
9949                 reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeatures*>(
9950                     structExtension),
9951                 reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeatures*>(
9952                     structExtension_out));
9953             break;
9954         }
9955         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: {
9956             deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures(
9957                 alloc, rootType,
9958                 reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures*>(
9959                     structExtension),
9960                 reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures*>(
9961                     structExtension_out));
9962             break;
9963         }
9964         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: {
9965             deepcopy_VkPhysicalDevicePrivateDataFeatures(
9966                 alloc, rootType,
9967                 reinterpret_cast<const VkPhysicalDevicePrivateDataFeatures*>(structExtension),
9968                 reinterpret_cast<VkPhysicalDevicePrivateDataFeatures*>(structExtension_out));
9969             break;
9970         }
9971         case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: {
9972             deepcopy_VkDevicePrivateDataCreateInfo(
9973                 alloc, rootType,
9974                 reinterpret_cast<const VkDevicePrivateDataCreateInfo*>(structExtension),
9975                 reinterpret_cast<VkDevicePrivateDataCreateInfo*>(structExtension_out));
9976             break;
9977         }
9978         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: {
9979             deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeatures(
9980                 alloc, rootType,
9981                 reinterpret_cast<const VkPhysicalDevicePipelineCreationCacheControlFeatures*>(
9982                     structExtension),
9983                 reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeatures*>(
9984                     structExtension_out));
9985             break;
9986         }
9987         case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2: {
9988             deepcopy_VkMemoryBarrier2(alloc, rootType,
9989                                       reinterpret_cast<const VkMemoryBarrier2*>(structExtension),
9990                                       reinterpret_cast<VkMemoryBarrier2*>(structExtension_out));
9991             break;
9992         }
9993         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: {
9994             deepcopy_VkPhysicalDeviceSynchronization2Features(
9995                 alloc, rootType,
9996                 reinterpret_cast<const VkPhysicalDeviceSynchronization2Features*>(structExtension),
9997                 reinterpret_cast<VkPhysicalDeviceSynchronization2Features*>(structExtension_out));
9998             break;
9999         }
10000         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: {
10001             deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(
10002                 alloc, rootType,
10003                 reinterpret_cast<const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures*>(
10004                     structExtension),
10005                 reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures*>(
10006                     structExtension_out));
10007             break;
10008         }
10009         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: {
10010             deepcopy_VkPhysicalDeviceImageRobustnessFeatures(
10011                 alloc, rootType,
10012                 reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeatures*>(structExtension),
10013                 reinterpret_cast<VkPhysicalDeviceImageRobustnessFeatures*>(structExtension_out));
10014             break;
10015         }
10016         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: {
10017             deepcopy_VkPhysicalDeviceSubgroupSizeControlFeatures(
10018                 alloc, rootType,
10019                 reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeatures*>(
10020                     structExtension),
10021                 reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeatures*>(
10022                     structExtension_out));
10023             break;
10024         }
10025         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: {
10026             deepcopy_VkPhysicalDeviceSubgroupSizeControlProperties(
10027                 alloc, rootType,
10028                 reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlProperties*>(
10029                     structExtension),
10030                 reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlProperties*>(
10031                     structExtension_out));
10032             break;
10033         }
10034         case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: {
10035             deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfo(
10036                 alloc, rootType,
10037                 reinterpret_cast<const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo*>(
10038                     structExtension),
10039                 reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfo*>(
10040                     structExtension_out));
10041             break;
10042         }
10043         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: {
10044             deepcopy_VkPhysicalDeviceInlineUniformBlockFeatures(
10045                 alloc, rootType,
10046                 reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeatures*>(
10047                     structExtension),
10048                 reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeatures*>(structExtension_out));
10049             break;
10050         }
10051         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: {
10052             deepcopy_VkPhysicalDeviceInlineUniformBlockProperties(
10053                 alloc, rootType,
10054                 reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockProperties*>(
10055                     structExtension),
10056                 reinterpret_cast<VkPhysicalDeviceInlineUniformBlockProperties*>(
10057                     structExtension_out));
10058             break;
10059         }
10060         case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK: {
10061             deepcopy_VkWriteDescriptorSetInlineUniformBlock(
10062                 alloc, rootType,
10063                 reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlock*>(structExtension),
10064                 reinterpret_cast<VkWriteDescriptorSetInlineUniformBlock*>(structExtension_out));
10065             break;
10066         }
10067         case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO: {
10068             deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfo(
10069                 alloc, rootType,
10070                 reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfo*>(
10071                     structExtension),
10072                 reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfo*>(
10073                     structExtension_out));
10074             break;
10075         }
10076         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: {
10077             deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeatures(
10078                 alloc, rootType,
10079                 reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeatures*>(
10080                     structExtension),
10081                 reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeatures*>(
10082                     structExtension_out));
10083             break;
10084         }
10085         case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: {
10086             deepcopy_VkPipelineRenderingCreateInfo(
10087                 alloc, rootType,
10088                 reinterpret_cast<const VkPipelineRenderingCreateInfo*>(structExtension),
10089                 reinterpret_cast<VkPipelineRenderingCreateInfo*>(structExtension_out));
10090             break;
10091         }
10092         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: {
10093             deepcopy_VkPhysicalDeviceDynamicRenderingFeatures(
10094                 alloc, rootType,
10095                 reinterpret_cast<const VkPhysicalDeviceDynamicRenderingFeatures*>(structExtension),
10096                 reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeatures*>(structExtension_out));
10097             break;
10098         }
10099         case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO: {
10100             deepcopy_VkCommandBufferInheritanceRenderingInfo(
10101                 alloc, rootType,
10102                 reinterpret_cast<const VkCommandBufferInheritanceRenderingInfo*>(structExtension),
10103                 reinterpret_cast<VkCommandBufferInheritanceRenderingInfo*>(structExtension_out));
10104             break;
10105         }
10106         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: {
10107             deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeatures(
10108                 alloc, rootType,
10109                 reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductFeatures*>(
10110                     structExtension),
10111                 reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeatures*>(
10112                     structExtension_out));
10113             break;
10114         }
10115         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: {
10116             deepcopy_VkPhysicalDeviceShaderIntegerDotProductProperties(
10117                 alloc, rootType,
10118                 reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductProperties*>(
10119                     structExtension),
10120                 reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductProperties*>(
10121                     structExtension_out));
10122             break;
10123         }
10124         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: {
10125             deepcopy_VkPhysicalDeviceTexelBufferAlignmentProperties(
10126                 alloc, rootType,
10127                 reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentProperties*>(
10128                     structExtension),
10129                 reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentProperties*>(
10130                     structExtension_out));
10131             break;
10132         }
10133         case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: {
10134             deepcopy_VkFormatProperties3(
10135                 alloc, rootType, reinterpret_cast<const VkFormatProperties3*>(structExtension),
10136                 reinterpret_cast<VkFormatProperties3*>(structExtension_out));
10137             break;
10138         }
10139         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: {
10140             deepcopy_VkPhysicalDeviceMaintenance4Features(
10141                 alloc, rootType,
10142                 reinterpret_cast<const VkPhysicalDeviceMaintenance4Features*>(structExtension),
10143                 reinterpret_cast<VkPhysicalDeviceMaintenance4Features*>(structExtension_out));
10144             break;
10145         }
10146         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: {
10147             deepcopy_VkPhysicalDeviceMaintenance4Properties(
10148                 alloc, rootType,
10149                 reinterpret_cast<const VkPhysicalDeviceMaintenance4Properties*>(structExtension),
10150                 reinterpret_cast<VkPhysicalDeviceMaintenance4Properties*>(structExtension_out));
10151             break;
10152         }
10153 #endif
10154 #ifdef VK_VERSION_1_4
10155         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: {
10156             deepcopy_VkPhysicalDeviceVulkan14Features(
10157                 alloc, rootType,
10158                 reinterpret_cast<const VkPhysicalDeviceVulkan14Features*>(structExtension),
10159                 reinterpret_cast<VkPhysicalDeviceVulkan14Features*>(structExtension_out));
10160             break;
10161         }
10162         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES: {
10163             deepcopy_VkPhysicalDeviceVulkan14Properties(
10164                 alloc, rootType,
10165                 reinterpret_cast<const VkPhysicalDeviceVulkan14Properties*>(structExtension),
10166                 reinterpret_cast<VkPhysicalDeviceVulkan14Properties*>(structExtension_out));
10167             break;
10168         }
10169         case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO: {
10170             deepcopy_VkDeviceQueueGlobalPriorityCreateInfo(
10171                 alloc, rootType,
10172                 reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfo*>(structExtension),
10173                 reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfo*>(structExtension_out));
10174             break;
10175         }
10176         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: {
10177             deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeatures(
10178                 alloc, rootType,
10179                 reinterpret_cast<const VkPhysicalDeviceGlobalPriorityQueryFeatures*>(
10180                     structExtension),
10181                 reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeatures*>(
10182                     structExtension_out));
10183             break;
10184         }
10185         case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES: {
10186             deepcopy_VkQueueFamilyGlobalPriorityProperties(
10187                 alloc, rootType,
10188                 reinterpret_cast<const VkQueueFamilyGlobalPriorityProperties*>(structExtension),
10189                 reinterpret_cast<VkQueueFamilyGlobalPriorityProperties*>(structExtension_out));
10190             break;
10191         }
10192         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: {
10193             deepcopy_VkPhysicalDeviceShaderSubgroupRotateFeatures(
10194                 alloc, rootType,
10195                 reinterpret_cast<const VkPhysicalDeviceShaderSubgroupRotateFeatures*>(
10196                     structExtension),
10197                 reinterpret_cast<VkPhysicalDeviceShaderSubgroupRotateFeatures*>(
10198                     structExtension_out));
10199             break;
10200         }
10201         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: {
10202             deepcopy_VkPhysicalDeviceShaderFloatControls2Features(
10203                 alloc, rootType,
10204                 reinterpret_cast<const VkPhysicalDeviceShaderFloatControls2Features*>(
10205                     structExtension),
10206                 reinterpret_cast<VkPhysicalDeviceShaderFloatControls2Features*>(
10207                     structExtension_out));
10208             break;
10209         }
10210         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: {
10211             deepcopy_VkPhysicalDeviceShaderExpectAssumeFeatures(
10212                 alloc, rootType,
10213                 reinterpret_cast<const VkPhysicalDeviceShaderExpectAssumeFeatures*>(
10214                     structExtension),
10215                 reinterpret_cast<VkPhysicalDeviceShaderExpectAssumeFeatures*>(structExtension_out));
10216             break;
10217         }
10218         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: {
10219             deepcopy_VkPhysicalDeviceLineRasterizationFeatures(
10220                 alloc, rootType,
10221                 reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeatures*>(structExtension),
10222                 reinterpret_cast<VkPhysicalDeviceLineRasterizationFeatures*>(structExtension_out));
10223             break;
10224         }
10225         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES: {
10226             deepcopy_VkPhysicalDeviceLineRasterizationProperties(
10227                 alloc, rootType,
10228                 reinterpret_cast<const VkPhysicalDeviceLineRasterizationProperties*>(
10229                     structExtension),
10230                 reinterpret_cast<VkPhysicalDeviceLineRasterizationProperties*>(
10231                     structExtension_out));
10232             break;
10233         }
10234         case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO: {
10235             deepcopy_VkPipelineRasterizationLineStateCreateInfo(
10236                 alloc, rootType,
10237                 reinterpret_cast<const VkPipelineRasterizationLineStateCreateInfo*>(
10238                     structExtension),
10239                 reinterpret_cast<VkPipelineRasterizationLineStateCreateInfo*>(structExtension_out));
10240             break;
10241         }
10242         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES: {
10243             deepcopy_VkPhysicalDeviceVertexAttributeDivisorProperties(
10244                 alloc, rootType,
10245                 reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorProperties*>(
10246                     structExtension),
10247                 reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorProperties*>(
10248                     structExtension_out));
10249             break;
10250         }
10251         case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO: {
10252             deepcopy_VkPipelineVertexInputDivisorStateCreateInfo(
10253                 alloc, rootType,
10254                 reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfo*>(
10255                     structExtension),
10256                 reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfo*>(
10257                     structExtension_out));
10258             break;
10259         }
10260         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: {
10261             deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeatures(
10262                 alloc, rootType,
10263                 reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeatures*>(
10264                     structExtension),
10265                 reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeatures*>(
10266                     structExtension_out));
10267             break;
10268         }
10269         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: {
10270             deepcopy_VkPhysicalDeviceIndexTypeUint8Features(
10271                 alloc, rootType,
10272                 reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8Features*>(structExtension),
10273                 reinterpret_cast<VkPhysicalDeviceIndexTypeUint8Features*>(structExtension_out));
10274             break;
10275         }
10276         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: {
10277             deepcopy_VkPhysicalDeviceMaintenance5Features(
10278                 alloc, rootType,
10279                 reinterpret_cast<const VkPhysicalDeviceMaintenance5Features*>(structExtension),
10280                 reinterpret_cast<VkPhysicalDeviceMaintenance5Features*>(structExtension_out));
10281             break;
10282         }
10283         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES: {
10284             deepcopy_VkPhysicalDeviceMaintenance5Properties(
10285                 alloc, rootType,
10286                 reinterpret_cast<const VkPhysicalDeviceMaintenance5Properties*>(structExtension),
10287                 reinterpret_cast<VkPhysicalDeviceMaintenance5Properties*>(structExtension_out));
10288             break;
10289         }
10290         case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: {
10291             deepcopy_VkPipelineCreateFlags2CreateInfo(
10292                 alloc, rootType,
10293                 reinterpret_cast<const VkPipelineCreateFlags2CreateInfo*>(structExtension),
10294                 reinterpret_cast<VkPipelineCreateFlags2CreateInfo*>(structExtension_out));
10295             break;
10296         }
10297         case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: {
10298             deepcopy_VkBufferUsageFlags2CreateInfo(
10299                 alloc, rootType,
10300                 reinterpret_cast<const VkBufferUsageFlags2CreateInfo*>(structExtension),
10301                 reinterpret_cast<VkBufferUsageFlags2CreateInfo*>(structExtension_out));
10302             break;
10303         }
10304         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES: {
10305             deepcopy_VkPhysicalDevicePushDescriptorProperties(
10306                 alloc, rootType,
10307                 reinterpret_cast<const VkPhysicalDevicePushDescriptorProperties*>(structExtension),
10308                 reinterpret_cast<VkPhysicalDevicePushDescriptorProperties*>(structExtension_out));
10309             break;
10310         }
10311         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: {
10312             deepcopy_VkPhysicalDeviceDynamicRenderingLocalReadFeatures(
10313                 alloc, rootType,
10314                 reinterpret_cast<const VkPhysicalDeviceDynamicRenderingLocalReadFeatures*>(
10315                     structExtension),
10316                 reinterpret_cast<VkPhysicalDeviceDynamicRenderingLocalReadFeatures*>(
10317                     structExtension_out));
10318             break;
10319         }
10320         case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO: {
10321             deepcopy_VkRenderingAttachmentLocationInfo(
10322                 alloc, rootType,
10323                 reinterpret_cast<const VkRenderingAttachmentLocationInfo*>(structExtension),
10324                 reinterpret_cast<VkRenderingAttachmentLocationInfo*>(structExtension_out));
10325             break;
10326         }
10327         case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO: {
10328             deepcopy_VkRenderingInputAttachmentIndexInfo(
10329                 alloc, rootType,
10330                 reinterpret_cast<const VkRenderingInputAttachmentIndexInfo*>(structExtension),
10331                 reinterpret_cast<VkRenderingInputAttachmentIndexInfo*>(structExtension_out));
10332             break;
10333         }
10334         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: {
10335             deepcopy_VkPhysicalDeviceMaintenance6Features(
10336                 alloc, rootType,
10337                 reinterpret_cast<const VkPhysicalDeviceMaintenance6Features*>(structExtension),
10338                 reinterpret_cast<VkPhysicalDeviceMaintenance6Features*>(structExtension_out));
10339             break;
10340         }
10341         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES: {
10342             deepcopy_VkPhysicalDeviceMaintenance6Properties(
10343                 alloc, rootType,
10344                 reinterpret_cast<const VkPhysicalDeviceMaintenance6Properties*>(structExtension),
10345                 reinterpret_cast<VkPhysicalDeviceMaintenance6Properties*>(structExtension_out));
10346             break;
10347         }
10348         case VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS: {
10349             deepcopy_VkBindMemoryStatus(
10350                 alloc, rootType, reinterpret_cast<const VkBindMemoryStatus*>(structExtension),
10351                 reinterpret_cast<VkBindMemoryStatus*>(structExtension_out));
10352             break;
10353         }
10354         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: {
10355             deepcopy_VkPhysicalDevicePipelineProtectedAccessFeatures(
10356                 alloc, rootType,
10357                 reinterpret_cast<const VkPhysicalDevicePipelineProtectedAccessFeatures*>(
10358                     structExtension),
10359                 reinterpret_cast<VkPhysicalDevicePipelineProtectedAccessFeatures*>(
10360                     structExtension_out));
10361             break;
10362         }
10363         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: {
10364             deepcopy_VkPhysicalDevicePipelineRobustnessFeatures(
10365                 alloc, rootType,
10366                 reinterpret_cast<const VkPhysicalDevicePipelineRobustnessFeatures*>(
10367                     structExtension),
10368                 reinterpret_cast<VkPhysicalDevicePipelineRobustnessFeatures*>(structExtension_out));
10369             break;
10370         }
10371         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES: {
10372             deepcopy_VkPhysicalDevicePipelineRobustnessProperties(
10373                 alloc, rootType,
10374                 reinterpret_cast<const VkPhysicalDevicePipelineRobustnessProperties*>(
10375                     structExtension),
10376                 reinterpret_cast<VkPhysicalDevicePipelineRobustnessProperties*>(
10377                     structExtension_out));
10378             break;
10379         }
10380         case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: {
10381             deepcopy_VkPipelineRobustnessCreateInfo(
10382                 alloc, rootType,
10383                 reinterpret_cast<const VkPipelineRobustnessCreateInfo*>(structExtension),
10384                 reinterpret_cast<VkPipelineRobustnessCreateInfo*>(structExtension_out));
10385             break;
10386         }
10387         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: {
10388             deepcopy_VkPhysicalDeviceHostImageCopyFeatures(
10389                 alloc, rootType,
10390                 reinterpret_cast<const VkPhysicalDeviceHostImageCopyFeatures*>(structExtension),
10391                 reinterpret_cast<VkPhysicalDeviceHostImageCopyFeatures*>(structExtension_out));
10392             break;
10393         }
10394         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES: {
10395             deepcopy_VkPhysicalDeviceHostImageCopyProperties(
10396                 alloc, rootType,
10397                 reinterpret_cast<const VkPhysicalDeviceHostImageCopyProperties*>(structExtension),
10398                 reinterpret_cast<VkPhysicalDeviceHostImageCopyProperties*>(structExtension_out));
10399             break;
10400         }
10401         case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE: {
10402             deepcopy_VkSubresourceHostMemcpySize(
10403                 alloc, rootType,
10404                 reinterpret_cast<const VkSubresourceHostMemcpySize*>(structExtension),
10405                 reinterpret_cast<VkSubresourceHostMemcpySize*>(structExtension_out));
10406             break;
10407         }
10408         case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: {
10409             deepcopy_VkHostImageCopyDevicePerformanceQuery(
10410                 alloc, rootType,
10411                 reinterpret_cast<const VkHostImageCopyDevicePerformanceQuery*>(structExtension),
10412                 reinterpret_cast<VkHostImageCopyDevicePerformanceQuery*>(structExtension_out));
10413             break;
10414         }
10415 #endif
10416 #ifdef VK_KHR_incremental_present
10417         case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
10418             deepcopy_VkPresentRegionsKHR(
10419                 alloc, rootType, reinterpret_cast<const VkPresentRegionsKHR*>(structExtension),
10420                 reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
10421             break;
10422         }
10423 #endif
10424 #ifdef VK_KHR_pipeline_executable_properties
10425         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
10426             deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
10427                 alloc, rootType,
10428                 reinterpret_cast<const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
10429                     structExtension),
10430                 reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
10431                     structExtension_out));
10432             break;
10433         }
10434 #endif
10435 #ifdef VK_ANDROID_native_buffer
10436         case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
10437             deepcopy_VkNativeBufferANDROID(
10438                 alloc, rootType, reinterpret_cast<const VkNativeBufferANDROID*>(structExtension),
10439                 reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
10440             break;
10441         }
10442 #endif
10443 #ifdef VK_EXT_transform_feedback
10444         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
10445             deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
10446                 alloc, rootType,
10447                 reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
10448                     structExtension),
10449                 reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
10450                     structExtension_out));
10451             break;
10452         }
10453         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
10454             deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
10455                 alloc, rootType,
10456                 reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
10457                     structExtension),
10458                 reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
10459                     structExtension_out));
10460             break;
10461         }
10462         case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
10463             deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(
10464                 alloc, rootType,
10465                 reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT*>(
10466                     structExtension),
10467                 reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
10468                     structExtension_out));
10469             break;
10470         }
10471 #endif
10472 #ifdef VK_EXT_depth_clip_enable
10473         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
10474             deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
10475                 alloc, rootType,
10476                 reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(
10477                     structExtension),
10478                 reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
10479             break;
10480         }
10481         case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
10482             deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
10483                 alloc, rootType,
10484                 reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
10485                     structExtension),
10486                 reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
10487                     structExtension_out));
10488             break;
10489         }
10490 #endif
10491 #ifdef VK_EXT_image_drm_format_modifier
10492         case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
10493             deepcopy_VkDrmFormatModifierPropertiesListEXT(
10494                 alloc, rootType,
10495                 reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT*>(structExtension),
10496                 reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
10497             break;
10498         }
10499         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
10500             deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
10501                 alloc, rootType,
10502                 reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
10503                     structExtension),
10504                 reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
10505                     structExtension_out));
10506             break;
10507         }
10508         case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
10509             deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(
10510                 alloc, rootType,
10511                 reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension),
10512                 reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
10513             break;
10514         }
10515         case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
10516             deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(
10517                 alloc, rootType,
10518                 reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
10519                     structExtension),
10520                 reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
10521                     structExtension_out));
10522             break;
10523         }
10524         case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
10525             deepcopy_VkDrmFormatModifierPropertiesList2EXT(
10526                 alloc, rootType,
10527                 reinterpret_cast<const VkDrmFormatModifierPropertiesList2EXT*>(structExtension),
10528                 reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
10529             break;
10530         }
10531 #endif
10532 #ifdef VK_EXT_vertex_attribute_divisor
10533         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
10534             deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
10535                 alloc, rootType,
10536                 reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
10537                     structExtension),
10538                 reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
10539                     structExtension_out));
10540             break;
10541         }
10542 #endif
10543 #ifdef VK_EXT_fragment_density_map
10544         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
10545             switch (rootType) {
10546                 case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
10547                     deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
10548                         alloc, rootType,
10549                         reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10550                             structExtension),
10551                         reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10552                             structExtension_out));
10553                     break;
10554                 }
10555                 case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
10556                     deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
10557                         alloc, rootType,
10558                         reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10559                             structExtension),
10560                         reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10561                             structExtension_out));
10562                     break;
10563                 }
10564                 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
10565                     deepcopy_VkImportColorBufferGOOGLE(
10566                         alloc, rootType,
10567                         reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension),
10568                         reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
10569                     break;
10570                 }
10571                 default: {
10572                     deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
10573                         alloc, rootType,
10574                         reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10575                             structExtension),
10576                         reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
10577                             structExtension_out));
10578                     break;
10579                 }
10580             }
10581             break;
10582         }
10583         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
10584             switch (rootType) {
10585                 case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
10586                     deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
10587                         alloc, rootType,
10588                         reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
10589                             structExtension),
10590                         reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
10591                             structExtension_out));
10592                     break;
10593                 }
10594                 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
10595                     deepcopy_VkCreateBlobGOOGLE(
10596                         alloc, rootType,
10597                         reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
10598                         reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
10599                     break;
10600                 }
10601                 default: {
10602                     deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
10603                         alloc, rootType,
10604                         reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
10605                             structExtension),
10606                         reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
10607                             structExtension_out));
10608                     break;
10609                 }
10610             }
10611             break;
10612         }
10613         case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
10614             switch (rootType) {
10615                 case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
10616                     deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
10617                         alloc, rootType,
10618                         reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10619                             structExtension),
10620                         reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10621                             structExtension_out));
10622                     break;
10623                 }
10624                 case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
10625                     deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
10626                         alloc, rootType,
10627                         reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10628                             structExtension),
10629                         reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10630                             structExtension_out));
10631                     break;
10632                 }
10633                 case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
10634                     deepcopy_VkImportBufferGOOGLE(
10635                         alloc, rootType,
10636                         reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension),
10637                         reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
10638                     break;
10639                 }
10640                 default: {
10641                     deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
10642                         alloc, rootType,
10643                         reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10644                             structExtension),
10645                         reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
10646                             structExtension_out));
10647                     break;
10648                 }
10649             }
10650             break;
10651         }
10652         case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
10653             deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(
10654                 alloc, rootType,
10655                 reinterpret_cast<const VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
10656                     structExtension),
10657                 reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
10658                     structExtension_out));
10659             break;
10660         }
10661 #endif
10662 #ifdef VK_EXT_provoking_vertex
10663         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
10664             deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(
10665                 alloc, rootType,
10666                 reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(
10667                     structExtension),
10668                 reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
10669             break;
10670         }
10671         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
10672             deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(
10673                 alloc, rootType,
10674                 reinterpret_cast<const VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
10675                     structExtension),
10676                 reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
10677                     structExtension_out));
10678             break;
10679         }
10680         case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
10681             deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
10682                 alloc, rootType,
10683                 reinterpret_cast<const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
10684                     structExtension),
10685                 reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
10686                     structExtension_out));
10687             break;
10688         }
10689 #endif
10690 #ifdef VK_EXT_extended_dynamic_state
10691         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
10692             deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
10693                 alloc, rootType,
10694                 reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
10695                     structExtension),
10696                 reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
10697                     structExtension_out));
10698             break;
10699         }
10700 #endif
10701 #ifdef VK_EXT_texel_buffer_alignment
10702         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
10703             deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
10704                 alloc, rootType,
10705                 reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
10706                     structExtension),
10707                 reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
10708                     structExtension_out));
10709             break;
10710         }
10711 #endif
10712 #ifdef VK_EXT_device_memory_report
10713         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
10714             deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
10715                 alloc, rootType,
10716                 reinterpret_cast<const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
10717                     structExtension),
10718                 reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
10719                     structExtension_out));
10720             break;
10721         }
10722         case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
10723             deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(
10724                 alloc, rootType,
10725                 reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension),
10726                 reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
10727             break;
10728         }
10729 #endif
10730 #ifdef VK_EXT_robustness2
10731         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
10732             deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(
10733                 alloc, rootType,
10734                 reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension),
10735                 reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
10736             break;
10737         }
10738         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
10739             deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(
10740                 alloc, rootType,
10741                 reinterpret_cast<const VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension),
10742                 reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
10743             break;
10744         }
10745 #endif
10746 #ifdef VK_EXT_custom_border_color
10747         case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
10748             deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(
10749                 alloc, rootType,
10750                 reinterpret_cast<const VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension),
10751                 reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
10752             break;
10753         }
10754         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
10755             deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
10756                 alloc, rootType,
10757                 reinterpret_cast<const VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
10758                     structExtension),
10759                 reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
10760                     structExtension_out));
10761             break;
10762         }
10763         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
10764             deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
10765                 alloc, rootType,
10766                 reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
10767                     structExtension),
10768                 reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
10769                     structExtension_out));
10770             break;
10771         }
10772 #endif
10773 #ifdef VK_EXT_graphics_pipeline_library
10774         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: {
10775             deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT(
10776                 alloc, rootType,
10777                 reinterpret_cast<const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT*>(
10778                     structExtension),
10779                 reinterpret_cast<VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT*>(
10780                     structExtension_out));
10781             break;
10782         }
10783         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: {
10784             deepcopy_VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT(
10785                 alloc, rootType,
10786                 reinterpret_cast<const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT*>(
10787                     structExtension),
10788                 reinterpret_cast<VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT*>(
10789                     structExtension_out));
10790             break;
10791         }
10792         case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: {
10793             deepcopy_VkGraphicsPipelineLibraryCreateInfoEXT(
10794                 alloc, rootType,
10795                 reinterpret_cast<const VkGraphicsPipelineLibraryCreateInfoEXT*>(structExtension),
10796                 reinterpret_cast<VkGraphicsPipelineLibraryCreateInfoEXT*>(structExtension_out));
10797             break;
10798         }
10799 #endif
10800 #ifdef VK_EXT_ycbcr_2plane_444_formats
10801         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
10802             deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
10803                 alloc, rootType,
10804                 reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
10805                     structExtension),
10806                 reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
10807                     structExtension_out));
10808             break;
10809         }
10810 #endif
10811 #ifdef VK_EXT_image_compression_control
10812         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: {
10813             deepcopy_VkPhysicalDeviceImageCompressionControlFeaturesEXT(
10814                 alloc, rootType,
10815                 reinterpret_cast<const VkPhysicalDeviceImageCompressionControlFeaturesEXT*>(
10816                     structExtension),
10817                 reinterpret_cast<VkPhysicalDeviceImageCompressionControlFeaturesEXT*>(
10818                     structExtension_out));
10819             break;
10820         }
10821         case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: {
10822             deepcopy_VkImageCompressionControlEXT(
10823                 alloc, rootType,
10824                 reinterpret_cast<const VkImageCompressionControlEXT*>(structExtension),
10825                 reinterpret_cast<VkImageCompressionControlEXT*>(structExtension_out));
10826             break;
10827         }
10828         case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: {
10829             deepcopy_VkImageCompressionPropertiesEXT(
10830                 alloc, rootType,
10831                 reinterpret_cast<const VkImageCompressionPropertiesEXT*>(structExtension),
10832                 reinterpret_cast<VkImageCompressionPropertiesEXT*>(structExtension_out));
10833             break;
10834         }
10835 #endif
10836 #ifdef VK_EXT_4444_formats
10837         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
10838             deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(
10839                 alloc, rootType,
10840                 reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension),
10841                 reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
10842             break;
10843         }
10844 #endif
10845 #ifdef VK_EXT_primitive_topology_list_restart
10846         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
10847             deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
10848                 alloc, rootType,
10849                 reinterpret_cast<const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
10850                     structExtension),
10851                 reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
10852                     structExtension_out));
10853             break;
10854         }
10855 #endif
10856 #ifdef VK_EXT_extended_dynamic_state2
10857         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
10858             deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
10859                 alloc, rootType,
10860                 reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
10861                     structExtension),
10862                 reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
10863                     structExtension_out));
10864             break;
10865         }
10866 #endif
10867 #ifdef VK_EXT_color_write_enable
10868         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
10869             deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
10870                 alloc, rootType,
10871                 reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
10872                     structExtension),
10873                 reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
10874                     structExtension_out));
10875             break;
10876         }
10877         case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
10878             deepcopy_VkPipelineColorWriteCreateInfoEXT(
10879                 alloc, rootType,
10880                 reinterpret_cast<const VkPipelineColorWriteCreateInfoEXT*>(structExtension),
10881                 reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
10882             break;
10883         }
10884 #endif
10885 #ifdef VK_GOOGLE_gfxstream
10886         case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
10887             deepcopy_VkImportColorBufferGOOGLE(
10888                 alloc, rootType,
10889                 reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension),
10890                 reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
10891             break;
10892         }
10893         case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
10894             deepcopy_VkImportBufferGOOGLE(
10895                 alloc, rootType, reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension),
10896                 reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
10897             break;
10898         }
10899         case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
10900             deepcopy_VkCreateBlobGOOGLE(
10901                 alloc, rootType, reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
10902                 reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
10903             break;
10904         }
10905 #endif
10906 #ifdef VK_EXT_image_compression_control_swapchain
10907         case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: {
10908             deepcopy_VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT(
10909                 alloc, rootType,
10910                 reinterpret_cast<
10911                     const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT*>(
10912                     structExtension),
10913                 reinterpret_cast<VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT*>(
10914                     structExtension_out));
10915             break;
10916         }
10917 #endif
10918         default: {
10919             return;
10920         }
10921     }
10922 }
10923 
10924 }  // namespace vk
10925 }  // namespace gfxstream
10926