blob: b24484f545d35e097d43ffdf20b69b51ecf88e79 [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_marshaling_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_marshaling_guest.h"
#include <cstring>
#include "goldfish_vk_extension_structs_guest.h"
#include "goldfish_vk_private_defs.h"
namespace gfxstream {
namespace vk {
void marshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
const void* structExtension);
void unmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
void* structExtension_out);
#ifdef VK_VERSION_1_0
void marshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkExtent2D* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
}
void unmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkExtent2D* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
}
void marshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkExtent3D* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->depth, sizeof(uint32_t));
}
void unmarshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkExtent3D* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->depth, sizeof(uint32_t));
}
void marshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkOffset2D* forMarshaling) {
(void)rootType;
vkStream->write((int32_t*)&forMarshaling->x, sizeof(int32_t));
vkStream->write((int32_t*)&forMarshaling->y, sizeof(int32_t));
}
void unmarshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkOffset2D* forUnmarshaling) {
(void)rootType;
vkStream->read((int32_t*)&forUnmarshaling->x, sizeof(int32_t));
vkStream->read((int32_t*)&forUnmarshaling->y, sizeof(int32_t));
}
void marshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkOffset3D* forMarshaling) {
(void)rootType;
vkStream->write((int32_t*)&forMarshaling->x, sizeof(int32_t));
vkStream->write((int32_t*)&forMarshaling->y, sizeof(int32_t));
vkStream->write((int32_t*)&forMarshaling->z, sizeof(int32_t));
}
void unmarshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkOffset3D* forUnmarshaling) {
(void)rootType;
vkStream->read((int32_t*)&forUnmarshaling->x, sizeof(int32_t));
vkStream->read((int32_t*)&forUnmarshaling->y, sizeof(int32_t));
vkStream->read((int32_t*)&forUnmarshaling->z, sizeof(int32_t));
}
void marshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkRect2D* forMarshaling) {
(void)rootType;
marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->offset));
marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->extent));
}
void unmarshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkRect2D* forUnmarshaling) {
(void)rootType;
unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->offset));
unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->extent));
}
void marshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBaseInStructure* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
}
void unmarshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBaseInStructure* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
}
void marshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBaseOutStructure* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
}
void unmarshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBaseOutStructure* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
}
void marshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBufferMemoryBarrier* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
}
void unmarshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBufferMemoryBarrier* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
(VkBuffer*)&forUnmarshaling->buffer, 1);
vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
}
void marshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkDispatchIndirectCommand* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->x, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->y, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->z, sizeof(uint32_t));
}
void unmarshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkDispatchIndirectCommand* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->x, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->y, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->z, sizeof(uint32_t));
}
void marshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkDrawIndexedIndirectCommand* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->firstIndex, sizeof(uint32_t));
vkStream->write((int32_t*)&forMarshaling->vertexOffset, sizeof(int32_t));
vkStream->write((uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
}
void unmarshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkDrawIndexedIndirectCommand* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->indexCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->instanceCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->firstIndex, sizeof(uint32_t));
vkStream->read((int32_t*)&forUnmarshaling->vertexOffset, sizeof(int32_t));
vkStream->read((uint32_t*)&forUnmarshaling->firstInstance, sizeof(uint32_t));
}
void marshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkDrawIndirectCommand* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
}
void unmarshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkDrawIndirectCommand* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->vertexCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->instanceCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->firstVertex, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->firstInstance, sizeof(uint32_t));
}
void marshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageSubresourceRange* forMarshaling) {
(void)rootType;
vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
vkStream->write((uint32_t*)&forMarshaling->baseMipLevel, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->levelCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
}
void unmarshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageSubresourceRange* forUnmarshaling) {
(void)rootType;
vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
vkStream->read((uint32_t*)&forUnmarshaling->baseMipLevel, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->levelCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->baseArrayLayer, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
}
void marshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageMemoryBarrier* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
vkStream->write((VkImageLayout*)&forMarshaling->oldLayout, sizeof(VkImageLayout));
vkStream->write((VkImageLayout*)&forMarshaling->newLayout, sizeof(VkImageLayout));
vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
marshal_VkImageSubresourceRange(vkStream, rootType,
(VkImageSubresourceRange*)(&forMarshaling->subresourceRange));
}
void unmarshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageMemoryBarrier* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
vkStream->read((VkImageLayout*)&forUnmarshaling->oldLayout, sizeof(VkImageLayout));
vkStream->read((VkImageLayout*)&forUnmarshaling->newLayout, sizeof(VkImageLayout));
vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
(VkImage*)&forUnmarshaling->image, 1);
unmarshal_VkImageSubresourceRange(
vkStream, rootType, (VkImageSubresourceRange*)(&forUnmarshaling->subresourceRange));
}
void marshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMemoryBarrier* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
}
void unmarshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMemoryBarrier* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
}
void marshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPipelineCacheHeaderVersionOne* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->headerSize, sizeof(uint32_t));
vkStream->write((VkPipelineCacheHeaderVersion*)&forMarshaling->headerVersion,
sizeof(VkPipelineCacheHeaderVersion));
vkStream->write((uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
vkStream->write((uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
}
void unmarshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream,
VkStructureType rootType,
VkPipelineCacheHeaderVersionOne* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->headerSize, sizeof(uint32_t));
vkStream->read((VkPipelineCacheHeaderVersion*)&forUnmarshaling->headerVersion,
sizeof(VkPipelineCacheHeaderVersion));
vkStream->read((uint32_t*)&forUnmarshaling->vendorID, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->deviceID, sizeof(uint32_t));
vkStream->read((uint8_t*)forUnmarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
}
void marshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkAllocationCallbacks* forMarshaling) {
(void)rootType;
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pUserData) {
vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
}
uint64_t cgen_var_1 = (uint64_t)forMarshaling->pfnAllocation;
vkStream->putBe64(cgen_var_1);
uint64_t cgen_var_2 = (uint64_t)forMarshaling->pfnReallocation;
vkStream->putBe64(cgen_var_2);
uint64_t cgen_var_3 = (uint64_t)forMarshaling->pfnFree;
vkStream->putBe64(cgen_var_3);
uint64_t cgen_var_4 = (uint64_t)forMarshaling->pfnInternalAllocation;
vkStream->putBe64(cgen_var_4);
uint64_t cgen_var_5 = (uint64_t)forMarshaling->pfnInternalFree;
vkStream->putBe64(cgen_var_5);
}
void unmarshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkAllocationCallbacks* forUnmarshaling) {
(void)rootType;
// WARNING PTR CHECK
void* check_pUserData;
check_pUserData = (void*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pUserData) {
if (!(check_pUserData)) {
fprintf(stderr,
"fatal: forUnmarshaling->pUserData inconsistent between guest and host\n");
}
vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
}
forUnmarshaling->pfnAllocation = (PFN_vkAllocationFunction)vkStream->getBe64();
forUnmarshaling->pfnReallocation = (PFN_vkReallocationFunction)vkStream->getBe64();
forUnmarshaling->pfnFree = (PFN_vkFreeFunction)vkStream->getBe64();
forUnmarshaling->pfnInternalAllocation =
(PFN_vkInternalAllocationNotification)vkStream->getBe64();
forUnmarshaling->pfnInternalFree = (PFN_vkInternalFreeNotification)vkStream->getBe64();
}
void marshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkApplicationInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationName;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pApplicationName) {
vkStream->putString(forMarshaling->pApplicationName);
}
} else {
vkStream->putString(forMarshaling->pApplicationName);
}
vkStream->write((uint32_t*)&forMarshaling->applicationVersion, sizeof(uint32_t));
if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEngineName;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pEngineName) {
vkStream->putString(forMarshaling->pEngineName);
}
} else {
vkStream->putString(forMarshaling->pEngineName);
}
vkStream->write((uint32_t*)&forMarshaling->engineVersion, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
}
void unmarshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkApplicationInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
// WARNING PTR CHECK
const char* check_pApplicationName;
check_pApplicationName = (const char*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pApplicationName) {
if (!(check_pApplicationName)) {
fprintf(stderr,
"fatal: forUnmarshaling->pApplicationName inconsistent between guest and "
"host\n");
}
vkStream->loadStringInPlace((char**)&forUnmarshaling->pApplicationName);
}
} else {
vkStream->loadStringInPlace((char**)&forUnmarshaling->pApplicationName);
}
vkStream->read((uint32_t*)&forUnmarshaling->applicationVersion, sizeof(uint32_t));
if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
// WARNING PTR CHECK
const char* check_pEngineName;
check_pEngineName = (const char*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pEngineName) {
if (!(check_pEngineName)) {
fprintf(
stderr,
"fatal: forUnmarshaling->pEngineName inconsistent between guest and host\n");
}
vkStream->loadStringInPlace((char**)&forUnmarshaling->pEngineName);
}
} else {
vkStream->loadStringInPlace((char**)&forUnmarshaling->pEngineName);
}
vkStream->read((uint32_t*)&forUnmarshaling->engineVersion, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->apiVersion, sizeof(uint32_t));
}
void marshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkFormatProperties* forMarshaling) {
(void)rootType;
vkStream->write((VkFormatFeatureFlags*)&forMarshaling->linearTilingFeatures,
sizeof(VkFormatFeatureFlags));
vkStream->write((VkFormatFeatureFlags*)&forMarshaling->optimalTilingFeatures,
sizeof(VkFormatFeatureFlags));
vkStream->write((VkFormatFeatureFlags*)&forMarshaling->bufferFeatures,
sizeof(VkFormatFeatureFlags));
}
void unmarshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkFormatProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->linearTilingFeatures,
sizeof(VkFormatFeatureFlags));
vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->optimalTilingFeatures,
sizeof(VkFormatFeatureFlags));
vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->bufferFeatures,
sizeof(VkFormatFeatureFlags));
}
void marshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageFormatProperties* forMarshaling) {
(void)rootType;
marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->maxExtent));
vkStream->write((uint32_t*)&forMarshaling->maxMipLevels, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxArrayLayers, sizeof(uint32_t));
vkStream->write((VkSampleCountFlags*)&forMarshaling->sampleCounts, sizeof(VkSampleCountFlags));
vkStream->write((VkDeviceSize*)&forMarshaling->maxResourceSize, sizeof(VkDeviceSize));
}
void unmarshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageFormatProperties* forUnmarshaling) {
(void)rootType;
unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->maxExtent));
vkStream->read((uint32_t*)&forUnmarshaling->maxMipLevels, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxArrayLayers, sizeof(uint32_t));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampleCounts, sizeof(VkSampleCountFlags));
vkStream->read((VkDeviceSize*)&forUnmarshaling->maxResourceSize, sizeof(VkDeviceSize));
}
void marshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkInstanceCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkInstanceCreateFlags*)&forMarshaling->flags, sizeof(VkInstanceCreateFlags));
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationInfo;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pApplicationInfo) {
marshal_VkApplicationInfo(vkStream, rootType,
(const VkApplicationInfo*)(forMarshaling->pApplicationInfo));
}
vkStream->write((uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
saveStringArray(vkStream, forMarshaling->ppEnabledLayerNames, forMarshaling->enabledLayerCount);
vkStream->write((uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
saveStringArray(vkStream, forMarshaling->ppEnabledExtensionNames,
forMarshaling->enabledExtensionCount);
}
void unmarshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkInstanceCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkInstanceCreateFlags*)&forUnmarshaling->flags, sizeof(VkInstanceCreateFlags));
// WARNING PTR CHECK
const VkApplicationInfo* check_pApplicationInfo;
check_pApplicationInfo = (const VkApplicationInfo*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pApplicationInfo) {
if (!(check_pApplicationInfo)) {
fprintf(
stderr,
"fatal: forUnmarshaling->pApplicationInfo inconsistent between guest and host\n");
}
unmarshal_VkApplicationInfo(vkStream, rootType,
(VkApplicationInfo*)(forUnmarshaling->pApplicationInfo));
}
vkStream->read((uint32_t*)&forUnmarshaling->enabledLayerCount, sizeof(uint32_t));
vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledLayerNames);
vkStream->read((uint32_t*)&forUnmarshaling->enabledExtensionCount, sizeof(uint32_t));
vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledExtensionNames);
}
void marshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMemoryHeap* forMarshaling) {
(void)rootType;
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
vkStream->write((VkMemoryHeapFlags*)&forMarshaling->flags, sizeof(VkMemoryHeapFlags));
}
void unmarshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMemoryHeap* forUnmarshaling) {
(void)rootType;
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
vkStream->read((VkMemoryHeapFlags*)&forUnmarshaling->flags, sizeof(VkMemoryHeapFlags));
}
void marshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMemoryType* forMarshaling) {
(void)rootType;
vkStream->write((VkMemoryPropertyFlags*)&forMarshaling->propertyFlags,
sizeof(VkMemoryPropertyFlags));
vkStream->write((uint32_t*)&forMarshaling->heapIndex, sizeof(uint32_t));
}
void unmarshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMemoryType* forUnmarshaling) {
(void)rootType;
vkStream->read((VkMemoryPropertyFlags*)&forUnmarshaling->propertyFlags,
sizeof(VkMemoryPropertyFlags));
vkStream->read((uint32_t*)&forUnmarshaling->heapIndex, sizeof(uint32_t));
}
void marshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPhysicalDeviceFeatures* forMarshaling) {
(void)rootType;
vkStream->write((VkBool32*)&forMarshaling->robustBufferAccess, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->fullDrawIndexUint32, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->imageCubeArray, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->independentBlend, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->geometryShader, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->tessellationShader, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sampleRateShading, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->dualSrcBlend, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->logicOp, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->multiDrawIndirect, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->drawIndirectFirstInstance, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->depthClamp, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->depthBiasClamp, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->fillModeNonSolid, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->depthBounds, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->wideLines, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->largePoints, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->alphaToOne, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->multiViewport, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->samplerAnisotropy, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->textureCompressionETC2, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->textureCompressionASTC_LDR, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->textureCompressionBC, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->occlusionQueryPrecise, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->pipelineStatisticsQuery, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->vertexPipelineStoresAndAtomics, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->fragmentStoresAndAtomics, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderTessellationAndGeometryPointSize,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderImageGatherExtended, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageExtendedFormats, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageMultisample, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageReadWithoutFormat,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageWriteWithoutFormat,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderClipDistance, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderCullDistance, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderFloat64, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderInt64, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderInt16, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderResourceResidency, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->shaderResourceMinLod, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseBinding, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidencyBuffer, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidencyImage2D, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidencyImage3D, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidency2Samples, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidency4Samples, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidency8Samples, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidency16Samples, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->sparseResidencyAliased, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->variableMultisampleRate, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->inheritedQueries, sizeof(VkBool32));
}
void unmarshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkPhysicalDeviceFeatures* forUnmarshaling) {
(void)rootType;
vkStream->read((VkBool32*)&forUnmarshaling->robustBufferAccess, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->fullDrawIndexUint32, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->imageCubeArray, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->independentBlend, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->geometryShader, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->tessellationShader, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sampleRateShading, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->dualSrcBlend, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->logicOp, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->multiDrawIndirect, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->drawIndirectFirstInstance, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->depthClamp, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->depthBiasClamp, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->fillModeNonSolid, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->depthBounds, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->wideLines, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->largePoints, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->alphaToOne, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->multiViewport, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->samplerAnisotropy, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionETC2, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionASTC_LDR, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionBC, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->occlusionQueryPrecise, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->pipelineStatisticsQuery, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->vertexPipelineStoresAndAtomics, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->fragmentStoresAndAtomics, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderTessellationAndGeometryPointSize,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderImageGatherExtended, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageExtendedFormats,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageMultisample, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageReadWithoutFormat,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageWriteWithoutFormat,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayDynamicIndexing,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderClipDistance, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderCullDistance, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderFloat64, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderInt64, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderInt16, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderResourceResidency, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->shaderResourceMinLod, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseBinding, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyBuffer, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyImage2D, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyImage3D, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency2Samples, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency4Samples, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency8Samples, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency16Samples, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyAliased, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->variableMultisampleRate, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->inheritedQueries, sizeof(VkBool32));
}
void marshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPhysicalDeviceLimits* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->maxImageDimension1D, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxImageDimension2D, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxImageDimension3D, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxImageDimensionCube, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTexelBufferElements, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxUniformBufferRange, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxStorageBufferRange, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPushConstantsSize, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxMemoryAllocationCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxSamplerAllocationCount, sizeof(uint32_t));
vkStream->write((VkDeviceSize*)&forMarshaling->bufferImageGranularity, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->sparseAddressSpaceSize, sizeof(VkDeviceSize));
vkStream->write((uint32_t*)&forMarshaling->maxBoundDescriptorSets, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorSamplers, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUniformBuffers,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorStorageBuffers,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorSampledImages,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorStorageImages,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorInputAttachments,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxPerStageResources, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetSamplers, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffers, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffersDynamic,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffers, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffersDynamic,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetSampledImages, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageImages, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetInputAttachments, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxVertexInputAttributes, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxVertexInputBindings, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxVertexInputAttributeOffset, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxVertexInputBindingStride, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxVertexOutputComponents, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationGenerationLevel, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationPatchSize, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerVertexInputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerVertexOutputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerPatchOutputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlTotalOutputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationEvaluationInputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTessellationEvaluationOutputComponents,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxGeometryShaderInvocations, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxGeometryInputComponents, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxGeometryOutputComponents, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxGeometryOutputVertices, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxGeometryTotalOutputComponents, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFragmentInputComponents, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFragmentOutputAttachments, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFragmentDualSrcAttachments, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFragmentCombinedOutputResources,
sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxComputeSharedMemorySize, sizeof(uint32_t));
vkStream->write((uint32_t*)forMarshaling->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxComputeWorkGroupInvocations, sizeof(uint32_t));
vkStream->write((uint32_t*)forMarshaling->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->subPixelPrecisionBits, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->subTexelPrecisionBits, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->mipmapPrecisionBits, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDrawIndexedIndexValue, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxDrawIndirectCount, sizeof(uint32_t));
vkStream->write((float*)&forMarshaling->maxSamplerLodBias, sizeof(float));
vkStream->write((float*)&forMarshaling->maxSamplerAnisotropy, sizeof(float));
vkStream->write((uint32_t*)&forMarshaling->maxViewports, sizeof(uint32_t));
vkStream->write((uint32_t*)forMarshaling->maxViewportDimensions, 2 * sizeof(uint32_t));
vkStream->write((float*)forMarshaling->viewportBoundsRange, 2 * sizeof(float));
vkStream->write((uint32_t*)&forMarshaling->viewportSubPixelBits, sizeof(uint32_t));
uint64_t cgen_var_0 = (uint64_t)forMarshaling->minMemoryMapAlignment;
vkStream->putBe64(cgen_var_0);
vkStream->write((VkDeviceSize*)&forMarshaling->minTexelBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->minUniformBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->minStorageBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->write((int32_t*)&forMarshaling->minTexelOffset, sizeof(int32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTexelOffset, sizeof(uint32_t));
vkStream->write((int32_t*)&forMarshaling->minTexelGatherOffset, sizeof(int32_t));
vkStream->write((uint32_t*)&forMarshaling->maxTexelGatherOffset, sizeof(uint32_t));
vkStream->write((float*)&forMarshaling->minInterpolationOffset, sizeof(float));
vkStream->write((float*)&forMarshaling->maxInterpolationOffset, sizeof(float));
vkStream->write((uint32_t*)&forMarshaling->subPixelInterpolationOffsetBits, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFramebufferWidth, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFramebufferHeight, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxFramebufferLayers, sizeof(uint32_t));
vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferColorSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferDepthSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferStencilSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferNoAttachmentsSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((uint32_t*)&forMarshaling->maxColorAttachments, sizeof(uint32_t));
vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageColorSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageIntegerSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageDepthSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageStencilSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((VkSampleCountFlags*)&forMarshaling->storageImageSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->write((uint32_t*)&forMarshaling->maxSampleMaskWords, sizeof(uint32_t));
vkStream->write((VkBool32*)&forMarshaling->timestampComputeAndGraphics, sizeof(VkBool32));
vkStream->write((float*)&forMarshaling->timestampPeriod, sizeof(float));
vkStream->write((uint32_t*)&forMarshaling->maxClipDistances, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxCullDistances, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->maxCombinedClipAndCullDistances, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->discreteQueuePriorities, sizeof(uint32_t));
vkStream->write((float*)forMarshaling->pointSizeRange, 2 * sizeof(float));
vkStream->write((float*)forMarshaling->lineWidthRange, 2 * sizeof(float));
vkStream->write((float*)&forMarshaling->pointSizeGranularity, sizeof(float));
vkStream->write((float*)&forMarshaling->lineWidthGranularity, sizeof(float));
vkStream->write((VkBool32*)&forMarshaling->strictLines, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->standardSampleLocations, sizeof(VkBool32));
vkStream->write((VkDeviceSize*)&forMarshaling->optimalBufferCopyOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->optimalBufferCopyRowPitchAlignment,
sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->nonCoherentAtomSize, sizeof(VkDeviceSize));
}
void unmarshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkPhysicalDeviceLimits* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension1D, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension2D, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension3D, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimensionCube, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxImageArrayLayers, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTexelBufferElements, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxUniformBufferRange, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxStorageBufferRange, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPushConstantsSize, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxMemoryAllocationCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxSamplerAllocationCount, sizeof(uint32_t));
vkStream->read((VkDeviceSize*)&forUnmarshaling->bufferImageGranularity, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->sparseAddressSpaceSize, sizeof(VkDeviceSize));
vkStream->read((uint32_t*)&forUnmarshaling->maxBoundDescriptorSets, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorSamplers, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUniformBuffers,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorStorageBuffers,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorSampledImages,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorStorageImages,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorInputAttachments,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageResources, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetSamplers, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUniformBuffers, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUniformBuffersDynamic,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageBuffers, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageBuffersDynamic,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetSampledImages, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageImages, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetInputAttachments, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputAttributes, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputBindings, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputAttributeOffset, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputBindingStride, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxVertexOutputComponents, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationGenerationLevel, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationPatchSize, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerVertexInputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerVertexOutputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerPatchOutputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlTotalOutputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationEvaluationInputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationEvaluationOutputComponents,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryShaderInvocations, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryInputComponents, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryOutputComponents, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryOutputVertices, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryTotalOutputComponents, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentInputComponents, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentOutputAttachments, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentDualSrcAttachments, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentCombinedOutputResources,
sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxComputeSharedMemorySize, sizeof(uint32_t));
vkStream->read((uint32_t*)forUnmarshaling->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxComputeWorkGroupInvocations, sizeof(uint32_t));
vkStream->read((uint32_t*)forUnmarshaling->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->subPixelPrecisionBits, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->subTexelPrecisionBits, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->mipmapPrecisionBits, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDrawIndexedIndexValue, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxDrawIndirectCount, sizeof(uint32_t));
vkStream->read((float*)&forUnmarshaling->maxSamplerLodBias, sizeof(float));
vkStream->read((float*)&forUnmarshaling->maxSamplerAnisotropy, sizeof(float));
vkStream->read((uint32_t*)&forUnmarshaling->maxViewports, sizeof(uint32_t));
vkStream->read((uint32_t*)forUnmarshaling->maxViewportDimensions, 2 * sizeof(uint32_t));
vkStream->read((float*)forUnmarshaling->viewportBoundsRange, 2 * sizeof(float));
vkStream->read((uint32_t*)&forUnmarshaling->viewportSubPixelBits, sizeof(uint32_t));
forUnmarshaling->minMemoryMapAlignment = (size_t)vkStream->getBe64();
vkStream->read((VkDeviceSize*)&forUnmarshaling->minTexelBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->minUniformBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->minStorageBufferOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->read((int32_t*)&forUnmarshaling->minTexelOffset, sizeof(int32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTexelOffset, sizeof(uint32_t));
vkStream->read((int32_t*)&forUnmarshaling->minTexelGatherOffset, sizeof(int32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxTexelGatherOffset, sizeof(uint32_t));
vkStream->read((float*)&forUnmarshaling->minInterpolationOffset, sizeof(float));
vkStream->read((float*)&forUnmarshaling->maxInterpolationOffset, sizeof(float));
vkStream->read((uint32_t*)&forUnmarshaling->subPixelInterpolationOffsetBits, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferWidth, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferHeight, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferLayers, sizeof(uint32_t));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferColorSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferDepthSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferStencilSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferNoAttachmentsSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((uint32_t*)&forUnmarshaling->maxColorAttachments, sizeof(uint32_t));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageColorSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageIntegerSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageDepthSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageStencilSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((VkSampleCountFlags*)&forUnmarshaling->storageImageSampleCounts,
sizeof(VkSampleCountFlags));
vkStream->read((uint32_t*)&forUnmarshaling->maxSampleMaskWords, sizeof(uint32_t));
vkStream->read((VkBool32*)&forUnmarshaling->timestampComputeAndGraphics, sizeof(VkBool32));
vkStream->read((float*)&forUnmarshaling->timestampPeriod, sizeof(float));
vkStream->read((uint32_t*)&forUnmarshaling->maxClipDistances, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxCullDistances, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->maxCombinedClipAndCullDistances, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->discreteQueuePriorities, sizeof(uint32_t));
vkStream->read((float*)forUnmarshaling->pointSizeRange, 2 * sizeof(float));
vkStream->read((float*)forUnmarshaling->lineWidthRange, 2 * sizeof(float));
vkStream->read((float*)&forUnmarshaling->pointSizeGranularity, sizeof(float));
vkStream->read((float*)&forUnmarshaling->lineWidthGranularity, sizeof(float));
vkStream->read((VkBool32*)&forUnmarshaling->strictLines, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->standardSampleLocations, sizeof(VkBool32));
vkStream->read((VkDeviceSize*)&forUnmarshaling->optimalBufferCopyOffsetAlignment,
sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->optimalBufferCopyRowPitchAlignment,
sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->nonCoherentAtomSize, sizeof(VkDeviceSize));
}
void marshal_VkPhysicalDeviceMemoryProperties(
VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPhysicalDeviceMemoryProperties* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->memoryTypeCount, sizeof(uint32_t));
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
marshal_VkMemoryType(vkStream, rootType, (VkMemoryType*)(forMarshaling->memoryTypes + i));
}
vkStream->write((uint32_t*)&forMarshaling->memoryHeapCount, sizeof(uint32_t));
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
marshal_VkMemoryHeap(vkStream, rootType, (VkMemoryHeap*)(forMarshaling->memoryHeaps + i));
}
}
void unmarshal_VkPhysicalDeviceMemoryProperties(VulkanStreamGuest* vkStream,
VkStructureType rootType,
VkPhysicalDeviceMemoryProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeCount, sizeof(uint32_t));
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
unmarshal_VkMemoryType(vkStream, rootType,
(VkMemoryType*)(forUnmarshaling->memoryTypes + i));
}
vkStream->read((uint32_t*)&forUnmarshaling->memoryHeapCount, sizeof(uint32_t));
for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
unmarshal_VkMemoryHeap(vkStream, rootType,
(VkMemoryHeap*)(forUnmarshaling->memoryHeaps + i));
}
}
void marshal_VkPhysicalDeviceSparseProperties(
VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPhysicalDeviceSparseProperties* forMarshaling) {
(void)rootType;
vkStream->write((VkBool32*)&forMarshaling->residencyStandard2DBlockShape, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->residencyStandard2DMultisampleBlockShape,
sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->residencyStandard3DBlockShape, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->residencyAlignedMipSize, sizeof(VkBool32));
vkStream->write((VkBool32*)&forMarshaling->residencyNonResidentStrict, sizeof(VkBool32));
}
void unmarshal_VkPhysicalDeviceSparseProperties(VulkanStreamGuest* vkStream,
VkStructureType rootType,
VkPhysicalDeviceSparseProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard2DBlockShape, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard2DMultisampleBlockShape,
sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard3DBlockShape, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->residencyAlignedMipSize, sizeof(VkBool32));
vkStream->read((VkBool32*)&forUnmarshaling->residencyNonResidentStrict, sizeof(VkBool32));
}
void marshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPhysicalDeviceProperties* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->driverVersion, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
vkStream->write((VkPhysicalDeviceType*)&forMarshaling->deviceType,
sizeof(VkPhysicalDeviceType));
vkStream->write((char*)forMarshaling->deviceName,
VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
vkStream->write((uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
marshal_VkPhysicalDeviceLimits(vkStream, rootType,
(VkPhysicalDeviceLimits*)(&forMarshaling->limits));
marshal_VkPhysicalDeviceSparseProperties(
vkStream, rootType, (VkPhysicalDeviceSparseProperties*)(&forMarshaling->sparseProperties));
}
void unmarshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkPhysicalDeviceProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->apiVersion, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->driverVersion, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->vendorID, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->deviceID, sizeof(uint32_t));
vkStream->read((VkPhysicalDeviceType*)&forUnmarshaling->deviceType,
sizeof(VkPhysicalDeviceType));
vkStream->read((char*)forUnmarshaling->deviceName,
VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
vkStream->read((uint8_t*)forUnmarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
unmarshal_VkPhysicalDeviceLimits(vkStream, rootType,
(VkPhysicalDeviceLimits*)(&forUnmarshaling->limits));
unmarshal_VkPhysicalDeviceSparseProperties(
vkStream, rootType,
(VkPhysicalDeviceSparseProperties*)(&forUnmarshaling->sparseProperties));
}
void marshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkQueueFamilyProperties* forMarshaling) {
(void)rootType;
vkStream->write((VkQueueFlags*)&forMarshaling->queueFlags, sizeof(VkQueueFlags));
vkStream->write((uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->timestampValidBits, sizeof(uint32_t));
marshal_VkExtent3D(vkStream, rootType,
(VkExtent3D*)(&forMarshaling->minImageTransferGranularity));
}
void unmarshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkQueueFamilyProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((VkQueueFlags*)&forUnmarshaling->queueFlags, sizeof(VkQueueFlags));
vkStream->read((uint32_t*)&forUnmarshaling->queueCount, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->timestampValidBits, sizeof(uint32_t));
unmarshal_VkExtent3D(vkStream, rootType,
(VkExtent3D*)(&forUnmarshaling->minImageTransferGranularity));
}
void marshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkDeviceQueueCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkDeviceQueueCreateFlags*)&forMarshaling->flags,
sizeof(VkDeviceQueueCreateFlags));
vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
vkStream->write((const float*)forMarshaling->pQueuePriorities,
forMarshaling->queueCount * sizeof(const float));
}
void unmarshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkDeviceQueueCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkDeviceQueueCreateFlags*)&forUnmarshaling->flags,
sizeof(VkDeviceQueueCreateFlags));
vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->queueCount, sizeof(uint32_t));
vkStream->read((float*)forUnmarshaling->pQueuePriorities,
forUnmarshaling->queueCount * sizeof(const float));
}
void marshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkDeviceCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkDeviceCreateFlags*)&forMarshaling->flags, sizeof(VkDeviceCreateFlags));
vkStream->write((uint32_t*)&forMarshaling->queueCreateInfoCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->queueCreateInfoCount; ++i) {
marshal_VkDeviceQueueCreateInfo(
vkStream, rootType,
(const VkDeviceQueueCreateInfo*)(forMarshaling->pQueueCreateInfos + i));
}
}
vkStream->write((uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
saveStringArray(vkStream, forMarshaling->ppEnabledLayerNames, forMarshaling->enabledLayerCount);
vkStream->write((uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
saveStringArray(vkStream, forMarshaling->ppEnabledExtensionNames,
forMarshaling->enabledExtensionCount);
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEnabledFeatures;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pEnabledFeatures) {
marshal_VkPhysicalDeviceFeatures(
vkStream, rootType, (const VkPhysicalDeviceFeatures*)(forMarshaling->pEnabledFeatures));
}
}
void unmarshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkDeviceCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkDeviceCreateFlags*)&forUnmarshaling->flags, sizeof(VkDeviceCreateFlags));
vkStream->read((uint32_t*)&forUnmarshaling->queueCreateInfoCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->queueCreateInfoCount; ++i) {
unmarshal_VkDeviceQueueCreateInfo(
vkStream, rootType,
(VkDeviceQueueCreateInfo*)(forUnmarshaling->pQueueCreateInfos + i));
}
}
vkStream->read((uint32_t*)&forUnmarshaling->enabledLayerCount, sizeof(uint32_t));
vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledLayerNames);
vkStream->read((uint32_t*)&forUnmarshaling->enabledExtensionCount, sizeof(uint32_t));
vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledExtensionNames);
// WARNING PTR CHECK
const VkPhysicalDeviceFeatures* check_pEnabledFeatures;
check_pEnabledFeatures = (const VkPhysicalDeviceFeatures*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pEnabledFeatures) {
if (!(check_pEnabledFeatures)) {
fprintf(
stderr,
"fatal: forUnmarshaling->pEnabledFeatures inconsistent between guest and host\n");
}
unmarshal_VkPhysicalDeviceFeatures(
vkStream, rootType, (VkPhysicalDeviceFeatures*)(forUnmarshaling->pEnabledFeatures));
}
}
void marshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkExtensionProperties* forMarshaling) {
(void)rootType;
vkStream->write((char*)forMarshaling->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
vkStream->write((uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
}
void unmarshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkExtensionProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((char*)forUnmarshaling->extensionName,
VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
vkStream->read((uint32_t*)&forUnmarshaling->specVersion, sizeof(uint32_t));
}
void marshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkLayerProperties* forMarshaling) {
(void)rootType;
vkStream->write((char*)forMarshaling->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
vkStream->write((uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->implementationVersion, sizeof(uint32_t));
vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
}
void unmarshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkLayerProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((char*)forUnmarshaling->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
vkStream->read((uint32_t*)&forUnmarshaling->specVersion, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->implementationVersion, sizeof(uint32_t));
vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
}
void marshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSubmitInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
if (forMarshaling->waitSemaphoreCount) {
uint64_t* cgen_var_0;
vkStream->alloc((void**)&cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
forMarshaling->pWaitSemaphores, cgen_var_0, forMarshaling->waitSemaphoreCount);
vkStream->write((uint64_t*)cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
}
vkStream->write((const VkPipelineStageFlags*)forMarshaling->pWaitDstStageMask,
forMarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
vkStream->write((uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
if (forMarshaling->commandBufferCount) {
uint64_t* cgen_var_1;
vkStream->alloc((void**)&cgen_var_1, forMarshaling->commandBufferCount * 8);
vkStream->handleMapping()->mapHandles_VkCommandBuffer_u64(
forMarshaling->pCommandBuffers, cgen_var_1, forMarshaling->commandBufferCount);
vkStream->write((uint64_t*)cgen_var_1, forMarshaling->commandBufferCount * 8);
}
vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
if (forMarshaling->signalSemaphoreCount) {
uint64_t* cgen_var_2;
vkStream->alloc((void**)&cgen_var_2, forMarshaling->signalSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
forMarshaling->pSignalSemaphores, cgen_var_2, forMarshaling->signalSemaphoreCount);
vkStream->write((uint64_t*)cgen_var_2, forMarshaling->signalSemaphoreCount * 8);
}
}
void unmarshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSubmitInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
if (forUnmarshaling->waitSemaphoreCount) {
uint64_t* cgen_var_0;
vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
cgen_var_0, (VkSemaphore*)forUnmarshaling->pWaitSemaphores,
forUnmarshaling->waitSemaphoreCount);
}
vkStream->read((VkPipelineStageFlags*)forUnmarshaling->pWaitDstStageMask,
forUnmarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
vkStream->read((uint32_t*)&forUnmarshaling->commandBufferCount, sizeof(uint32_t));
if (forUnmarshaling->commandBufferCount) {
uint64_t* cgen_var_1;
vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->commandBufferCount * 8);
vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->commandBufferCount * 8);
vkStream->handleMapping()->mapHandles_u64_VkCommandBuffer(
cgen_var_1, (VkCommandBuffer*)forUnmarshaling->pCommandBuffers,
forUnmarshaling->commandBufferCount);
}
vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreCount, sizeof(uint32_t));
if (forUnmarshaling->signalSemaphoreCount) {
uint64_t* cgen_var_2;
vkStream->alloc((void**)&cgen_var_2, forUnmarshaling->signalSemaphoreCount * 8);
vkStream->read((uint64_t*)cgen_var_2, forUnmarshaling->signalSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
cgen_var_2, (VkSemaphore*)forUnmarshaling->pSignalSemaphores,
forUnmarshaling->signalSemaphoreCount);
}
}
void marshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMappedMemoryRange* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
}
void unmarshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMappedMemoryRange* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
&cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
}
void marshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMemoryAllocateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkDeviceSize*)&forMarshaling->allocationSize, sizeof(VkDeviceSize));
vkStream->write((uint32_t*)&forMarshaling->memoryTypeIndex, sizeof(uint32_t));
}
void unmarshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMemoryAllocateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkDeviceSize*)&forUnmarshaling->allocationSize, sizeof(VkDeviceSize));
vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeIndex, sizeof(uint32_t));
}
void marshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkMemoryRequirements* forMarshaling) {
(void)rootType;
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->alignment, sizeof(VkDeviceSize));
vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
}
void unmarshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkMemoryRequirements* forUnmarshaling) {
(void)rootType;
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->alignment, sizeof(VkDeviceSize));
vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
}
void marshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseMemoryBind* forMarshaling) {
(void)rootType;
vkStream->write((VkDeviceSize*)&forMarshaling->resourceOffset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
vkStream->write((VkSparseMemoryBindFlags*)&forMarshaling->flags,
sizeof(VkSparseMemoryBindFlags));
}
void unmarshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseMemoryBind* forUnmarshaling) {
(void)rootType;
vkStream->read((VkDeviceSize*)&forUnmarshaling->resourceOffset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
&cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
vkStream->read((VkSparseMemoryBindFlags*)&forUnmarshaling->flags,
sizeof(VkSparseMemoryBindFlags));
}
void marshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseBufferMemoryBindInfo* forMarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
marshal_VkSparseMemoryBind(vkStream, rootType,
(const VkSparseMemoryBind*)(forMarshaling->pBinds + i));
}
}
}
void unmarshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseBufferMemoryBindInfo* forUnmarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
(VkBuffer*)&forUnmarshaling->buffer, 1);
vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
unmarshal_VkSparseMemoryBind(vkStream, rootType,
(VkSparseMemoryBind*)(forUnmarshaling->pBinds + i));
}
}
}
void marshal_VkSparseImageOpaqueMemoryBindInfo(
VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseImageOpaqueMemoryBindInfo* forMarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
marshal_VkSparseMemoryBind(vkStream, rootType,
(const VkSparseMemoryBind*)(forMarshaling->pBinds + i));
}
}
}
void unmarshal_VkSparseImageOpaqueMemoryBindInfo(
VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseImageOpaqueMemoryBindInfo* forUnmarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
(VkImage*)&forUnmarshaling->image, 1);
vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
unmarshal_VkSparseMemoryBind(vkStream, rootType,
(VkSparseMemoryBind*)(forUnmarshaling->pBinds + i));
}
}
}
void marshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageSubresource* forMarshaling) {
(void)rootType;
vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
vkStream->write((uint32_t*)&forMarshaling->mipLevel, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->arrayLayer, sizeof(uint32_t));
}
void unmarshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageSubresource* forUnmarshaling) {
(void)rootType;
vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
vkStream->read((uint32_t*)&forUnmarshaling->mipLevel, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->arrayLayer, sizeof(uint32_t));
}
void marshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseImageMemoryBind* forMarshaling) {
(void)rootType;
marshal_VkImageSubresource(vkStream, rootType,
(VkImageSubresource*)(&forMarshaling->subresource));
marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->offset));
marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
vkStream->write((VkSparseMemoryBindFlags*)&forMarshaling->flags,
sizeof(VkSparseMemoryBindFlags));
}
void unmarshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseImageMemoryBind* forUnmarshaling) {
(void)rootType;
unmarshal_VkImageSubresource(vkStream, rootType,
(VkImageSubresource*)(&forUnmarshaling->subresource));
unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->offset));
unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
&cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
vkStream->read((VkSparseMemoryBindFlags*)&forUnmarshaling->flags,
sizeof(VkSparseMemoryBindFlags));
}
void marshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseImageMemoryBindInfo* forMarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
marshal_VkSparseImageMemoryBind(
vkStream, rootType, (const VkSparseImageMemoryBind*)(forMarshaling->pBinds + i));
}
}
}
void unmarshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseImageMemoryBindInfo* forUnmarshaling) {
(void)rootType;
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
(VkImage*)&forUnmarshaling->image, 1);
vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
unmarshal_VkSparseImageMemoryBind(
vkStream, rootType, (VkSparseImageMemoryBind*)(forUnmarshaling->pBinds + i));
}
}
}
void marshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBindSparseInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
if (forMarshaling->waitSemaphoreCount) {
uint64_t* cgen_var_0;
vkStream->alloc((void**)&cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
forMarshaling->pWaitSemaphores, cgen_var_0, forMarshaling->waitSemaphoreCount);
vkStream->write((uint64_t*)cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
}
vkStream->write((uint32_t*)&forMarshaling->bufferBindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->bufferBindCount; ++i) {
marshal_VkSparseBufferMemoryBindInfo(
vkStream, rootType,
(const VkSparseBufferMemoryBindInfo*)(forMarshaling->pBufferBinds + i));
}
}
vkStream->write((uint32_t*)&forMarshaling->imageOpaqueBindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageOpaqueBindCount; ++i) {
marshal_VkSparseImageOpaqueMemoryBindInfo(
vkStream, rootType,
(const VkSparseImageOpaqueMemoryBindInfo*)(forMarshaling->pImageOpaqueBinds + i));
}
}
vkStream->write((uint32_t*)&forMarshaling->imageBindCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageBindCount; ++i) {
marshal_VkSparseImageMemoryBindInfo(
vkStream, rootType,
(const VkSparseImageMemoryBindInfo*)(forMarshaling->pImageBinds + i));
}
}
vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
if (forMarshaling->signalSemaphoreCount) {
uint64_t* cgen_var_1;
vkStream->alloc((void**)&cgen_var_1, forMarshaling->signalSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
forMarshaling->pSignalSemaphores, cgen_var_1, forMarshaling->signalSemaphoreCount);
vkStream->write((uint64_t*)cgen_var_1, forMarshaling->signalSemaphoreCount * 8);
}
}
void unmarshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBindSparseInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
if (forUnmarshaling->waitSemaphoreCount) {
uint64_t* cgen_var_0;
vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
cgen_var_0, (VkSemaphore*)forUnmarshaling->pWaitSemaphores,
forUnmarshaling->waitSemaphoreCount);
}
vkStream->read((uint32_t*)&forUnmarshaling->bufferBindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bufferBindCount; ++i) {
unmarshal_VkSparseBufferMemoryBindInfo(
vkStream, rootType,
(VkSparseBufferMemoryBindInfo*)(forUnmarshaling->pBufferBinds + i));
}
}
vkStream->read((uint32_t*)&forUnmarshaling->imageOpaqueBindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->imageOpaqueBindCount; ++i) {
unmarshal_VkSparseImageOpaqueMemoryBindInfo(
vkStream, rootType,
(VkSparseImageOpaqueMemoryBindInfo*)(forUnmarshaling->pImageOpaqueBinds + i));
}
}
vkStream->read((uint32_t*)&forUnmarshaling->imageBindCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->imageBindCount; ++i) {
unmarshal_VkSparseImageMemoryBindInfo(
vkStream, rootType,
(VkSparseImageMemoryBindInfo*)(forUnmarshaling->pImageBinds + i));
}
}
vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreCount, sizeof(uint32_t));
if (forUnmarshaling->signalSemaphoreCount) {
uint64_t* cgen_var_1;
vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->signalSemaphoreCount * 8);
vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->signalSemaphoreCount * 8);
vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
cgen_var_1, (VkSemaphore*)forUnmarshaling->pSignalSemaphores,
forUnmarshaling->signalSemaphoreCount);
}
}
void marshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseImageFormatProperties* forMarshaling) {
(void)rootType;
vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageGranularity));
vkStream->write((VkSparseImageFormatFlags*)&forMarshaling->flags,
sizeof(VkSparseImageFormatFlags));
}
void unmarshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSparseImageFormatProperties* forUnmarshaling) {
(void)rootType;
vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->imageGranularity));
vkStream->read((VkSparseImageFormatFlags*)&forUnmarshaling->flags,
sizeof(VkSparseImageFormatFlags));
}
void marshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSparseImageMemoryRequirements* forMarshaling) {
(void)rootType;
marshal_VkSparseImageFormatProperties(
vkStream, rootType, (VkSparseImageFormatProperties*)(&forMarshaling->formatProperties));
vkStream->write((uint32_t*)&forMarshaling->imageMipTailFirstLod, sizeof(uint32_t));
vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailSize, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailOffset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailStride, sizeof(VkDeviceSize));
}
void unmarshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream,
VkStructureType rootType,
VkSparseImageMemoryRequirements* forUnmarshaling) {
(void)rootType;
unmarshal_VkSparseImageFormatProperties(
vkStream, rootType, (VkSparseImageFormatProperties*)(&forUnmarshaling->formatProperties));
vkStream->read((uint32_t*)&forUnmarshaling->imageMipTailFirstLod, sizeof(uint32_t));
vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailSize, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailOffset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailStride, sizeof(VkDeviceSize));
}
void marshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkFenceCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkFenceCreateFlags*)&forMarshaling->flags, sizeof(VkFenceCreateFlags));
}
void unmarshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkFenceCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkFenceCreateFlags*)&forUnmarshaling->flags, sizeof(VkFenceCreateFlags));
}
void marshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSemaphoreCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkSemaphoreCreateFlags*)&forMarshaling->flags, sizeof(VkSemaphoreCreateFlags));
}
void unmarshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSemaphoreCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkSemaphoreCreateFlags*)&forUnmarshaling->flags,
sizeof(VkSemaphoreCreateFlags));
}
void marshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkEventCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkEventCreateFlags*)&forMarshaling->flags, sizeof(VkEventCreateFlags));
}
void unmarshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkEventCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkEventCreateFlags*)&forUnmarshaling->flags, sizeof(VkEventCreateFlags));
}
void marshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkQueryPoolCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkQueryPoolCreateFlags*)&forMarshaling->flags, sizeof(VkQueryPoolCreateFlags));
vkStream->write((VkQueryType*)&forMarshaling->queryType, sizeof(VkQueryType));
vkStream->write((uint32_t*)&forMarshaling->queryCount, sizeof(uint32_t));
vkStream->write((VkQueryPipelineStatisticFlags*)&forMarshaling->pipelineStatistics,
sizeof(VkQueryPipelineStatisticFlags));
}
void unmarshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkQueryPoolCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkQueryPoolCreateFlags*)&forUnmarshaling->flags,
sizeof(VkQueryPoolCreateFlags));
vkStream->read((VkQueryType*)&forUnmarshaling->queryType, sizeof(VkQueryType));
vkStream->read((uint32_t*)&forUnmarshaling->queryCount, sizeof(uint32_t));
vkStream->read((VkQueryPipelineStatisticFlags*)&forUnmarshaling->pipelineStatistics,
sizeof(VkQueryPipelineStatisticFlags));
}
void marshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBufferCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkBufferCreateFlags*)&forMarshaling->flags, sizeof(VkBufferCreateFlags));
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
vkStream->write((VkBufferUsageFlags*)&forMarshaling->usage, sizeof(VkBufferUsageFlags));
vkStream->write((VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pQueueFamilyIndices) {
vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
}
}
void unmarshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBufferCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkBufferCreateFlags*)&forUnmarshaling->flags, sizeof(VkBufferCreateFlags));
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
vkStream->read((VkBufferUsageFlags*)&forUnmarshaling->usage, sizeof(VkBufferUsageFlags));
vkStream->read((VkSharingMode*)&forUnmarshaling->sharingMode, sizeof(VkSharingMode));
vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
// WARNING PTR CHECK
const uint32_t* check_pQueueFamilyIndices;
check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pQueueFamilyIndices) {
if (!(check_pQueueFamilyIndices)) {
fprintf(stderr,
"fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
"host\n");
}
vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
}
}
void marshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkBufferViewCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkBufferViewCreateFlags*)&forMarshaling->flags,
sizeof(VkBufferViewCreateFlags));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->range, sizeof(VkDeviceSize));
}
void unmarshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkBufferViewCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkBufferViewCreateFlags*)&forUnmarshaling->flags,
sizeof(VkBufferViewCreateFlags));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
(VkBuffer*)&forUnmarshaling->buffer, 1);
vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->range, sizeof(VkDeviceSize));
}
void marshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
vkStream->write((VkImageType*)&forMarshaling->imageType, sizeof(VkImageType));
vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
vkStream->write((uint32_t*)&forMarshaling->mipLevels, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->arrayLayers, sizeof(uint32_t));
vkStream->write((VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
vkStream->write((VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
vkStream->write((VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
// WARNING PTR CHECK
uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
vkStream->putBe64(cgen_var_0);
if (forMarshaling->pQueueFamilyIndices) {
vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
}
vkStream->write((VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
}
void unmarshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkImageCreateFlags*)&forUnmarshaling->flags, sizeof(VkImageCreateFlags));
vkStream->read((VkImageType*)&forUnmarshaling->imageType, sizeof(VkImageType));
vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
vkStream->read((uint32_t*)&forUnmarshaling->mipLevels, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->arrayLayers, sizeof(uint32_t));
vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->samples,
sizeof(VkSampleCountFlagBits));
vkStream->read((VkImageTiling*)&forUnmarshaling->tiling, sizeof(VkImageTiling));
vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
vkStream->read((VkSharingMode*)&forUnmarshaling->sharingMode, sizeof(VkSharingMode));
vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
// WARNING PTR CHECK
const uint32_t* check_pQueueFamilyIndices;
check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
if (forUnmarshaling->pQueueFamilyIndices) {
if (!(check_pQueueFamilyIndices)) {
fprintf(stderr,
"fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
"host\n");
}
vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
}
vkStream->read((VkImageLayout*)&forUnmarshaling->initialLayout, sizeof(VkImageLayout));
}
void marshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSubresourceLayout* forMarshaling) {
(void)rootType;
vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->rowPitch, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->arrayPitch, sizeof(VkDeviceSize));
vkStream->write((VkDeviceSize*)&forMarshaling->depthPitch, sizeof(VkDeviceSize));
}
void unmarshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSubresourceLayout* forUnmarshaling) {
(void)rootType;
vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->rowPitch, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->arrayPitch, sizeof(VkDeviceSize));
vkStream->read((VkDeviceSize*)&forUnmarshaling->depthPitch, sizeof(VkDeviceSize));
}
void marshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkComponentMapping* forMarshaling) {
(void)rootType;
vkStream->write((VkComponentSwizzle*)&forMarshaling->r, sizeof(VkComponentSwizzle));
vkStream->write((VkComponentSwizzle*)&forMarshaling->g, sizeof(VkComponentSwizzle));
vkStream->write((VkComponentSwizzle*)&forMarshaling->b, sizeof(VkComponentSwizzle));
vkStream->write((VkComponentSwizzle*)&forMarshaling->a, sizeof(VkComponentSwizzle));
}
void unmarshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkComponentMapping* forUnmarshaling) {
(void)rootType;
vkStream->read((VkComponentSwizzle*)&forUnmarshaling->r, sizeof(VkComponentSwizzle));
vkStream->read((VkComponentSwizzle*)&forUnmarshaling->g, sizeof(VkComponentSwizzle));
vkStream->read((VkComponentSwizzle*)&forUnmarshaling->b, sizeof(VkComponentSwizzle));
vkStream->read((VkComponentSwizzle*)&forUnmarshaling->a, sizeof(VkComponentSwizzle));
}
void marshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkImageViewCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkImageViewCreateFlags*)&forMarshaling->flags, sizeof(VkImageViewCreateFlags));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->write((VkImageViewType*)&forMarshaling->viewType, sizeof(VkImageViewType));
vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
marshal_VkComponentMapping(vkStream, rootType,
(VkComponentMapping*)(&forMarshaling->components));
marshal_VkImageSubresourceRange(vkStream, rootType,
(VkImageSubresourceRange*)(&forMarshaling->subresourceRange));
}
void unmarshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkImageViewCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkImageViewCreateFlags*)&forUnmarshaling->flags,
sizeof(VkImageViewCreateFlags));
uint64_t cgen_var_0;
vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
(VkImage*)&forUnmarshaling->image, 1);
vkStream->read((VkImageViewType*)&forUnmarshaling->viewType, sizeof(VkImageViewType));
vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
unmarshal_VkComponentMapping(vkStream, rootType,
(VkComponentMapping*)(&forUnmarshaling->components));
unmarshal_VkImageSubresourceRange(
vkStream, rootType, (VkImageSubresourceRange*)(&forUnmarshaling->subresourceRange));
}
void marshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkShaderModuleCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkShaderModuleCreateFlags*)&forMarshaling->flags,
sizeof(VkShaderModuleCreateFlags));
uint64_t cgen_var_0 = (uint64_t)forMarshaling->codeSize;
vkStream->putBe64(cgen_var_0);
vkStream->write((const uint32_t*)forMarshaling->pCode,
(forMarshaling->codeSize / 4) * sizeof(const uint32_t));
}
void unmarshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkShaderModuleCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkShaderModuleCreateFlags*)&forUnmarshaling->flags,
sizeof(VkShaderModuleCreateFlags));
forUnmarshaling->codeSize = (size_t)vkStream->getBe64();
vkStream->read((uint32_t*)forUnmarshaling->pCode,
(forUnmarshaling->codeSize / 4) * sizeof(const uint32_t));
}
void marshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPipelineCacheCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkPipelineCacheCreateFlags*)&forMarshaling->flags,
sizeof(VkPipelineCacheCreateFlags));
uint64_t cgen_var_0 = (uint64_t)forMarshaling->initialDataSize;
vkStream->putBe64(cgen_var_0);
vkStream->write((const void*)forMarshaling->pInitialData,
forMarshaling->initialDataSize * sizeof(const uint8_t));
}
void unmarshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkPipelineCacheCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkPipelineCacheCreateFlags*)&forUnmarshaling->flags,
sizeof(VkPipelineCacheCreateFlags));
forUnmarshaling->initialDataSize = (size_t)vkStream->getBe64();
vkStream->read((void*)forUnmarshaling->pInitialData,
forUnmarshaling->initialDataSize * sizeof(const uint8_t));
}
void marshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSpecializationMapEntry* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->constantID, sizeof(uint32_t));
vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
uint64_t cgen_var_0 = (uint64_t)forMarshaling->size;
vkStream->putBe64(cgen_var_0);
}
void unmarshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSpecializationMapEntry* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->constantID, sizeof(uint32_t));
vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
forUnmarshaling->size = (size_t)vkStream->getBe64();
}
void marshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkSpecializationInfo* forMarshaling) {
(void)rootType;
vkStream->write((uint32_t*)&forMarshaling->mapEntryCount, sizeof(uint32_t));
if (forMarshaling) {
for (uint32_t i = 0; i < (uint32_t)forMarshaling->mapEntryCount; ++i) {
marshal_VkSpecializationMapEntry(
vkStream, rootType,
(const VkSpecializationMapEntry*)(forMarshaling->pMapEntries + i));
}
}
uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
vkStream->putBe64(cgen_var_0);
vkStream->write((const void*)forMarshaling->pData,
forMarshaling->dataSize * sizeof(const uint8_t));
}
void unmarshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
VkSpecializationInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((uint32_t*)&forUnmarshaling->mapEntryCount, sizeof(uint32_t));
if (forUnmarshaling) {
for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->mapEntryCount; ++i) {
unmarshal_VkSpecializationMapEntry(
vkStream, rootType, (VkSpecializationMapEntry*)(forUnmarshaling->pMapEntries + i));
}
}
forUnmarshaling->dataSize = (size_t)vkStream->getBe64();
vkStream->read((void*)forUnmarshaling->pData,
forUnmarshaling->dataSize * sizeof(const uint8_t));
}
void marshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
const VkPipelineShaderStageCreateInfo* forMarshaling) {
(void)rootType;
vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forMarshaling->sType;
}
marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
vkStream->write((VkPipelineShaderStageCreateFlags*)&forMarshaling->flags,
sizeof(VkPipelineShaderStageCreateFlags));
vkStream->write((VkShaderStageFlagBits*)&forMarshaling->stage, sizeof(VkShaderStageFlagBits));
uint64_t cgen_var_0;
vkStream->handleMapping()->mapHandles_VkShaderModule_u64(&forMarshaling->module, &cgen_var_0,
1);
vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
vkStream->putString(forMarshaling->pName);
// WARNING PTR CHECK
uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSpecializationInfo;
vkStream->putBe64(cgen_var_1);
if (forMarshaling->pSpecializationInfo) {
marshal_VkSpecializationInfo(
vkStream, rootType, (const VkSpecializationInfo*)(forMarshaling->pSpecializationInfo));
}
}
void unmarshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream,
VkStructureType rootType,
VkPipelineShaderStageCreateInfo* forUnmarshaling) {
(void)rootType;
vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
rootType = forUnmarshaling->sType;
}
unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
vkStream->read((VkPipelineShaderStageCreateFlags*)&forUnmarshaling->flags