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