blob: a9676c8044e09ad45c885a2dc6911d4fb9313db2 [file] [log] [blame]
// Copyright (C) 2018 The Android Open Source Project
// Copyright (C) 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Autogenerated module goldfish_vk_deepcopy_guest
//
// (impl) generated by registry/vulkan/scripts/genvk.py -registry registry/vulkan/xml/vk.xml cereal
// -o ../vulkan-cereal/stream-servers/vulkan/cereal
//
// Please do not modify directly;
// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
// or directly from Python by defining:
// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
// CEREAL_OUTPUT_DIR: Where to put the generated sources.
//
// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
// $CEREAL_OUTPUT_DIR
//
#include "goldfish_vk_deepcopy_guest.h"
#include <cstring>
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
#include "vk_util.h"
namespace gfxstream {
namespace vk {
void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
const void* structExtension, void* structExtension_out);
#ifdef VK_VERSION_1_0
void deepcopy_VkExtent2D(Allocator* alloc, VkStructureType rootType, const VkExtent2D* from,
VkExtent2D* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkExtent3D(Allocator* alloc, VkStructureType rootType, const VkExtent3D* from,
VkExtent3D* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkOffset2D(Allocator* alloc, VkStructureType rootType, const VkOffset2D* from,
VkOffset2D* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkOffset3D(Allocator* alloc, VkStructureType rootType, const VkOffset3D* from,
VkOffset3D* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkRect2D(Allocator* alloc, VkStructureType rootType, const VkRect2D* from,
VkRect2D* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkOffset2D(alloc, rootType, &from->offset, (VkOffset2D*)(&to->offset));
deepcopy_VkExtent2D(alloc, rootType, &from->extent, (VkExtent2D*)(&to->extent));
}
void deepcopy_VkBaseInStructure(Allocator* alloc, VkStructureType rootType,
const VkBaseInStructure* from, VkBaseInStructure* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (VkBaseInStructure*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBaseOutStructure(Allocator* alloc, VkStructureType rootType,
const VkBaseOutStructure* from, VkBaseOutStructure* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (VkBaseOutStructure*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBufferMemoryBarrier(Allocator* alloc, VkStructureType rootType,
const VkBufferMemoryBarrier* from, VkBufferMemoryBarrier* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkDispatchIndirectCommand(Allocator* alloc, VkStructureType rootType,
const VkDispatchIndirectCommand* from,
VkDispatchIndirectCommand* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkDrawIndexedIndirectCommand(Allocator* alloc, VkStructureType rootType,
const VkDrawIndexedIndirectCommand* from,
VkDrawIndexedIndirectCommand* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkDrawIndirectCommand(Allocator* alloc, VkStructureType rootType,
const VkDrawIndirectCommand* from, VkDrawIndirectCommand* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkImageSubresourceRange(Allocator* alloc, VkStructureType rootType,
const VkImageSubresourceRange* from,
VkImageSubresourceRange* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkImageMemoryBarrier(Allocator* alloc, VkStructureType rootType,
const VkImageMemoryBarrier* from, VkImageMemoryBarrier* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
(VkImageSubresourceRange*)(&to->subresourceRange));
}
void deepcopy_VkMemoryBarrier(Allocator* alloc, VkStructureType rootType,
const VkMemoryBarrier* from, VkMemoryBarrier* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkPipelineCacheHeaderVersionOne(Allocator* alloc, VkStructureType rootType,
const VkPipelineCacheHeaderVersionOne* from,
VkPipelineCacheHeaderVersionOne* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
}
void deepcopy_VkAllocationCallbacks(Allocator* alloc, VkStructureType rootType,
const VkAllocationCallbacks* from, VkAllocationCallbacks* to) {
(void)alloc;
(void)rootType;
*to = *from;
to->pUserData = nullptr;
if (from->pUserData) {
to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
}
}
void deepcopy_VkApplicationInfo(Allocator* alloc, VkStructureType rootType,
const VkApplicationInfo* from, VkApplicationInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pApplicationName = nullptr;
if (from->pApplicationName) {
to->pApplicationName = alloc->strDup(from->pApplicationName);
}
to->pEngineName = nullptr;
if (from->pEngineName) {
to->pEngineName = alloc->strDup(from->pEngineName);
}
}
void deepcopy_VkFormatProperties(Allocator* alloc, VkStructureType rootType,
const VkFormatProperties* from, VkFormatProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkImageFormatProperties(Allocator* alloc, VkStructureType rootType,
const VkImageFormatProperties* from,
VkImageFormatProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkExtent3D(alloc, rootType, &from->maxExtent, (VkExtent3D*)(&to->maxExtent));
}
void deepcopy_VkInstanceCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkInstanceCreateInfo* from, VkInstanceCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pApplicationInfo = nullptr;
if (from->pApplicationInfo) {
to->pApplicationInfo = (VkApplicationInfo*)alloc->alloc(sizeof(const VkApplicationInfo));
deepcopy_VkApplicationInfo(alloc, rootType, from->pApplicationInfo,
(VkApplicationInfo*)(to->pApplicationInfo));
}
to->ppEnabledLayerNames = nullptr;
if (from->ppEnabledLayerNames && from->enabledLayerCount) {
to->ppEnabledLayerNames =
alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
}
to->ppEnabledExtensionNames = nullptr;
if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
to->ppEnabledExtensionNames =
alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
}
}
void deepcopy_VkMemoryHeap(Allocator* alloc, VkStructureType rootType, const VkMemoryHeap* from,
VkMemoryHeap* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkMemoryType(Allocator* alloc, VkStructureType rootType, const VkMemoryType* from,
VkMemoryType* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPhysicalDeviceFeatures(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceFeatures* from,
VkPhysicalDeviceFeatures* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPhysicalDeviceLimits(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceLimits* from,
VkPhysicalDeviceLimits* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->maxComputeWorkGroupCount, from->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
memcpy(to->maxComputeWorkGroupSize, from->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
memcpy(to->maxViewportDimensions, from->maxViewportDimensions, 2 * sizeof(uint32_t));
memcpy(to->viewportBoundsRange, from->viewportBoundsRange, 2 * sizeof(float));
memcpy(to->pointSizeRange, from->pointSizeRange, 2 * sizeof(float));
memcpy(to->lineWidthRange, from->lineWidthRange, 2 * sizeof(float));
}
void deepcopy_VkPhysicalDeviceMemoryProperties(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceMemoryProperties* from,
VkPhysicalDeviceMemoryProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
deepcopy_VkMemoryType(alloc, rootType, from->memoryTypes + i,
(VkMemoryType*)(to->memoryTypes + i));
}
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
deepcopy_VkMemoryHeap(alloc, rootType, from->memoryHeaps + i,
(VkMemoryHeap*)(to->memoryHeaps + i));
}
}
void deepcopy_VkPhysicalDeviceSparseProperties(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceSparseProperties* from,
VkPhysicalDeviceSparseProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPhysicalDeviceProperties(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceProperties* from,
VkPhysicalDeviceProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->deviceName, from->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
deepcopy_VkPhysicalDeviceLimits(alloc, rootType, &from->limits,
(VkPhysicalDeviceLimits*)(&to->limits));
deepcopy_VkPhysicalDeviceSparseProperties(
alloc, rootType, &from->sparseProperties,
(VkPhysicalDeviceSparseProperties*)(&to->sparseProperties));
}
void deepcopy_VkQueueFamilyProperties(Allocator* alloc, VkStructureType rootType,
const VkQueueFamilyProperties* from,
VkQueueFamilyProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkExtent3D(alloc, rootType, &from->minImageTransferGranularity,
(VkExtent3D*)(&to->minImageTransferGranularity));
}
void deepcopy_VkDeviceQueueCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceQueueCreateInfo* from,
VkDeviceQueueCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pQueuePriorities = nullptr;
if (from->pQueuePriorities) {
to->pQueuePriorities =
(float*)alloc->dupArray(from->pQueuePriorities, from->queueCount * sizeof(const float));
}
}
void deepcopy_VkDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceCreateInfo* from, VkDeviceCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pQueueCreateInfos = nullptr;
if (from->pQueueCreateInfos) {
to->pQueueCreateInfos = (VkDeviceQueueCreateInfo*)alloc->alloc(
from->queueCreateInfoCount * sizeof(const VkDeviceQueueCreateInfo));
to->queueCreateInfoCount = from->queueCreateInfoCount;
for (uint32_t i = 0; i < (uint32_t)from->queueCreateInfoCount; ++i) {
deepcopy_VkDeviceQueueCreateInfo(
alloc, rootType, from->pQueueCreateInfos + i,
(VkDeviceQueueCreateInfo*)(to->pQueueCreateInfos + i));
}
}
}
to->ppEnabledLayerNames = nullptr;
if (from->ppEnabledLayerNames && from->enabledLayerCount) {
to->ppEnabledLayerNames =
alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
}
to->ppEnabledExtensionNames = nullptr;
if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
to->ppEnabledExtensionNames =
alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
}
to->pEnabledFeatures = nullptr;
if (from->pEnabledFeatures) {
to->pEnabledFeatures =
(VkPhysicalDeviceFeatures*)alloc->alloc(sizeof(const VkPhysicalDeviceFeatures));
deepcopy_VkPhysicalDeviceFeatures(alloc, rootType, from->pEnabledFeatures,
(VkPhysicalDeviceFeatures*)(to->pEnabledFeatures));
}
}
void deepcopy_VkExtensionProperties(Allocator* alloc, VkStructureType rootType,
const VkExtensionProperties* from, VkExtensionProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->extensionName, from->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
}
void deepcopy_VkLayerProperties(Allocator* alloc, VkStructureType rootType,
const VkLayerProperties* from, VkLayerProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->layerName, from->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
}
void deepcopy_VkSubmitInfo(Allocator* alloc, VkStructureType rootType, const VkSubmitInfo* from,
VkSubmitInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pWaitSemaphores = nullptr;
if (from->pWaitSemaphores) {
to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
}
to->pWaitDstStageMask = nullptr;
if (from->pWaitDstStageMask) {
to->pWaitDstStageMask = (VkPipelineStageFlags*)alloc->dupArray(
from->pWaitDstStageMask, from->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
}
to->pCommandBuffers = nullptr;
if (from->pCommandBuffers) {
to->pCommandBuffers = (VkCommandBuffer*)alloc->dupArray(
from->pCommandBuffers, from->commandBufferCount * sizeof(const VkCommandBuffer));
}
to->pSignalSemaphores = nullptr;
if (from->pSignalSemaphores) {
to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
}
}
void deepcopy_VkMappedMemoryRange(Allocator* alloc, VkStructureType rootType,
const VkMappedMemoryRange* from, VkMappedMemoryRange* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
const VkMemoryAllocateInfo* from, VkMemoryAllocateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkMemoryRequirements(Allocator* alloc, VkStructureType rootType,
const VkMemoryRequirements* from, VkMemoryRequirements* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkSparseMemoryBind(Allocator* alloc, VkStructureType rootType,
const VkSparseMemoryBind* from, VkSparseMemoryBind* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkSparseBufferMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
const VkSparseBufferMemoryBindInfo* from,
VkSparseBufferMemoryBindInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (from) {
to->pBinds = nullptr;
if (from->pBinds) {
to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
sizeof(const VkSparseMemoryBind));
to->bindCount = from->bindCount;
for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
(VkSparseMemoryBind*)(to->pBinds + i));
}
}
}
}
void deepcopy_VkSparseImageOpaqueMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
const VkSparseImageOpaqueMemoryBindInfo* from,
VkSparseImageOpaqueMemoryBindInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (from) {
to->pBinds = nullptr;
if (from->pBinds) {
to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
sizeof(const VkSparseMemoryBind));
to->bindCount = from->bindCount;
for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
(VkSparseMemoryBind*)(to->pBinds + i));
}
}
}
}
void deepcopy_VkImageSubresource(Allocator* alloc, VkStructureType rootType,
const VkImageSubresource* from, VkImageSubresource* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkSparseImageMemoryBind(Allocator* alloc, VkStructureType rootType,
const VkSparseImageMemoryBind* from,
VkSparseImageMemoryBind* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkImageSubresource(alloc, rootType, &from->subresource,
(VkImageSubresource*)(&to->subresource));
deepcopy_VkOffset3D(alloc, rootType, &from->offset, (VkOffset3D*)(&to->offset));
deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
}
void deepcopy_VkSparseImageMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
const VkSparseImageMemoryBindInfo* from,
VkSparseImageMemoryBindInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (from) {
to->pBinds = nullptr;
if (from->pBinds) {
to->pBinds = (VkSparseImageMemoryBind*)alloc->alloc(
from->bindCount * sizeof(const VkSparseImageMemoryBind));
to->bindCount = from->bindCount;
for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
deepcopy_VkSparseImageMemoryBind(alloc, rootType, from->pBinds + i,
(VkSparseImageMemoryBind*)(to->pBinds + i));
}
}
}
}
void deepcopy_VkBindSparseInfo(Allocator* alloc, VkStructureType rootType,
const VkBindSparseInfo* from, VkBindSparseInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pWaitSemaphores = nullptr;
if (from->pWaitSemaphores) {
to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
}
if (from) {
to->pBufferBinds = nullptr;
if (from->pBufferBinds) {
to->pBufferBinds = (VkSparseBufferMemoryBindInfo*)alloc->alloc(
from->bufferBindCount * sizeof(const VkSparseBufferMemoryBindInfo));
to->bufferBindCount = from->bufferBindCount;
for (uint32_t i = 0; i < (uint32_t)from->bufferBindCount; ++i) {
deepcopy_VkSparseBufferMemoryBindInfo(
alloc, rootType, from->pBufferBinds + i,
(VkSparseBufferMemoryBindInfo*)(to->pBufferBinds + i));
}
}
}
if (from) {
to->pImageOpaqueBinds = nullptr;
if (from->pImageOpaqueBinds) {
to->pImageOpaqueBinds = (VkSparseImageOpaqueMemoryBindInfo*)alloc->alloc(
from->imageOpaqueBindCount * sizeof(const VkSparseImageOpaqueMemoryBindInfo));
to->imageOpaqueBindCount = from->imageOpaqueBindCount;
for (uint32_t i = 0; i < (uint32_t)from->imageOpaqueBindCount; ++i) {
deepcopy_VkSparseImageOpaqueMemoryBindInfo(
alloc, rootType, from->pImageOpaqueBinds + i,
(VkSparseImageOpaqueMemoryBindInfo*)(to->pImageOpaqueBinds + i));
}
}
}
if (from) {
to->pImageBinds = nullptr;
if (from->pImageBinds) {
to->pImageBinds = (VkSparseImageMemoryBindInfo*)alloc->alloc(
from->imageBindCount * sizeof(const VkSparseImageMemoryBindInfo));
to->imageBindCount = from->imageBindCount;
for (uint32_t i = 0; i < (uint32_t)from->imageBindCount; ++i) {
deepcopy_VkSparseImageMemoryBindInfo(
alloc, rootType, from->pImageBinds + i,
(VkSparseImageMemoryBindInfo*)(to->pImageBinds + i));
}
}
}
to->pSignalSemaphores = nullptr;
if (from->pSignalSemaphores) {
to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
}
}
void deepcopy_VkSparseImageFormatProperties(Allocator* alloc, VkStructureType rootType,
const VkSparseImageFormatProperties* from,
VkSparseImageFormatProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkExtent3D(alloc, rootType, &from->imageGranularity,
(VkExtent3D*)(&to->imageGranularity));
}
void deepcopy_VkSparseImageMemoryRequirements(Allocator* alloc, VkStructureType rootType,
const VkSparseImageMemoryRequirements* from,
VkSparseImageMemoryRequirements* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkSparseImageFormatProperties(alloc, rootType, &from->formatProperties,
(VkSparseImageFormatProperties*)(&to->formatProperties));
}
void deepcopy_VkFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkFenceCreateInfo* from, VkFenceCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkSemaphoreCreateInfo* from, VkSemaphoreCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkEventCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkEventCreateInfo* from, VkEventCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkQueryPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkQueryPoolCreateInfo* from, VkQueryPoolCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkBufferCreateInfo* from, VkBufferCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pQueueFamilyIndices = nullptr;
if (from->pQueueFamilyIndices) {
to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
}
}
void deepcopy_VkBufferViewCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkBufferViewCreateInfo* from,
VkBufferViewCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkImageCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkImageCreateInfo* from, VkImageCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
to->pQueueFamilyIndices = nullptr;
if (from->pQueueFamilyIndices) {
to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
}
}
void deepcopy_VkSubresourceLayout(Allocator* alloc, VkStructureType rootType,
const VkSubresourceLayout* from, VkSubresourceLayout* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkComponentMapping(Allocator* alloc, VkStructureType rootType,
const VkComponentMapping* from, VkComponentMapping* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkImageViewCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkImageViewCreateInfo* from, VkImageViewCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkComponentMapping(alloc, rootType, &from->components,
(VkComponentMapping*)(&to->components));
deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
(VkImageSubresourceRange*)(&to->subresourceRange));
}
void deepcopy_VkShaderModuleCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkShaderModuleCreateInfo* from,
VkShaderModuleCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pCode = nullptr;
if (from->pCode) {
to->pCode =
(uint32_t*)alloc->dupArray(from->pCode, (from->codeSize / 4) * sizeof(const uint32_t));
}
}
void deepcopy_VkPipelineCacheCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineCacheCreateInfo* from,
VkPipelineCacheCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pInitialData = nullptr;
if (from->pInitialData) {
to->pInitialData = (void*)alloc->dupArray(from->pInitialData,
from->initialDataSize * sizeof(const uint8_t));
}
}
void deepcopy_VkSpecializationMapEntry(Allocator* alloc, VkStructureType rootType,
const VkSpecializationMapEntry* from,
VkSpecializationMapEntry* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkSpecializationInfo(Allocator* alloc, VkStructureType rootType,
const VkSpecializationInfo* from, VkSpecializationInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (from) {
to->pMapEntries = nullptr;
if (from->pMapEntries) {
to->pMapEntries = (VkSpecializationMapEntry*)alloc->alloc(
from->mapEntryCount * sizeof(const VkSpecializationMapEntry));
to->mapEntryCount = from->mapEntryCount;
for (uint32_t i = 0; i < (uint32_t)from->mapEntryCount; ++i) {
deepcopy_VkSpecializationMapEntry(alloc, rootType, from->pMapEntries + i,
(VkSpecializationMapEntry*)(to->pMapEntries + i));
}
}
}
to->pData = nullptr;
if (from->pData) {
to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
}
}
void deepcopy_VkPipelineShaderStageCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineShaderStageCreateInfo* from,
VkPipelineShaderStageCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pName = nullptr;
if (from->pName) {
to->pName = alloc->strDup(from->pName);
}
to->pSpecializationInfo = nullptr;
if (from->pSpecializationInfo) {
to->pSpecializationInfo =
(VkSpecializationInfo*)alloc->alloc(sizeof(const VkSpecializationInfo));
deepcopy_VkSpecializationInfo(alloc, rootType, from->pSpecializationInfo,
(VkSpecializationInfo*)(to->pSpecializationInfo));
}
}
void deepcopy_VkComputePipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkComputePipelineCreateInfo* from,
VkComputePipelineCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkPipelineShaderStageCreateInfo(alloc, rootType, &from->stage,
(VkPipelineShaderStageCreateInfo*)(&to->stage));
}
void deepcopy_VkVertexInputBindingDescription(Allocator* alloc, VkStructureType rootType,
const VkVertexInputBindingDescription* from,
VkVertexInputBindingDescription* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkVertexInputAttributeDescription(Allocator* alloc, VkStructureType rootType,
const VkVertexInputAttributeDescription* from,
VkVertexInputAttributeDescription* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPipelineVertexInputStateCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineVertexInputStateCreateInfo* from,
VkPipelineVertexInputStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pVertexBindingDescriptions = nullptr;
if (from->pVertexBindingDescriptions) {
to->pVertexBindingDescriptions = (VkVertexInputBindingDescription*)alloc->alloc(
from->vertexBindingDescriptionCount *
sizeof(const VkVertexInputBindingDescription));
to->vertexBindingDescriptionCount = from->vertexBindingDescriptionCount;
for (uint32_t i = 0; i < (uint32_t)from->vertexBindingDescriptionCount; ++i) {
deepcopy_VkVertexInputBindingDescription(
alloc, rootType, from->pVertexBindingDescriptions + i,
(VkVertexInputBindingDescription*)(to->pVertexBindingDescriptions + i));
}
}
}
if (from) {
to->pVertexAttributeDescriptions = nullptr;
if (from->pVertexAttributeDescriptions) {
to->pVertexAttributeDescriptions = (VkVertexInputAttributeDescription*)alloc->alloc(
from->vertexAttributeDescriptionCount *
sizeof(const VkVertexInputAttributeDescription));
to->vertexAttributeDescriptionCount = from->vertexAttributeDescriptionCount;
for (uint32_t i = 0; i < (uint32_t)from->vertexAttributeDescriptionCount; ++i) {
deepcopy_VkVertexInputAttributeDescription(
alloc, rootType, from->pVertexAttributeDescriptions + i,
(VkVertexInputAttributeDescription*)(to->pVertexAttributeDescriptions + i));
}
}
}
}
void deepcopy_VkPipelineInputAssemblyStateCreateInfo(
Allocator* alloc, VkStructureType rootType, const VkPipelineInputAssemblyStateCreateInfo* from,
VkPipelineInputAssemblyStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkPipelineTessellationStateCreateInfo(
Allocator* alloc, VkStructureType rootType, const VkPipelineTessellationStateCreateInfo* from,
VkPipelineTessellationStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkViewport(Allocator* alloc, VkStructureType rootType, const VkViewport* from,
VkViewport* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPipelineViewportStateCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineViewportStateCreateInfo* from,
VkPipelineViewportStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pViewports = nullptr;
if (from->pViewports) {
to->pViewports =
(VkViewport*)alloc->alloc(from->viewportCount * sizeof(const VkViewport));
to->viewportCount = from->viewportCount;
for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
deepcopy_VkViewport(alloc, rootType, from->pViewports + i,
(VkViewport*)(to->pViewports + i));
}
}
}
if (from) {
to->pScissors = nullptr;
if (from->pScissors) {
to->pScissors = (VkRect2D*)alloc->alloc(from->scissorCount * sizeof(const VkRect2D));
to->scissorCount = from->scissorCount;
for (uint32_t i = 0; i < (uint32_t)from->scissorCount; ++i) {
deepcopy_VkRect2D(alloc, rootType, from->pScissors + i,
(VkRect2D*)(to->pScissors + i));
}
}
}
}
void deepcopy_VkPipelineRasterizationStateCreateInfo(
Allocator* alloc, VkStructureType rootType, const VkPipelineRasterizationStateCreateInfo* from,
VkPipelineRasterizationStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkPipelineMultisampleStateCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineMultisampleStateCreateInfo* from,
VkPipelineMultisampleStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pSampleMask = nullptr;
if (from->pSampleMask) {
to->pSampleMask = (VkSampleMask*)alloc->dupArray(
from->pSampleMask,
(((from->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
}
}
void deepcopy_VkStencilOpState(Allocator* alloc, VkStructureType rootType,
const VkStencilOpState* from, VkStencilOpState* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPipelineDepthStencilStateCreateInfo(
Allocator* alloc, VkStructureType rootType, const VkPipelineDepthStencilStateCreateInfo* from,
VkPipelineDepthStencilStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkStencilOpState(alloc, rootType, &from->front, (VkStencilOpState*)(&to->front));
deepcopy_VkStencilOpState(alloc, rootType, &from->back, (VkStencilOpState*)(&to->back));
}
void deepcopy_VkPipelineColorBlendAttachmentState(Allocator* alloc, VkStructureType rootType,
const VkPipelineColorBlendAttachmentState* from,
VkPipelineColorBlendAttachmentState* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPipelineColorBlendStateCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineColorBlendStateCreateInfo* from,
VkPipelineColorBlendStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pAttachments = nullptr;
if (from->pAttachments) {
to->pAttachments = (VkPipelineColorBlendAttachmentState*)alloc->alloc(
from->attachmentCount * sizeof(const VkPipelineColorBlendAttachmentState));
to->attachmentCount = from->attachmentCount;
for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
deepcopy_VkPipelineColorBlendAttachmentState(
alloc, rootType, from->pAttachments + i,
(VkPipelineColorBlendAttachmentState*)(to->pAttachments + i));
}
}
}
memcpy(to->blendConstants, from->blendConstants, 4 * sizeof(float));
}
void deepcopy_VkPipelineDynamicStateCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineDynamicStateCreateInfo* from,
VkPipelineDynamicStateCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pDynamicStates = nullptr;
if (from->pDynamicStates) {
to->pDynamicStates = (VkDynamicState*)alloc->dupArray(
from->pDynamicStates, from->dynamicStateCount * sizeof(const VkDynamicState));
}
}
void deepcopy_VkGraphicsPipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkGraphicsPipelineCreateInfo* from,
VkGraphicsPipelineCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pStages = nullptr;
if (from->pStages) {
to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
to->stageCount = from->stageCount;
for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
deepcopy_VkPipelineShaderStageCreateInfo(
alloc, rootType, from->pStages + i,
(VkPipelineShaderStageCreateInfo*)(to->pStages + i));
}
}
}
to->pVertexInputState = nullptr;
if (from->pVertexInputState) {
to->pVertexInputState = (VkPipelineVertexInputStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineVertexInputStateCreateInfo));
deepcopy_VkPipelineVertexInputStateCreateInfo(
alloc, rootType, from->pVertexInputState,
(VkPipelineVertexInputStateCreateInfo*)(to->pVertexInputState));
}
to->pInputAssemblyState = nullptr;
if (from->pInputAssemblyState) {
to->pInputAssemblyState = (VkPipelineInputAssemblyStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineInputAssemblyStateCreateInfo));
deepcopy_VkPipelineInputAssemblyStateCreateInfo(
alloc, rootType, from->pInputAssemblyState,
(VkPipelineInputAssemblyStateCreateInfo*)(to->pInputAssemblyState));
}
to->pTessellationState = nullptr;
if (from->pTessellationState) {
to->pTessellationState = (VkPipelineTessellationStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineTessellationStateCreateInfo));
deepcopy_VkPipelineTessellationStateCreateInfo(
alloc, rootType, from->pTessellationState,
(VkPipelineTessellationStateCreateInfo*)(to->pTessellationState));
}
to->pViewportState = nullptr;
if (from->pViewportState) {
to->pViewportState = (VkPipelineViewportStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineViewportStateCreateInfo));
deepcopy_VkPipelineViewportStateCreateInfo(
alloc, rootType, from->pViewportState,
(VkPipelineViewportStateCreateInfo*)(to->pViewportState));
}
to->pRasterizationState = nullptr;
if (from->pRasterizationState) {
to->pRasterizationState = (VkPipelineRasterizationStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineRasterizationStateCreateInfo));
deepcopy_VkPipelineRasterizationStateCreateInfo(
alloc, rootType, from->pRasterizationState,
(VkPipelineRasterizationStateCreateInfo*)(to->pRasterizationState));
}
to->pMultisampleState = nullptr;
if (from->pMultisampleState) {
to->pMultisampleState = (VkPipelineMultisampleStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineMultisampleStateCreateInfo));
deepcopy_VkPipelineMultisampleStateCreateInfo(
alloc, rootType, from->pMultisampleState,
(VkPipelineMultisampleStateCreateInfo*)(to->pMultisampleState));
}
to->pDepthStencilState = nullptr;
if (from->pDepthStencilState) {
to->pDepthStencilState = (VkPipelineDepthStencilStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineDepthStencilStateCreateInfo));
deepcopy_VkPipelineDepthStencilStateCreateInfo(
alloc, rootType, from->pDepthStencilState,
(VkPipelineDepthStencilStateCreateInfo*)(to->pDepthStencilState));
}
to->pColorBlendState = nullptr;
if (from->pColorBlendState) {
to->pColorBlendState = (VkPipelineColorBlendStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineColorBlendStateCreateInfo));
deepcopy_VkPipelineColorBlendStateCreateInfo(
alloc, rootType, from->pColorBlendState,
(VkPipelineColorBlendStateCreateInfo*)(to->pColorBlendState));
}
to->pDynamicState = nullptr;
if (from->pDynamicState) {
to->pDynamicState = (VkPipelineDynamicStateCreateInfo*)alloc->alloc(
sizeof(const VkPipelineDynamicStateCreateInfo));
deepcopy_VkPipelineDynamicStateCreateInfo(
alloc, rootType, from->pDynamicState,
(VkPipelineDynamicStateCreateInfo*)(to->pDynamicState));
}
}
void deepcopy_VkPushConstantRange(Allocator* alloc, VkStructureType rootType,
const VkPushConstantRange* from, VkPushConstantRange* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkPipelineLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkPipelineLayoutCreateInfo* from,
VkPipelineLayoutCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pSetLayouts = nullptr;
if (from->pSetLayouts) {
to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
from->pSetLayouts, from->setLayoutCount * sizeof(const VkDescriptorSetLayout));
}
if (from) {
to->pPushConstantRanges = nullptr;
if (from->pPushConstantRanges) {
to->pPushConstantRanges = (VkPushConstantRange*)alloc->alloc(
from->pushConstantRangeCount * sizeof(const VkPushConstantRange));
to->pushConstantRangeCount = from->pushConstantRangeCount;
for (uint32_t i = 0; i < (uint32_t)from->pushConstantRangeCount; ++i) {
deepcopy_VkPushConstantRange(alloc, rootType, from->pPushConstantRanges + i,
(VkPushConstantRange*)(to->pPushConstantRanges + i));
}
}
}
}
void deepcopy_VkSamplerCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkSamplerCreateInfo* from, VkSamplerCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkCopyDescriptorSet(Allocator* alloc, VkStructureType rootType,
const VkCopyDescriptorSet* from, VkCopyDescriptorSet* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkDescriptorBufferInfo(Allocator* alloc, VkStructureType rootType,
const VkDescriptorBufferInfo* from,
VkDescriptorBufferInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkDescriptorImageInfo(Allocator* alloc, VkStructureType rootType,
const VkDescriptorImageInfo* from, VkDescriptorImageInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkDescriptorPoolSize(Allocator* alloc, VkStructureType rootType,
const VkDescriptorPoolSize* from, VkDescriptorPoolSize* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkDescriptorPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkDescriptorPoolCreateInfo* from,
VkDescriptorPoolCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pPoolSizes = nullptr;
if (from->pPoolSizes) {
to->pPoolSizes = (VkDescriptorPoolSize*)alloc->alloc(
from->poolSizeCount * sizeof(const VkDescriptorPoolSize));
to->poolSizeCount = from->poolSizeCount;
for (uint32_t i = 0; i < (uint32_t)from->poolSizeCount; ++i) {
deepcopy_VkDescriptorPoolSize(alloc, rootType, from->pPoolSizes + i,
(VkDescriptorPoolSize*)(to->pPoolSizes + i));
}
}
}
}
void deepcopy_VkDescriptorSetAllocateInfo(Allocator* alloc, VkStructureType rootType,
const VkDescriptorSetAllocateInfo* from,
VkDescriptorSetAllocateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pSetLayouts = nullptr;
if (from->pSetLayouts) {
to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
from->pSetLayouts, from->descriptorSetCount * sizeof(const VkDescriptorSetLayout));
}
}
void deepcopy_VkDescriptorSetLayoutBinding(Allocator* alloc, VkStructureType rootType,
const VkDescriptorSetLayoutBinding* from,
VkDescriptorSetLayoutBinding* to) {
(void)alloc;
(void)rootType;
*to = *from;
to->pImmutableSamplers = nullptr;
if (from->pImmutableSamplers) {
to->pImmutableSamplers = (VkSampler*)alloc->dupArray(
from->pImmutableSamplers, from->descriptorCount * sizeof(const VkSampler));
}
}
void deepcopy_VkDescriptorSetLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkDescriptorSetLayoutCreateInfo* from,
VkDescriptorSetLayoutCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pBindings = nullptr;
if (from->pBindings) {
to->pBindings = (VkDescriptorSetLayoutBinding*)alloc->alloc(
from->bindingCount * sizeof(const VkDescriptorSetLayoutBinding));
to->bindingCount = from->bindingCount;
for (uint32_t i = 0; i < (uint32_t)from->bindingCount; ++i) {
deepcopy_VkDescriptorSetLayoutBinding(
alloc, rootType, from->pBindings + i,
(VkDescriptorSetLayoutBinding*)(to->pBindings + i));
}
}
}
}
void deepcopy_VkWriteDescriptorSet(Allocator* alloc, VkStructureType rootType,
const VkWriteDescriptorSet* from, VkWriteDescriptorSet* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pImageInfo = nullptr;
if (from->pImageInfo) {
to->pImageInfo = (VkDescriptorImageInfo*)alloc->alloc(
from->descriptorCount * sizeof(const VkDescriptorImageInfo));
to->descriptorCount = from->descriptorCount;
for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
deepcopy_VkDescriptorImageInfo(alloc, rootType, from->pImageInfo + i,
(VkDescriptorImageInfo*)(to->pImageInfo + i));
}
}
}
if (from) {
to->pBufferInfo = nullptr;
if (from->pBufferInfo) {
to->pBufferInfo = (VkDescriptorBufferInfo*)alloc->alloc(
from->descriptorCount * sizeof(const VkDescriptorBufferInfo));
to->descriptorCount = from->descriptorCount;
for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
deepcopy_VkDescriptorBufferInfo(alloc, rootType, from->pBufferInfo + i,
(VkDescriptorBufferInfo*)(to->pBufferInfo + i));
}
}
}
to->pTexelBufferView = nullptr;
if (from->pTexelBufferView) {
to->pTexelBufferView = (VkBufferView*)alloc->dupArray(
from->pTexelBufferView, from->descriptorCount * sizeof(const VkBufferView));
}
}
void deepcopy_VkAttachmentDescription(Allocator* alloc, VkStructureType rootType,
const VkAttachmentDescription* from,
VkAttachmentDescription* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkAttachmentReference(Allocator* alloc, VkStructureType rootType,
const VkAttachmentReference* from, VkAttachmentReference* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkFramebufferCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkFramebufferCreateInfo* from,
VkFramebufferCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pAttachments = nullptr;
if (from->pAttachments) {
to->pAttachments = (VkImageView*)alloc->dupArray(
from->pAttachments, from->attachmentCount * sizeof(const VkImageView));
}
}
void deepcopy_VkSubpassDescription(Allocator* alloc, VkStructureType rootType,
const VkSubpassDescription* from, VkSubpassDescription* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (from) {
to->pInputAttachments = nullptr;
if (from->pInputAttachments) {
to->pInputAttachments = (VkAttachmentReference*)alloc->alloc(
from->inputAttachmentCount * sizeof(const VkAttachmentReference));
to->inputAttachmentCount = from->inputAttachmentCount;
for (uint32_t i = 0; i < (uint32_t)from->inputAttachmentCount; ++i) {
deepcopy_VkAttachmentReference(alloc, rootType, from->pInputAttachments + i,
(VkAttachmentReference*)(to->pInputAttachments + i));
}
}
}
if (from) {
to->pColorAttachments = nullptr;
if (from->pColorAttachments) {
to->pColorAttachments = (VkAttachmentReference*)alloc->alloc(
from->colorAttachmentCount * sizeof(const VkAttachmentReference));
to->colorAttachmentCount = from->colorAttachmentCount;
for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
deepcopy_VkAttachmentReference(alloc, rootType, from->pColorAttachments + i,
(VkAttachmentReference*)(to->pColorAttachments + i));
}
}
}
if (from) {
to->pResolveAttachments = nullptr;
if (from->pResolveAttachments) {
to->pResolveAttachments = (VkAttachmentReference*)alloc->alloc(
from->colorAttachmentCount * sizeof(const VkAttachmentReference));
to->colorAttachmentCount = from->colorAttachmentCount;
for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
deepcopy_VkAttachmentReference(
alloc, rootType, from->pResolveAttachments + i,
(VkAttachmentReference*)(to->pResolveAttachments + i));
}
}
}
to->pDepthStencilAttachment = nullptr;
if (from->pDepthStencilAttachment) {
to->pDepthStencilAttachment =
(VkAttachmentReference*)alloc->alloc(sizeof(const VkAttachmentReference));
deepcopy_VkAttachmentReference(alloc, rootType, from->pDepthStencilAttachment,
(VkAttachmentReference*)(to->pDepthStencilAttachment));
}
to->pPreserveAttachments = nullptr;
if (from->pPreserveAttachments) {
to->pPreserveAttachments = (uint32_t*)alloc->dupArray(
from->pPreserveAttachments, from->preserveAttachmentCount * sizeof(const uint32_t));
}
}
void deepcopy_VkSubpassDependency(Allocator* alloc, VkStructureType rootType,
const VkSubpassDependency* from, VkSubpassDependency* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkRenderPassCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkRenderPassCreateInfo* from,
VkRenderPassCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pAttachments = nullptr;
if (from->pAttachments) {
to->pAttachments = (VkAttachmentDescription*)alloc->alloc(
from->attachmentCount * sizeof(const VkAttachmentDescription));
to->attachmentCount = from->attachmentCount;
for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
deepcopy_VkAttachmentDescription(alloc, rootType, from->pAttachments + i,
(VkAttachmentDescription*)(to->pAttachments + i));
}
}
}
if (from) {
to->pSubpasses = nullptr;
if (from->pSubpasses) {
to->pSubpasses = (VkSubpassDescription*)alloc->alloc(
from->subpassCount * sizeof(const VkSubpassDescription));
to->subpassCount = from->subpassCount;
for (uint32_t i = 0; i < (uint32_t)from->subpassCount; ++i) {
deepcopy_VkSubpassDescription(alloc, rootType, from->pSubpasses + i,
(VkSubpassDescription*)(to->pSubpasses + i));
}
}
}
if (from) {
to->pDependencies = nullptr;
if (from->pDependencies) {
to->pDependencies = (VkSubpassDependency*)alloc->alloc(
from->dependencyCount * sizeof(const VkSubpassDependency));
to->dependencyCount = from->dependencyCount;
for (uint32_t i = 0; i < (uint32_t)from->dependencyCount; ++i) {
deepcopy_VkSubpassDependency(alloc, rootType, from->pDependencies + i,
(VkSubpassDependency*)(to->pDependencies + i));
}
}
}
}
void deepcopy_VkCommandPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
const VkCommandPoolCreateInfo* from,
VkCommandPoolCreateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkCommandBufferAllocateInfo(Allocator* alloc, VkStructureType rootType,
const VkCommandBufferAllocateInfo* from,
VkCommandBufferAllocateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkCommandBufferInheritanceInfo(Allocator* alloc, VkStructureType rootType,
const VkCommandBufferInheritanceInfo* from,
VkCommandBufferInheritanceInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
const VkCommandBufferBeginInfo* from,
VkCommandBufferBeginInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pInheritanceInfo = nullptr;
if (from->pInheritanceInfo) {
to->pInheritanceInfo = (VkCommandBufferInheritanceInfo*)alloc->alloc(
sizeof(const VkCommandBufferInheritanceInfo));
deepcopy_VkCommandBufferInheritanceInfo(
alloc, rootType, from->pInheritanceInfo,
(VkCommandBufferInheritanceInfo*)(to->pInheritanceInfo));
}
}
void deepcopy_VkBufferCopy(Allocator* alloc, VkStructureType rootType, const VkBufferCopy* from,
VkBufferCopy* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkImageSubresourceLayers(Allocator* alloc, VkStructureType rootType,
const VkImageSubresourceLayers* from,
VkImageSubresourceLayers* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkBufferImageCopy(Allocator* alloc, VkStructureType rootType,
const VkBufferImageCopy* from, VkBufferImageCopy* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
(VkImageSubresourceLayers*)(&to->imageSubresource));
deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
}
void deepcopy_VkClearColorValue(Allocator* alloc, VkStructureType rootType,
const VkClearColorValue* from, VkClearColorValue* to) {
(void)alloc;
(void)rootType;
*to = *from;
memcpy(to->float32, from->float32, 4 * sizeof(float));
memcpy(to->int32, from->int32, 4 * sizeof(int32_t));
memcpy(to->uint32, from->uint32, 4 * sizeof(uint32_t));
}
void deepcopy_VkClearDepthStencilValue(Allocator* alloc, VkStructureType rootType,
const VkClearDepthStencilValue* from,
VkClearDepthStencilValue* to) {
(void)alloc;
(void)rootType;
*to = *from;
}
void deepcopy_VkClearValue(Allocator* alloc, VkStructureType rootType, const VkClearValue* from,
VkClearValue* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkClearColorValue(alloc, rootType, &from->color, (VkClearColorValue*)(&to->color));
deepcopy_VkClearDepthStencilValue(alloc, rootType, &from->depthStencil,
(VkClearDepthStencilValue*)(&to->depthStencil));
}
void deepcopy_VkClearAttachment(Allocator* alloc, VkStructureType rootType,
const VkClearAttachment* from, VkClearAttachment* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkClearValue(alloc, rootType, &from->clearValue, (VkClearValue*)(&to->clearValue));
}
void deepcopy_VkClearRect(Allocator* alloc, VkStructureType rootType, const VkClearRect* from,
VkClearRect* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkRect2D(alloc, rootType, &from->rect, (VkRect2D*)(&to->rect));
}
void deepcopy_VkImageBlit(Allocator* alloc, VkStructureType rootType, const VkImageBlit* from,
VkImageBlit* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
(VkImageSubresourceLayers*)(&to->srcSubresource));
for (uint32_t i = 0; i < (uint32_t)2; ++i) {
deepcopy_VkOffset3D(alloc, rootType, from->srcOffsets + i,
(VkOffset3D*)(to->srcOffsets + i));
}
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
(VkImageSubresourceLayers*)(&to->dstSubresource));
for (uint32_t i = 0; i < (uint32_t)2; ++i) {
deepcopy_VkOffset3D(alloc, rootType, from->dstOffsets + i,
(VkOffset3D*)(to->dstOffsets + i));
}
}
void deepcopy_VkImageCopy(Allocator* alloc, VkStructureType rootType, const VkImageCopy* from,
VkImageCopy* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
(VkImageSubresourceLayers*)(&to->srcSubresource));
deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
(VkImageSubresourceLayers*)(&to->dstSubresource));
deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
}
void deepcopy_VkImageResolve(Allocator* alloc, VkStructureType rootType, const VkImageResolve* from,
VkImageResolve* to) {
(void)alloc;
(void)rootType;
*to = *from;
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
(VkImageSubresourceLayers*)(&to->srcSubresource));
deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
(VkImageSubresourceLayers*)(&to->dstSubresource));
deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
}
void deepcopy_VkRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
const VkRenderPassBeginInfo* from, VkRenderPassBeginInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
if (from) {
to->pClearValues = nullptr;
if (from->pClearValues) {
to->pClearValues =
(VkClearValue*)alloc->alloc(from->clearValueCount * sizeof(const VkClearValue));
to->clearValueCount = from->clearValueCount;
for (uint32_t i = 0; i < (uint32_t)from->clearValueCount; ++i) {
deepcopy_VkClearValue(alloc, rootType, from->pClearValues + i,
(VkClearValue*)(to->pClearValues + i));
}
}
}
}
#endif
#ifdef VK_VERSION_1_1
void deepcopy_VkPhysicalDeviceSubgroupProperties(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDeviceSubgroupProperties* from,
VkPhysicalDeviceSubgroupProperties* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBindBufferMemoryInfo(Allocator* alloc, VkStructureType rootType,
const VkBindBufferMemoryInfo* from,
VkBindBufferMemoryInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBindImageMemoryInfo(Allocator* alloc, VkStructureType rootType,
const VkBindImageMemoryInfo* from, VkBindImageMemoryInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkPhysicalDevice16BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
const VkPhysicalDevice16BitStorageFeatures* from,
VkPhysicalDevice16BitStorageFeatures* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkMemoryDedicatedRequirements(Allocator* alloc, VkStructureType rootType,
const VkMemoryDedicatedRequirements* from,
VkMemoryDedicatedRequirements* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkMemoryDedicatedAllocateInfo(Allocator* alloc, VkStructureType rootType,
const VkMemoryDedicatedAllocateInfo* from,
VkMemoryDedicatedAllocateInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkMemoryAllocateFlagsInfo(Allocator* alloc, VkStructureType rootType,
const VkMemoryAllocateFlagsInfo* from,
VkMemoryAllocateFlagsInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkDeviceGroupRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceGroupRenderPassBeginInfo* from,
VkDeviceGroupRenderPassBeginInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
if (from) {
to->pDeviceRenderAreas = nullptr;
if (from->pDeviceRenderAreas) {
to->pDeviceRenderAreas =
(VkRect2D*)alloc->alloc(from->deviceRenderAreaCount * sizeof(const VkRect2D));
to->deviceRenderAreaCount = from->deviceRenderAreaCount;
for (uint32_t i = 0; i < (uint32_t)from->deviceRenderAreaCount; ++i) {
deepcopy_VkRect2D(alloc, rootType, from->pDeviceRenderAreas + i,
(VkRect2D*)(to->pDeviceRenderAreas + i));
}
}
}
}
void deepcopy_VkDeviceGroupCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceGroupCommandBufferBeginInfo* from,
VkDeviceGroupCommandBufferBeginInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkDeviceGroupSubmitInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceGroupSubmitInfo* from,
VkDeviceGroupSubmitInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
to->pWaitSemaphoreDeviceIndices = nullptr;
if (from->pWaitSemaphoreDeviceIndices) {
to->pWaitSemaphoreDeviceIndices = (uint32_t*)alloc->dupArray(
from->pWaitSemaphoreDeviceIndices, from->waitSemaphoreCount * sizeof(const uint32_t));
}
to->pCommandBufferDeviceMasks = nullptr;
if (from->pCommandBufferDeviceMasks) {
to->pCommandBufferDeviceMasks = (uint32_t*)alloc->dupArray(
from->pCommandBufferDeviceMasks, from->commandBufferCount * sizeof(const uint32_t));
}
to->pSignalSemaphoreDeviceIndices = nullptr;
if (from->pSignalSemaphoreDeviceIndices) {
to->pSignalSemaphoreDeviceIndices =
(uint32_t*)alloc->dupArray(from->pSignalSemaphoreDeviceIndices,
from->signalSemaphoreCount * sizeof(const uint32_t));
}
}
void deepcopy_VkDeviceGroupBindSparseInfo(Allocator* alloc, VkStructureType rootType,
const VkDeviceGroupBindSparseInfo* from,
VkDeviceGroupBindSparseInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
}
to->pNext = nullptr;
if (pNext_size) {
to->pNext = (void*)alloc->alloc(pNext_size);
deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
}
}
void deepcopy_VkBindBufferMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
const VkBindBufferMemoryDeviceGroupInfo* from,
VkBindBufferMemoryDeviceGroupInfo* to) {
(void)alloc;
(void)rootType;
*to = *from;
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = from->sType;
}
const void* from_pNext = from;
size_t pNext_size = 0u;
while (!pNext_size && from_pNext) {
from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);